Repository navigation
perf(agents): reuse dynamic tool schemas across attempts - #170673
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 545c2c51c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| tool.parameters = createComputerToolSchema( | ||
| availableActions(capabilities?.actions ?? COMPUTER_TOOL_ACTIONS), | ||
| targetScope, | ||
| ); |
There was a problem hiding this comment.
Propagate capability changes to the finalized computer tool
When a paired computer starts with the generic V1 schema and resolveTarget() later discovers V2 actions such as launch_app, this assignment updates only the source tool captured by createComputerTool. finalizeAgentTools normalizes and shallow-copies that tool into hook and Gateway wrappers, so the effective tool used on subsequent model turns retains the old parameters object; the previous in-place update propagated through the shared schema reference. Consequently, newly discovered actions remain unadvertised and can fail schema validation in the real finalized flow even though the direct-tool test passes. The replacement needs to reach the finalized projection or use an explicit invalidation/indirection mechanism.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Remove the ineffective live-envelope correction. Baseline normalization already detaches finalized schemas, so live wrapper refresh remains a separate existing issue.
|
Merged as d414a80, pinned to reviewed head 43aaad0. Required CI and security gates were green; both Codex review rounds were complete. Exactly one CPU-gated profile pair completed, with ten warmed turns per revision:
Both fixtures completed all turns, RPCs, and shutdown checks with no surviving children. This was one pair on a loaded host, so it supports sample/window observations only, not a local latency claim. SQL statements, requests, and MAIN counts were not measured; this descriptor-only change makes no SQL reduction claim and does not require another post-merge SQL pair. Knip script exports passed. The sequential production/full-tree retry finished before it could be cancelled and reported unused exports only in untouched memory, UI, and session-cache files. These are disclosed findings, not claimed as baseline-proven inherited failures. No additional proof wait or rerun was required under the instruction to land on green required CI. No proof-slot waiter remains. Follow-ups: computer capability refresh on already-finalized wrappers is preexisting; GC profiles do not identify the allocating owner. |
…0673) Cache bounded immutable dynamic schema variants by their resolved inputs and retain unchanged descriptor/output-schema snapshots across catalog changes. Keep executors, hooks, cancellation, and authority fresh per attempt. Add regressions for reuse, invalidation, nested mutation, and execution authority.
What Problem This Solves
Repeated agent attempts still rebuild dynamic tool schemas and republish stable output schemas when another tool in the catalog changes. This follows up on #170610.
User Impact
Agent attempts reuse immutable tool descriptors across equivalent capability and policy inputs. Tool execution, cancellation, hooks, and authority remain fresh per attempt. No configuration, storage migration, or operator action is required.
Why This Change Was Made
Computer actions/target scope, spawn availability, automation policy, and message capabilities now select bounded factory-owned schema variants. Goal and installed-skill schemas are static constants. Channel-owned schema properties are cloned before publication, and nested published descriptors remain immutable. Collector wrappers reuse schema variants without sharing their execution authority. Finalization retains each unchanged prepared descriptor—including the original output-schema source—even when another catalog member changes.
Removed repeated work and accepted edges:
Evidence
Focused regressions cover factory hit/miss/invalidation, channel-owned mutation, nested snapshot mutation, mixed-catalog output reuse, capability refresh, and collector revocation with shared schemas. PR CI is the broad test and static proof; local checks are changed-file formatting/lint and diff sanity.
Exactly one final baseline/candidate profile pair completed through the local CPU gate, with ten warmed turns on each revision. Both fixtures completed all turns, RPCs, and shutdown checks with no surviving fixture children. These are raw sample/window observations on a loaded host, not a controlled latency comparison. SQL detail tracing is disabled for this descriptor-only lane. No SQL reduction or local latency claim is made. Earlier GC stacks end at the collector/root, so they cannot identify the allocating owner.
Codex autoreview: two scoped rounds, clean through P2. A hosted review raised a computer capability-refresh issue. A baseline runtime probe confirmed that normalization already clones the source schema before refresh, leaving finalized wrappers detached on the base revision. The proposed envelope correction was ineffective and was removed; live wrapper refresh remains a preexisting follow-up outside this descriptor reuse change. Changed-file formatting, type-aware core lint, and
git diff --checkpass. Final-head CI passed on43aaad02f04b33e6b899ed8c3ccfec347b32a133: 46 successful jobs, 26 skipped; required CI/security gates are green. Successful jobs consumed 8906 job-seconds, including 2884 Node test job-seconds. Knip script exports passed with no findings. The initial production/full-tree scans timed out; their sequential retry completed before cancellation and reported unused exports in untouched memory, UI, and session-cache files. No finding names a changed file. Those findings are not claimed as proven inherited; no baseline rerun was performed. Landing follows the explicit instruction to merge on green required CI without waiting for more proof. No proof-slot wait remains. The focused message-schema rerun passed all six tests (7.26 s Vitest, 27.07 s runner wall time). The initial CI test-type errors were corrected; no test reruns were needed on the final head.LOC: production +163/-51, tests +269/-2, docs +2; total +434/-53 across 18 files. No SDK, update, Doctor, migration, plugin-loading, or service-lifecycle changes; those conditional proof cells do not apply.