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. 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..251319ed7 100644 --- a/src/mcp_tests/runtime_tools.rs +++ b/src/mcp_tests/runtime_tools.rs @@ -406,7 +406,18 @@ 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, 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), (Value::Null, true), @@ -415,9 +426,14 @@ 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": name, "arguments": arguments}) + }; + let params = if stateless { + mcp_2026_params(params) } else { - json!({"name": "get_runtime_status", "arguments": arguments}) + params }; let McpOutcome::Ok(value) = handle_mcp_request(&runtime, rpc("tools/call", Some(json!(1)), params), None).await 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", ] {