From 6682e0630c3c8cdee507121eb640a8640a0bce5e Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 17 Nov 2026 16:01:29 +0800 Subject: [PATCH 1/8] fix(mcp): accept cached ChatGPT runtime_status calls Normalize the direct legacy descriptor before normal canonical MCP admission. Current tools/list and gateway routing continue using get_runtime_status. Constraint: Retain the old webcodex connector without changing authorization Confidence: high Scope-risk: narrow --- docs/compatibility-policy.md | 1 + src/mcp/tools.rs | 6 +++--- src/mcp_tests/runtime_tools.rs | 17 ++++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/compatibility-policy.md b/docs/compatibility-policy.md index dd3c3fa10..c4366e954 100644 --- a/docs/compatibility-policy.md +++ b/docs/compatibility-policy.md @@ -75,6 +75,7 @@ The following code is retained for concrete consumers: | Update metadata absence and unsupported-format handling | A release or development build without verified installer metadata must not be treated as a safe automatic installation candidate. | | Retired-config rejection and sensitive-path exclusions | Reject retired authority/registry settings before use; do not silently select a different default. Old secret/config paths stay protected even when discovery is retired. | | Direct MCP `import_conversation_files_to_project` calls | Active ChatGPT conversations retain this Host file descriptor after refresh. Resolve its unchanged wire contract to `import_host_files` only at the MCP adapter boundary; see below. | +| Direct MCP `runtime_status` calls | The older ChatGPT `webcodex` connector retains this name. Resolve it to the read-only `get_runtime_status` before canonical MCP admission, with the same inputs. Current discovery and gateway targets use the canonical name. | | MCP dated revisions and Runner/management protocol checks | These serve external Hosts and independently upgraded components. Their lifecycle follows observed protocol consumers, not the v0.5 package number. | | `ActionAudit`, `ActionSession`, `ActionEvent` | Current tool audit and history infrastructure. The removed GPT Actions HTTP adapter does not make this domain obsolete. | diff --git a/src/mcp/tools.rs b/src/mcp/tools.rs index b7ebc8919..cbdc0597b 100644 --- a/src/mcp/tools.rs +++ b/src/mcp/tools.rs @@ -274,12 +274,12 @@ pub(super) struct McpToolCallParams { pub(super) arguments: Value, } -/// ChatGPT sessions can retain the pre-rename Host file descriptor even after -/// tools/list refresh. Its argument and fileParams contracts are identical. -/// Resolve only that direct MCP spelling; never registry names or gateway targets. +/// ChatGPT can retain these pre-rename direct descriptors with the same inputs. +/// Resolve only direct MCP calls, before the canonical tool's admission checks. fn canonical_direct_tool_name(name: &str) -> &str { match name { "import_conversation_files_to_project" => "import_host_files", + "runtime_status" => "get_runtime_status", _ => name, } } diff --git a/src/mcp_tests/runtime_tools.rs b/src/mcp_tests/runtime_tools.rs index c01450a61..41078b251 100644 --- a/src/mcp_tests/runtime_tools.rs +++ b/src/mcp_tests/runtime_tools.rs @@ -70,6 +70,7 @@ async fn mcp_tools_list_exposes_canonical_coding_bootstrap_and_runtime_status_ux tools.iter().all(|tool| tool["name"] != "start_coding_task"), "retired start_coding_task must stay out of MCP tools/list" ); + assert!(tools.iter().all(|tool| tool["name"] != "runtime_status")); let description = tool("work_on_project")["description"].as_str().unwrap(); assert_eq!( description, @@ -406,7 +407,17 @@ async fn adaptive_mcp_work_on_project_recovery_is_immediately_gateway_callable() #[tokio::test] async fn mcp_runtime_status_defaults_sparse_preserves_explicit_full_and_gateway_parity() { let runtime = test_runtime(); - for gateway in [false, true] { + assert!( + !crate::mcp::tools::adaptive_runtime_gateway_target_admitted_for_test( + "runtime_status", + true + ) + ); + for (name, gateway) in [ + ("get_runtime_status", false), + ("runtime_status", false), + ("get_runtime_status", true), + ] { for (arguments, sparse) in [ (json!({}), true), (Value::Null, true), @@ -415,9 +426,9 @@ async fn mcp_runtime_status_defaults_sparse_preserves_explicit_full_and_gateway_ (json!({"compact": false, "summary_only": true}), true), ] { let params = if gateway { - adaptive_runtime_gateway_params("get_runtime_status", arguments) + adaptive_runtime_gateway_params(name, arguments) } else { - json!({"name": "get_runtime_status", "arguments": arguments}) + json!({"name": name, "arguments": arguments}) }; let McpOutcome::Ok(value) = handle_mcp_request(&runtime, rpc("tools/call", Some(json!(1)), params), None).await From 318baa63a08cda6d59cdcee53b62eaa32ddf01ed Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 17 Nov 2026 16:04:18 +0800 Subject: [PATCH 2/8] test(mcp): cover the cached status route on both protocol revisions Update the earlier retired-name assertion in place. Keep canonical-only discovery and rejected routes covered. --- src/mcp_tests/runtime_tools.rs | 15 ++++++++++----- src/mcp_tests/tools.rs | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mcp_tests/runtime_tools.rs b/src/mcp_tests/runtime_tools.rs index 41078b251..251319ed7 100644 --- a/src/mcp_tests/runtime_tools.rs +++ b/src/mcp_tests/runtime_tools.rs @@ -70,7 +70,6 @@ async fn mcp_tools_list_exposes_canonical_coding_bootstrap_and_runtime_status_ux tools.iter().all(|tool| tool["name"] != "start_coding_task"), "retired start_coding_task must stay out of MCP tools/list" ); - assert!(tools.iter().all(|tool| tool["name"] != "runtime_status")); let description = tool("work_on_project")["description"].as_str().unwrap(); assert_eq!( description, @@ -413,10 +412,11 @@ async fn mcp_runtime_status_defaults_sparse_preserves_explicit_full_and_gateway_ true ) ); - for (name, gateway) in [ - ("get_runtime_status", false), - ("runtime_status", false), - ("get_runtime_status", true), + for (name, gateway, stateless) in [ + ("get_runtime_status", false, false), + ("runtime_status", false, false), + ("runtime_status", false, true), + ("get_runtime_status", true, false), ] { for (arguments, sparse) in [ (json!({}), true), @@ -430,6 +430,11 @@ async fn mcp_runtime_status_defaults_sparse_preserves_explicit_full_and_gateway_ } else { json!({"name": name, "arguments": arguments}) }; + let params = if stateless { + mcp_2026_params(params) + } else { + params + }; let McpOutcome::Ok(value) = handle_mcp_request(&runtime, rpc("tools/call", Some(json!(1)), params), None).await else { diff --git a/src/mcp_tests/tools.rs b/src/mcp_tests/tools.rs index 84a9c16c1..9e7f84952 100644 --- a/src/mcp_tests/tools.rs +++ b/src/mcp_tests/tools.rs @@ -48,7 +48,6 @@ async fn mcp_route_recovery_rejects_unavailable_tools_without_gateway_retry() { for stateless in [false, true] { for name in [ "tool_manifest", - "runtime_status", "unknown_tool_name", "get_work_result_state", ] { From 8239a24d27ed1defd74fa3f977137c66d7342659 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 17 Nov 2026 16:06:14 +0800 Subject: [PATCH 3/8] docs(mcp): reference the maintained cached-descriptor exceptions --- docs/agent/runtime-api-guidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/agent/runtime-api-guidelines.md b/docs/agent/runtime-api-guidelines.md index d8b712d68..cf8ba5d37 100644 --- a/docs/agent/runtime-api-guidelines.md +++ b/docs/agent/runtime-api-guidelines.md @@ -81,8 +81,8 @@ an alternate public import adapter. Test canonical parser/catalog/schema consistency, generated follow-ups, Direct and Gateway dispatch, App-only admission, OAuth/Project/permission boundaries, file-provenance rejection and authenticated operational routes. Verify retired -routes and tool names fail closed in every build configuration, except for the -[named direct MCP Host-import adapter](../compatibility-policy.md#named-cached-chatgpt-file-import-descriptor). -Keep its canonical admission and trust parity covered. Test description +routes and tool names fail closed in every build configuration. The named direct +MCP exceptions in the [compatibility policy](../compatibility-policy.md) must +retain canonical admission and trust checks. Test description and serialized schema budgets against the maintained MCP surface, not a retired 300-character/30-operation importer limit. From a3c09bbec764cd733fc6d32fa9afac0a93a0b16f Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 19 Nov 2026 01:26:06 +0800 Subject: [PATCH 4/8] fix: separate connection cards and accept cached ChatGPT discovery Keep current discovery public while routing the old read-only tool_manifest descriptor through canonical admission. Confidence: high Scope-risk: narrow --- apps/desktop/src/styles/product.css | 1 + docs/compatibility-policy.md | 1 + src/mcp/tools.rs | 1 + src/mcp_tests/tools.rs | 30 ++++++++++++++++++++--------- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/desktop/src/styles/product.css b/apps/desktop/src/styles/product.css index 8e5186844..e140556b7 100644 --- a/apps/desktop/src/styles/product.css +++ b/apps/desktop/src/styles/product.css @@ -599,6 +599,7 @@ input[type="checkbox"].desktop-switch:hover:not(:disabled):not(:checked) { backg .connection-route strong { font-weight: 500; overflow-wrap: anywhere; } .connection-context > button { margin-left: auto; } .connection-list { gap: 16px; border-top: 0; } +.connection-list:not(:empty) + .first-read-guide { margin-top: 16px; } .connection-profile { padding: var(--desktop-panel-inset); border: 1px solid var(--ui-border-subtle); border-radius: var(--ui-radius-lg); background: var(--ui-content); box-shadow: var(--ui-shadow-surface); } .connection-profile .workspace-section-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; } .connection-profile .workspace-section-heading > div { min-width: 0; flex: 1 1 200px; } diff --git a/docs/compatibility-policy.md b/docs/compatibility-policy.md index c4366e954..2e8cd14bf 100644 --- a/docs/compatibility-policy.md +++ b/docs/compatibility-policy.md @@ -76,6 +76,7 @@ The following code is retained for concrete consumers: | Retired-config rejection and sensitive-path exclusions | Reject retired authority/registry settings before use; do not silently select a different default. Old secret/config paths stay protected even when discovery is retired. | | Direct MCP `import_conversation_files_to_project` calls | Active ChatGPT conversations retain this Host file descriptor after refresh. Resolve its unchanged wire contract to `import_host_files` only at the MCP adapter boundary; see below. | | Direct MCP `runtime_status` calls | The older ChatGPT `webcodex` connector retains this name. Resolve it to the read-only `get_runtime_status` before canonical MCP admission, with the same inputs. Current discovery and gateway targets use the canonical name. | +| Direct MCP `tool_manifest` calls | The same connector retains this discovery name. Resolve it to `read_tool_manifest` before canonical MCP admission. Catalog results use current tool names and routes. | | MCP dated revisions and Runner/management protocol checks | These serve external Hosts and independently upgraded components. Their lifecycle follows observed protocol consumers, not the v0.5 package number. | | `ActionAudit`, `ActionSession`, `ActionEvent` | Current tool audit and history infrastructure. The removed GPT Actions HTTP adapter does not make this domain obsolete. | diff --git a/src/mcp/tools.rs b/src/mcp/tools.rs index cbdc0597b..290f9e2d9 100644 --- a/src/mcp/tools.rs +++ b/src/mcp/tools.rs @@ -280,6 +280,7 @@ fn canonical_direct_tool_name(name: &str) -> &str { match name { "import_conversation_files_to_project" => "import_host_files", "runtime_status" => "get_runtime_status", + "tool_manifest" => "read_tool_manifest", _ => name, } } diff --git a/src/mcp_tests/tools.rs b/src/mcp_tests/tools.rs index 9e7f84952..4904fea8e 100644 --- a/src/mcp_tests/tools.rs +++ b/src/mcp_tests/tools.rs @@ -46,11 +46,7 @@ fn mcp_extension_route_lookup_preserves_membership_without_schema_materializatio async fn mcp_route_recovery_rejects_unavailable_tools_without_gateway_retry() { let runtime = test_runtime_with_mcp_settings(true, false); for stateless in [false, true] { - for name in [ - "tool_manifest", - "unknown_tool_name", - "get_work_result_state", - ] { + for name in ["unknown_tool_name", "get_work_result_state"] { let params = json!({"name": name, "arguments": {}}); let params = if stateless { mcp_2026_params(params) @@ -140,11 +136,27 @@ async fn mcp_route_recovery_current_discovery_matches_callable_contracts() { .is_none()); } assert!(bootstrap["inputSchema"]["properties"].get("_wc").is_some()); - for (name, arguments) in [ - ("get_runtime_status", json!({"compact": true})), - ("read_tool_manifest", json!({"tool_name": "read_files"})), + for (descriptor_name, name, arguments) in [ + ( + "get_runtime_status", + "get_runtime_status", + json!({"compact": true}), + ), + ( + "read_tool_manifest", + "read_tool_manifest", + json!({"tool_name": "read_files"}), + ), + ( + "read_tool_manifest", + "tool_manifest", + json!({"tool_name": "read_files"}), + ), ] { - let descriptor = tools.iter().find(|tool| tool["name"] == name).unwrap(); + let descriptor = tools + .iter() + .find(|tool| tool["name"] == descriptor_name) + .unwrap(); for key in arguments.as_object().unwrap().keys() { assert!(descriptor["inputSchema"]["properties"].get(key).is_some()); } From 903612f71704d2a8a419c651fd40ed86864cba84 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 19 Nov 2026 01:26:06 +0800 Subject: [PATCH 5/8] chore(release): align 0.5.11 workspace and installer versions --- Cargo.lock | 44 +++++++++++++------------- Cargo.toml | 2 +- apps/desktop/package-lock.json | 4 +-- apps/desktop/package.json | 2 +- apps/desktop/src-tauri/Cargo.lock | 14 ++++---- apps/desktop/src-tauri/Cargo.toml | 2 +- apps/desktop/src-tauri/tauri.conf.json | 2 +- npm/webcodex/manifest.example.json | 14 ++++---- npm/webcodex/package.json | 2 +- npm/webcodex/test/self-test.js | 2 +- 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f38ce4d48..93bb0256e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5537,7 +5537,7 @@ dependencies = [ [[package]] name = "webcodex" -version = "0.5.10" +version = "0.5.11" dependencies = [ "anyhow", "base64", @@ -5588,7 +5588,7 @@ dependencies = [ [[package]] name = "webcodex-admin" -version = "0.5.10" +version = "0.5.11" dependencies = [ "reqwest 0.12.28", "serde_json", @@ -5598,7 +5598,7 @@ dependencies = [ [[package]] name = "webcodex-browser" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64", "fs2", @@ -5619,14 +5619,14 @@ dependencies = [ [[package]] name = "webcodex-build-info" -version = "0.5.10" +version = "0.5.11" dependencies = [ "webcodex-core", ] [[package]] name = "webcodex-cli" -version = "0.5.10" +version = "0.5.11" dependencies = [ "chrono", "crossterm", @@ -5660,7 +5660,7 @@ dependencies = [ [[package]] name = "webcodex-code-mode" -version = "0.5.10" +version = "0.5.11" dependencies = [ "deno_core_icudata", "serde", @@ -5671,7 +5671,7 @@ dependencies = [ [[package]] name = "webcodex-computer" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64", "block2", @@ -5695,7 +5695,7 @@ dependencies = [ [[package]] name = "webcodex-computer-control" -version = "0.5.10" +version = "0.5.11" dependencies = [ "serde", "serde_json", @@ -5706,7 +5706,7 @@ dependencies = [ [[package]] name = "webcodex-core" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64", "getrandom 0.3.4", @@ -5720,7 +5720,7 @@ dependencies = [ [[package]] name = "webcodex-environment" -version = "0.5.10" +version = "0.5.11" dependencies = [ "dirs", "fs2", @@ -5746,7 +5746,7 @@ dependencies = [ [[package]] name = "webcodex-lsp" -version = "0.5.10" +version = "0.5.11" dependencies = [ "libc", "serde_json", @@ -5780,7 +5780,7 @@ dependencies = [ [[package]] name = "webcodex-persistent-shell" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64", "libc", @@ -5792,7 +5792,7 @@ dependencies = [ [[package]] name = "webcodex-process" -version = "0.5.10" +version = "0.5.11" dependencies = [ "libc", "tempfile", @@ -5801,7 +5801,7 @@ dependencies = [ [[package]] name = "webcodex-runner" -version = "0.5.10" +version = "0.5.11" dependencies = [ "agent-client-protocol-schema", "base64", @@ -5844,7 +5844,7 @@ dependencies = [ [[package]] name = "webcodex-runner-config" -version = "0.5.10" +version = "0.5.11" dependencies = [ "serde", "toml 0.8.23", @@ -5853,7 +5853,7 @@ dependencies = [ [[package]] name = "webcodex-runner-registry" -version = "0.5.10" +version = "0.5.11" dependencies = [ "chrono", "serde", @@ -5867,7 +5867,7 @@ dependencies = [ [[package]] name = "webcodex-store" -version = "0.5.10" +version = "0.5.11" dependencies = [ "anyhow", "chrono", @@ -5885,7 +5885,7 @@ dependencies = [ [[package]] name = "webcodex-tool-contracts" -version = "0.5.10" +version = "0.5.11" dependencies = [ "regex", "schemars 1.2.2", @@ -5897,7 +5897,7 @@ dependencies = [ [[package]] name = "webcodex-tool-runtime-contracts" -version = "0.5.10" +version = "0.5.11" dependencies = [ "serde", "serde_json", @@ -5909,7 +5909,7 @@ dependencies = [ [[package]] name = "webcodex-validation" -version = "0.5.10" +version = "0.5.11" dependencies = [ "libc", "serde", @@ -5926,7 +5926,7 @@ dependencies = [ [[package]] name = "webcodex-workflow-session" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64", "chrono", @@ -5944,7 +5944,7 @@ dependencies = [ [[package]] name = "webcodex-workspace" -version = "0.5.10" +version = "0.5.11" dependencies = [ "glob", "serde", diff --git a/Cargo.toml b/Cargo.toml index 8f0cbff05..b0902065f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.5.10" +version = "0.5.11" license = "Apache-2.0" edition = "2021" diff --git a/apps/desktop/package-lock.json b/apps/desktop/package-lock.json index 0bcbb293f..ffebc11e7 100644 --- a/apps/desktop/package-lock.json +++ b/apps/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "@webcodex/desktop", - "version": "0.5.10", + "version": "0.5.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@webcodex/desktop", - "version": "0.5.10", + "version": "0.5.11", "dependencies": { "@mantine/core": "^9.6.2", "@mantine/hooks": "^9.6.2", diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 21a6670d9..578863e70 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@webcodex/desktop", "private": true, - "version": "0.5.10", + "version": "0.5.11", "type": "module", "scripts": { "dev": "vite --host 127.0.0.1 --port 1420", diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock index 4ce40b511..0c35cebe2 100644 --- a/apps/desktop/src-tauri/Cargo.lock +++ b/apps/desktop/src-tauri/Cargo.lock @@ -5035,14 +5035,14 @@ dependencies = [ [[package]] name = "webcodex-build-info" -version = "0.5.10" +version = "0.5.11" dependencies = [ "webcodex-core", ] [[package]] name = "webcodex-computer-control" -version = "0.5.10" +version = "0.5.11" dependencies = [ "serde", "serde_json", @@ -5053,7 +5053,7 @@ dependencies = [ [[package]] name = "webcodex-core" -version = "0.5.10" +version = "0.5.11" dependencies = [ "base64 0.22.1", "getrandom 0.3.4", @@ -5067,7 +5067,7 @@ dependencies = [ [[package]] name = "webcodex-desktop" -version = "0.5.10" +version = "0.5.11" dependencies = [ "libc", "reqwest 0.12.28", @@ -5099,7 +5099,7 @@ dependencies = [ [[package]] name = "webcodex-environment" -version = "0.5.10" +version = "0.5.11" dependencies = [ "dirs 6.0.0", "fs2", @@ -5141,7 +5141,7 @@ dependencies = [ [[package]] name = "webcodex-process" -version = "0.5.10" +version = "0.5.11" dependencies = [ "libc", "windows-sys 0.61.2", @@ -5149,7 +5149,7 @@ dependencies = [ [[package]] name = "webcodex-runner-config" -version = "0.5.10" +version = "0.5.11" dependencies = [ "serde", "toml 0.8.2", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 61935a1c6..ab66e7ba1 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webcodex-desktop" -version = "0.5.10" +version = "0.5.11" description = "WebCodex Desktop runtime and setup control surface" edition = "2021" publish = false diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 9caa74368..0b5c98f92 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "https://schema.tauri.app/config/2", "productName": "WebCodex Desktop", "mainBinaryName": "WebCodex", - "version": "0.5.10", + "version": "0.5.11", "identifier": "dev.webcodex.desktop", "build": { "beforeDevCommand": "npm run dev", diff --git a/npm/webcodex/manifest.example.json b/npm/webcodex/manifest.example.json index 5037ab040..fc9dc0c77 100644 --- a/npm/webcodex/manifest.example.json +++ b/npm/webcodex/manifest.example.json @@ -1,29 +1,29 @@ { - "version": "0.5.10", + "version": "0.5.11", "binaries": ["webcodex", "webcodex-server", "webcodex-runner"], "artifacts": { "linux-x64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-linux-x64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-linux-x64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" }, "linux-arm64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-linux-arm64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-linux-arm64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" }, "darwin-x64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-darwin-x64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-darwin-x64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" }, "darwin-arm64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-darwin-arm64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-darwin-arm64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" }, "win32-x64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-win32-x64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-win32-x64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" }, "win32-arm64": { - "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.10/webcodex-v0.5.10-win32-arm64.tar.gz", + "url": "https://github.com/yyjeqhc/webcodex/releases/download/v0.5.11/webcodex-v0.5.11-win32-arm64.tar.gz", "sha256": "REPLACE_WITH_RELEASE_ARTIFACT_SHA256" } } diff --git a/npm/webcodex/package.json b/npm/webcodex/package.json index b2d3021b7..bb747bae3 100644 --- a/npm/webcodex/package.json +++ b/npm/webcodex/package.json @@ -1,6 +1,6 @@ { "name": "@yyjeqhc/webcodex", - "version": "0.5.10", + "version": "0.5.11", "description": "Connect ChatGPT, Claude, and other AI agents to repositories and developer tools on your own machines.", "keywords": [ "ai", diff --git a/npm/webcodex/test/self-test.js b/npm/webcodex/test/self-test.js index 1cd760933..a492e670e 100644 --- a/npm/webcodex/test/self-test.js +++ b/npm/webcodex/test/self-test.js @@ -209,7 +209,7 @@ async function expectInstallFailure(action, destination, tempRoot, pattern) { } async function main() { - assert.strictEqual(packageJson.version, "0.5.10"); + assert.strictEqual(packageJson.version, "0.5.11"); assert.deepStrictEqual(packageJson.bin, { webcodex: "bin/webcodex.js" }); assert.deepStrictEqual(install.RUNTIME_BINARIES, ["webcodex", "webcodex-server", "webcodex-runner"]); assert.deepStrictEqual(install.SUPPORTED_PLATFORM_KEYS, ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64", "win32-arm64"]); From 70674e1dce4a7b39386d7b8c9ffa0e3e0bc75e7f Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 19 Nov 2026 01:30:48 +0800 Subject: [PATCH 6/8] fix(mcp): route observed legacy ChatGPT closeout and changes calls Replay the cached call shape through existing gateway admission, using canonical validation and scope for both business arguments and recording context. Constraint: Preserve Host review, tool visibility, and workflow session authority Confidence: high Scope-risk: moderate --- docs/compatibility-policy.md | 1 + src/mcp/tools/call.rs | 39 +++++++- src/mcp_tests/model_surface.rs | 157 +++++++++++++++++++++++++++++++++ 3 files changed, 193 insertions(+), 4 deletions(-) diff --git a/docs/compatibility-policy.md b/docs/compatibility-policy.md index 2e8cd14bf..40dc07005 100644 --- a/docs/compatibility-policy.md +++ b/docs/compatibility-policy.md @@ -77,6 +77,7 @@ The following code is retained for concrete consumers: | Direct MCP `import_conversation_files_to_project` calls | Active ChatGPT conversations retain this Host file descriptor after refresh. Resolve its unchanged wire contract to `import_host_files` only at the MCP adapter boundary; see below. | | Direct MCP `runtime_status` calls | The older ChatGPT `webcodex` connector retains this name. Resolve it to the read-only `get_runtime_status` before canonical MCP admission, with the same inputs. Current discovery and gateway targets use the canonical name. | | Direct MCP `tool_manifest` calls | The same connector retains this discovery name. Resolve it to `read_tool_manifest` before canonical MCP admission. Catalog results use current tool names and routes. | +| Cached MCP `finish_coding_task` and `show_changes` calls | The retained ChatGPT calls use canonical gateway admission on the stateless Adaptive surface. `show_changes` targets `read_workspace_changes`. These cached calls and the gateway's exact `finish_coding_task` target accept the legacy `recording_session_id` through the canonical recorder checks. | | MCP dated revisions and Runner/management protocol checks | These serve external Hosts and independently upgraded components. Their lifecycle follows observed protocol consumers, not the v0.5 package number. | | `ActionAudit`, `ActionSession`, `ActionEvent` | Current tool audit and history infrastructure. The removed GPT Actions HTTP adapter does not make this domain obsolete. | diff --git a/src/mcp/tools/call.rs b/src/mcp/tools/call.rs index d740146c8..6b5548545 100644 --- a/src/mcp/tools/call.rs +++ b/src/mcp/tools/call.rs @@ -285,7 +285,35 @@ impl ParsedCall { // adapter-owned invocation metadata is removed. Specialized gateways keep // their existing bounded audit projections below. let raw_mcp_arguments = params.arguments.clone(); - let via_adaptive_runtime_gateway = params.name == ADAPTIVE_RUNTIME_GATEWAY_TOOL_NAME; + // ChatGPT can retain these direct review callables, whose current route is the gateway. + let cached_gateway_target = match (stateless_2026 && !cli, params.name.as_str()) { + (true, "finish_coding_task") => Some("finish_coding_task"), + (true, "show_changes") => Some("read_workspace_changes"), + _ => None, + }; + let via_adaptive_runtime_gateway = + params.name == ADAPTIVE_RUNTIME_GATEWAY_TOOL_NAME || cached_gateway_target.is_some(); + let cached_recorder = cached_gateway_target.is_some() + || (stateless_2026 + && !cli + && params.name == ADAPTIVE_RUNTIME_GATEWAY_TOOL_NAME + && params.arguments["tool"].as_str().map(str::trim) == Some("finish_coding_task")); + if cached_recorder { + if let Some(arguments) = params + .arguments + .as_object_mut() + .filter(|arguments| !arguments.contains_key(MCP_INVOCATION_ENVELOPE_FIELD)) + { + if let Some(record) = arguments + .remove(crate::tool_runtime::sessions::TOOL_CALL_RECORDING_SESSION_ID_FIELD) + { + arguments.insert( + MCP_INVOCATION_ENVELOPE_FIELD.into(), + json!({"record": record}), + ); + } + } + } if cli && params.arguments.get("_wc").is_some() { return Err(McpOutcome::BadRequest(rpc_error( id, @@ -305,7 +333,7 @@ impl ParsedCall { } } let invocation = match parse_mcp_invocation_envelope( - ¶ms.name, + cached_gateway_target.unwrap_or(¶ms.name), &mut params.arguments, stateless_2026 && !cli, ) { @@ -353,13 +381,16 @@ impl ParsedCall { ))); } if via_adaptive_runtime_gateway { - let (target, arguments) = + let (target, arguments) = if let Some(target) = cached_gateway_target { + (target.to_owned(), params.arguments) + } else { match unwrap_adaptive_runtime_gateway_arguments(params.arguments) { Ok(target) => target, Err(message) => { return Err(McpOutcome::BadRequest(rpc_error(id, -32602, message))); } - }; + } + }; if !context.exposure.allows(&target) || (cli && !crate::mcp::cli::admits(&target)) { return Err(McpOutcome::BadRequest(rpc_error( id, diff --git a/src/mcp_tests/model_surface.rs b/src/mcp_tests/model_surface.rs index 39191e8cc..8bd4b05ef 100644 --- a/src/mcp_tests/model_surface.rs +++ b/src/mcp_tests/model_surface.rs @@ -739,6 +739,163 @@ async fn closeout_helpers_remain_visible_with_exact_gateway_contracts() { } } +#[tokio::test] +async fn cached_finish_coding_task_uses_gateway_and_canonical_recording() { + let runtime = test_runtime(); + let session = runtime.sessions.start_session(None, None); + let arguments = json!({ + "project": "missing-project", + "session_id": session.session_id + }); + let mut cached = json!({"name": "finish_coding_task", "arguments": arguments.clone()}); + cached["arguments"]["recording_session_id"] = json!(session.session_id); + let mut gateway = adaptive_runtime_gateway_params("finish_coding_task", arguments); + let mut cached_gateway = gateway.clone(); + cached_gateway["arguments"]["recording_session_id"] = json!(session.session_id); + gateway["arguments"]["_wc"] = json!({"record": session.session_id}); + for params in [cached.clone(), cached_gateway.clone(), gateway] { + let outcome = handle_mcp_request( + &runtime, + rpc("tools/call", Some(json!(67)), mcp_2026_params(params)), + None, + ) + .await; + let McpOutcome::Ok(value) = outcome else { + panic!("expected canonical closeout validation: {outcome:?}"); + }; + assert_eq!( + value["result"]["structuredContent"]["output"]["error_kind"], + "unknown_project" + ); + } + assert_eq!( + runtime + .sessions + .summary(&session.session_id, Some(10)) + .unwrap() + .counts + .tool_calls, + 3 + ); + + let scoped = crate::auth::AuthContext::new(crate::auth::AuthKind::OAuth2Token); + let denied = handle_mcp_request( + &runtime, + rpc( + "tools/call", + Some(json!(67)), + mcp_2026_params(cached.clone()), + ), + Some(&scoped), + ) + .await; + assert!(matches!(denied, McpOutcome::Forbidden { .. }), "{denied:?}"); + + let older_protocol = handle_mcp_request( + &runtime, + rpc("tools/call", Some(json!(67)), cached.clone()), + None, + ) + .await; + let McpOutcome::BadRequest(value) = older_protocol else { + panic!("older MCP protocols must still require the gateway: {older_protocol:?}"); + }; + assert!(value["error"]["message"] + .as_str() + .unwrap() + .contains("not directly callable on Adaptive Runtime")); + + cached["arguments"]["_wc"] = json!({"record": session.session_id}); + let conflicting = handle_mcp_request( + &runtime, + rpc("tools/call", Some(json!(67)), mcp_2026_params(cached)), + None, + ) + .await; + let McpOutcome::BadRequest(value) = conflicting else { + panic!("expected rejection for duplicate recorder provenance: {conflicting:?}"); + }; + assert!(value["error"]["message"] + .as_str() + .unwrap() + .contains("legacy MCP invocation field 'recording_session_id'")); + + cached_gateway["arguments"]["recording_session_id"] = json!(false); + let invalid = handle_mcp_request( + &runtime, + rpc( + "tools/call", + Some(json!(67)), + mcp_2026_params(cached_gateway), + ), + None, + ) + .await; + let McpOutcome::BadRequest(value) = invalid else { + panic!("expected canonical recorder validation: {invalid:?}"); + }; + assert_eq!( + value["error"]["message"], + "field '_wc.record' must be a non-empty string" + ); +} + +#[tokio::test] +async fn cached_show_changes_uses_canonical_gateway_route() { + let runtime = test_runtime(); + let arguments = json!({"project": "missing-project", "include_diff": false}); + let alias = handle_mcp_request( + &runtime, + rpc( + "tools/call", + Some(json!(68)), + mcp_2026_params(json!({"name": "show_changes", "arguments": arguments.clone()})), + ), + None, + ) + .await; + let McpOutcome::Ok(alias) = alias else { + panic!("cached descriptor should reach canonical project validation: {alias:?}"); + }; + let gateway = handle_mcp_request( + &runtime, + rpc( + "tools/call", + Some(json!(68)), + mcp_2026_params(adaptive_runtime_gateway_params( + "read_workspace_changes", + arguments.clone(), + )), + ), + None, + ) + .await; + let McpOutcome::Ok(gateway) = gateway else { + panic!("canonical read_workspace_changes gateway: {gateway:?}"); + }; + let canonical_result = &gateway["result"]["structuredContent"]; + assert_eq!(canonical_result["success"], false); + assert_eq!(alias["result"]["structuredContent"], *canonical_result); + + let direct = handle_mcp_request( + &runtime, + rpc( + "tools/call", + Some(json!(68)), + mcp_2026_params(json!({"name": "read_workspace_changes", "arguments": arguments})), + ), + None, + ) + .await; + let McpOutcome::BadRequest(value) = direct else { + panic!("current descriptor still requires the gateway: {direct:?}"); + }; + assert!(value["error"]["message"] + .as_str() + .unwrap() + .contains("not directly callable on Adaptive Runtime")); +} + #[tokio::test] async fn long_tail_direct_call_is_rejected_with_gateway_guidance() { let runtime = test_runtime(); From a9190f3c7357e9ae1c0bae01966024ade6fcc670 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 19 Nov 2026 01:35:11 +0800 Subject: [PATCH 7/8] test(mcp): prove legacy requests record the selected session Separate the business and recording session so the regression detects dropped compatibility arguments. --- src/mcp_tests/model_surface.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mcp_tests/model_surface.rs b/src/mcp_tests/model_surface.rs index 8bd4b05ef..8b18d6c4f 100644 --- a/src/mcp_tests/model_surface.rs +++ b/src/mcp_tests/model_surface.rs @@ -743,16 +743,17 @@ async fn closeout_helpers_remain_visible_with_exact_gateway_contracts() { async fn cached_finish_coding_task_uses_gateway_and_canonical_recording() { let runtime = test_runtime(); let session = runtime.sessions.start_session(None, None); + let recorder = runtime.sessions.start_session(None, None); let arguments = json!({ "project": "missing-project", "session_id": session.session_id }); let mut cached = json!({"name": "finish_coding_task", "arguments": arguments.clone()}); - cached["arguments"]["recording_session_id"] = json!(session.session_id); + cached["arguments"]["recording_session_id"] = json!(recorder.session_id); let mut gateway = adaptive_runtime_gateway_params("finish_coding_task", arguments); let mut cached_gateway = gateway.clone(); - cached_gateway["arguments"]["recording_session_id"] = json!(session.session_id); - gateway["arguments"]["_wc"] = json!({"record": session.session_id}); + cached_gateway["arguments"]["recording_session_id"] = json!(recorder.session_id); + gateway["arguments"]["_wc"] = json!({"record": recorder.session_id}); for params in [cached.clone(), cached_gateway.clone(), gateway] { let outcome = handle_mcp_request( &runtime, @@ -771,7 +772,7 @@ async fn cached_finish_coding_task_uses_gateway_and_canonical_recording() { assert_eq!( runtime .sessions - .summary(&session.session_id, Some(10)) + .summary(&recorder.session_id, Some(10)) .unwrap() .counts .tool_calls, @@ -805,7 +806,7 @@ async fn cached_finish_coding_task_uses_gateway_and_canonical_recording() { .unwrap() .contains("not directly callable on Adaptive Runtime")); - cached["arguments"]["_wc"] = json!({"record": session.session_id}); + cached["arguments"]["_wc"] = json!({"record": recorder.session_id}); let conflicting = handle_mcp_request( &runtime, rpc("tools/call", Some(json!(67)), mcp_2026_params(cached)), From 0793e6774fa52e9d85e3f1d428c979cb7fa44abc Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 19 Nov 2026 01:36:11 +0800 Subject: [PATCH 8/8] fix(mcp): record canonical names for cached gateway calls Use the same closed alias mapping for dispatch and HTTP activity once the request protocol and surface are known. --- src/mcp.rs | 14 +++++++++++++- src/mcp/tools.rs | 9 +++++++++ src/mcp/tools/call.rs | 9 ++++----- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/mcp.rs b/src/mcp.rs index 0e2cbe4f7..f81bdacfd 100644 --- a/src/mcp.rs +++ b/src/mcp.rs @@ -620,7 +620,7 @@ pub async fn mcp_post(req: &mut Request, depot: &mut Depot, res: &mut Response) guard.set_jsonrpc_id(jsonrpc_id_safe(request.id.as_ref())); guard.set_method(request.method.clone()); - let tool_name = if request.method == "tools/call" { + let mut tool_name = if request.method == "tools/call" { tools::tool_name_from_params(&request.params) } else { None @@ -681,6 +681,18 @@ pub async fn mcp_post(req: &mut Request, depot: &mut Depot, res: &mut Response) return; } }; + if request.method == "tools/call" + && protocol_era == McpProtocolEra::Stateless2026 + && surface == request_policy::McpSurface::Adaptive + { + if let Some(target) = request.params["name"] + .as_str() + .and_then(tools::cached_adaptive_gateway_target) + { + tool_name = Some(target.to_owned()); + guard.set_tool_name(tool_name.clone()); + } + } let policy = policy_selection.effective; // Equal explicit profiles still have request-header provenance. Clone only // the lightweight view when policy or its diagnostic source differs; shared diff --git a/src/mcp/tools.rs b/src/mcp/tools.rs index 290f9e2d9..cb22c89e7 100644 --- a/src/mcp/tools.rs +++ b/src/mcp/tools.rs @@ -285,6 +285,15 @@ fn canonical_direct_tool_name(name: &str) -> &str { } } +/// Cached direct ChatGPT calls on the stateless Adaptive surface. +pub(super) fn cached_adaptive_gateway_target(name: &str) -> Option<&'static str> { + match name { + "finish_coding_task" => Some("finish_coding_task"), + "show_changes" => Some("read_workspace_changes"), + _ => None, + } +} + pub(super) fn tool_name_from_params(params: &Value) -> Option { let name = params.get("name").and_then(Value::as_str)?; if name == ADAPTIVE_RUNTIME_GATEWAY_TOOL_NAME { diff --git a/src/mcp/tools/call.rs b/src/mcp/tools/call.rs index 6b5548545..d771edfbb 100644 --- a/src/mcp/tools/call.rs +++ b/src/mcp/tools/call.rs @@ -285,11 +285,10 @@ impl ParsedCall { // adapter-owned invocation metadata is removed. Specialized gateways keep // their existing bounded audit projections below. let raw_mcp_arguments = params.arguments.clone(); - // ChatGPT can retain these direct review callables, whose current route is the gateway. - let cached_gateway_target = match (stateless_2026 && !cli, params.name.as_str()) { - (true, "finish_coding_task") => Some("finish_coding_task"), - (true, "show_changes") => Some("read_workspace_changes"), - _ => None, + let cached_gateway_target = if stateless_2026 && !cli { + cached_adaptive_gateway_target(¶ms.name) + } else { + None }; let via_adaptive_runtime_gateway = params.name == ADAPTIVE_RUNTIME_GATEWAY_TOOL_NAME || cached_gateway_target.is_some();