Repository navigation
refactor: make tool surface policy explicit and sink inactive continuations - #772
Merged
Merged
Conversation
7 tasks done
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch makes Adaptive Runtime model-surface policy explicit, removes inactive fresh-turn continuation descriptors from the ordinary Host surface, and clarifies that accepted input aliases are ergonomic model-turn savings rather than API compatibility.
The branch was rebased onto
ced97978cb250c1d3b01434c2585d27c9ecda931(#770) before the independent review:ced97978cb250c1d3b01434c2585d27c9ecda93147e6ca9dd585455a0d04bda3191ed423c9ea2f4cWhile review/validation was running, main advanced once more to
d4626687b53f30dfd1b555bd84a860e819375db5(#771). The branch is therefore currently behind main by one commit. A read-only merge-tree check found no conflict markers, and GitHub reports the PR as mergeable. Per repository rules, no second rebase/history rewrite was performed without a new explicit request.What changes
Explicit Direct policy
ToolDefinitionnow owns one optional:with
ToolDirectReason::{CoreWorkflow, HostIntegration, Presentation, Continuation}.Rank and reason can no longer drift as independent metadata. The policy remains presentation/routing-only: it does not affect category, authority, effect, risk, approval, idempotency, Runner capability, or model-facing output/schema.
Current default Direct surface has no Continuation entries. Dedicated descriptors are justified as:
Inactive continuation surface is sunk
wait_for_job_terminal: Direct -> Gatewaywait_for_agent_events: Direct -> Gatewaypresent_agent_continuation: Direct -> ModelHiddenpresent_job_terminal_continuation: Direct -> ModelHiddenDurable Job/Agent wait state, ToolCalls, handlers, authorization, keyed replay, resources, and hidden App protocol remain intact.
The two presentation tools are deliberately not routed through
call_runtime_tool: their App resource association requires their dedicated descriptor when/if they are re-admitted.present_work_resultandpresent_goal_planremain Direct Presentation tools.import_conversation_files_to_projectremains Direct HostIntegration.ModelWorkflowPolicy/WEBCODEX_MCP_APP_RESUME_MODEremain guidance/delivery policy and do not dynamically changetools/listor ToolDefinition routing.Generated SuggestedToolCall projections now follow the current canonical route on both schema and value sides:
call_runtime_toolRecommended flows retain the canonical recipes internally but ordinary discovery omits flows containing hidden model operations.
Ergonomic input aliases
argv -> argsfor structured process calls is documented and implemented as model-turn-economy normalization, not compatibility:The canonical ToolCall keeps only
args. The stableinput_normalization=argv_to_argsobservation remains.Retired endpoint name
Default Adaptive Runtime no longer registers/parses
attach_agent_endpoint; the canonical name isrotate_agent_continuation_endpoint.The old name is retained only under the frozen
legacy-gpt-actionsfeature because that adapter is a concrete consumer. This is an intentionally narrow legacy exception and should disappear with GPT Actions rather than become a pattern for new aliases.Model-surface measurement
Deterministic compact
tools/listmeasurements on the reviewed rebased HEAD:These are serialized result bytes, not token counts or RPC-envelope sizes.
Compared with the branch's recorded pre-change baseline, ordinary advertised tool count drops by four per profile while the 18 App-only protocol descriptors remain present when Apps are enabled.
Independent review
The branch was independently reviewed after the user rebased it onto #770.
Review focus:
No production-code blocker or correctness issue was found, so no artificial review-fix commit was added.
One known bounded exception remains: a build with
legacy-gpt-actionsstill compiles the old endpoint ToolDefinition/ToolCall spelling so the frozen adapter can parse it. The default Adaptive build does not expose it. Fully adapter-localizing this retiring alias would add structure only for a feature scheduled for removal.Validation
Post-rebase review validation:
webcodex-tool-contracts: 255 passedwebcodex --lib: 3098 passed, 0 failed, 3 ignoredwebcodex-tool-contracts --features legacy-gpt-actions: 256 passedcargo fmt --all -- --check: passedgit diff --check origin/main...HEAD: passedThe full root library run is after the #770 rebase, so #770's typed Job-query/post-record projection changes are included in this evidence. #771 merged after that run; its overlap with this branch was checked read-only and GitHub currently reports the PR mergeable, but this branch has not been rebased/retested on top of #771.
No full workspace/release/E2E run was performed.
No deployment or Server/Runner restart was performed.