Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis 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: 322b961189
ℹ️ 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".
|
Codex review: blocked before merge. What this changesThis PR publishes bounded canonical tool inputs in Code Mode and Tool Search while preserving provider projections and permitted-action restrictions. Example: A Google-backed Code Mode session reads missing-policy-proof.txt with optional: true.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR repairs a remaining mismatch between tool guidance and accepted inputs, including collector restriction and policy narrowing; no actionable correctness finding remains. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherAgent finalization projects tool schemas for providers; availability and Gateway policy restrict them before Tool Search publishes hints and Code Mode generates declarations. flowchart TD
A[Tool input contracts] --> B[Availability preparation]
B --> C[Provider schema finalization]
C --> D[Canonical schema metadata]
D --> E[Policy and collector transformations]
E --> F[Tool Search catalog]
F --> G[Code Mode declarations]
F --> H[Validated tool execution]
Technical reviewBest possible solution: Keep bounded canonical guidance in the existing schema metadata owner and apply availability and action restrictions consistently across all schema representations. Do we have a high-confidence way to reproduce the issue? Current-main catalog publication consumes provider-projected parameters, while canonical validation is retained separately; the linked report and supplied before/after captures demonstrate the resulting guidance mismatch without running target code during this review. Is this the best way to solve the issue? The patch fixes the existing publication and transformation owners, preserves execution-only precedence and provider normalization, and adds distinct regressions for depth bounds, collector lifecycle, and policy narrowing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 77a0a8426513. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +65, Tests +219, Docs +1, Other +2. Total +287 across 10 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 13, 2026, 2:34 PM ET / 19:34 UTC (Revision 5). |
|
@codex review |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9b02dcceb
ℹ️ 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".
|
@codex review |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The policy-narrowing concern still appears valid at In For example, a finalized tool supporting Could we preserve target-side restrictions when carrying canonical metadata across the copy, and add a regression covering finalize → narrower policy → headless registration/catalog compaction? The assertion should check that forbidden actions stay absent while canonical boolean types remain intact. |
Yigtwxx
left a comment
There was a problem hiding this comment.
Reviewed at 7872998cec3. I ran the touched tests and a probe against both the PR head and the merge-base (b6ed90743ed) versions of the four production files. Setup: Windows, Node 24.22.1, vitest.agents-core.config.ts.
What holds
tool-search-runtime.test.ts,agent-tool-availability.test.ts, andgateway-tool-policy.test.tspass 78/78 on the head.- Mutation check: removing
prepareBeforeNormalization: truefrom the collector binding turns bothkeeps canonical collector inputs aligned with an offered readerrows red, so those tests do guard that line. - The branch merges with current
mainwithout conflicts (git merge-tree). The only main commit since the merge-base that touches these files is #194769 (internals.md). - The PR also fixes something the body doesn't mention. Real
sessions_spawndeclaresfastMode: boolean | "auto" | "ultrafast". On the merge-base, the Gemini projection collapses that field to{"type":"boolean"}, so the Code Mode declaration saysfastMode?: booleanand catalog validation rejects"auto". On the head, the full union is advertised and"auto"validates. That could be one line in the body.
1. Per-attempt catalog restriction that drops agents_wait brings the projection back for sessions_spawn. This is a scope gap, not a regression.
src/agents/harness/prompt-tool-policy.ts:81 calls restrictToolSearchCatalog with the attempt's toolsAllow. finalizeCatalogAvailability then reruns every availability binding (tool-search-catalog.ts:295). When the reader is missing, the collector prepare replaces entry.tool.parameters with collectorSchema(projected, {}) (swarm-collector-capability.ts:131-136). That new object is not bound.projected, so resolveAgentToolPresentationSchema (agent-tool-availability.ts:164) returns the projected variant. Catalog validation follows it too, because the collector's executionSchema returns the entry schema unchanged outside a joined spawn (swarm-collector-capability.ts:146-149).
Measured with the real createSessionsSpawnToolSchema({ swarmEnabled: true, ... }): Google finalize with spawn and a marked reader, then restrictToolSearchCatalog:
catalog keeps agents_wait |
merge-base | head |
|---|---|---|
| yes | fastMode?: boolean, "auto" rejected |
fastMode?: boolean | "auto" | "ultrafast", "auto" accepted |
| no | fastMode?: boolean, "auto" rejected |
fastMode?: boolean, "auto" rejected |
I used the same setup with a fixture field optional: Type.Optional(Type.Literal(true)) and the reader left out of registerHeadlessToolSearchCatalog. The head then declares optional?: "true", and catalog validation rejects optional: true. That is the original issue, on the hidden-reader path.
The hidden-reader rows at tool-search-runtime.test.ts:345-353 miss this because that spawn fixture has only task, collect, outputSchema, and groupId, and none of them change under Gemini projection. Adding one literal field to that fixture, plus a const assertion on the hidden entry, would catch it.
Two ways to close it:
- Derive the collector variant from the bound presentation as well.
collectorSchemaonly cares about object shape, so the same call works on the presentation. - Name the restricted-attempt case as an accepted edge case in the body or docs and pin it with a test row.
2. Presentation precedence on schema-replacing copies. No change requested; I'm noting it so the assumption is written down.
copyAgentToolAvailability (agent-tool-availability.ts:49) now keeps the source presentation when the source schema is unchanged, even if the target carries a different parameters object. The only post-finalize copy that replaces the schema is applyGatewayToolPolicy (gateway-tool-policy.ts:164), which the catalog reruns (tool-search-catalog.ts:247, :553).
Measured with a sessions action tool, catalog policy actions: ["list"]:
| finalized tool was assembled with | merge-base | head |
|---|---|---|
same policy (["list"]) |
action: "list", optional?: "true" |
action: "list", optional?: true |
wider policy (["list","patch"]) or none |
action: "list" |
action: "list" | "patch" |
In both cases the executor still denies patch. The second row also reproduces with modelProvider: "openai", so it is not specific to Gemini. In the run path, applyGatewayToolPolicy runs before finalizeAgentTools (agent-tools.ts:566, :647) with the same config the catalog reads. I didn't find a caller that hands the catalog a different policy, so I don't see a reachable case today.
I tried the obvious tightening: drop the presentation whenever the target replaces parameters. It breaks the normal first row, because narrowActions always returns a new object, so optional?: "true" comes back. I'm not suggesting it. A one-line comment at copyAgentToolAvailability would cover it, saying that post-finalize schema replacements are expected to match the assembly-time projection.
CI
checks-fast-baseline-ratchets fails on test-lines: Test lines: 6571368; ceiling: 6571329; over by: 39; net delta: +145. That ceiling already includes the new 152 allocation, which means the ratchet base was about 46 lines over before this PR. The script accepts an exact grant up to delta + inheritedDebt (scripts/check-test-lines-ratchet.mts:197-200). That allows 191 at that base; trimming 39 lines would also pass. Recompute against the current ci-ratchet-base before changing the file.
Yigtwxx
left a comment
There was a problem hiding this comment.
Follow-up at 8c131cd1111. Finding 1 from my earlier review is closed.
I reran the same probe on this head and on the previous code (7872998 versions of swarm-collector-capability.ts and agent-tool-availability.ts): real createSessionsSpawnToolSchema({ swarmEnabled: true, ... }), Google finalize, then restrictToolSearchCatalog. I also added rows with the before-tool-call hook wrapper on. The run path wraps by default (agent-tools.ts:650), and the PR test uses wrapBeforeToolCallHook: false, so I wanted that path covered too.
"Full union" below means the declaration fastMode?: boolean | "auto" | "ultrafast".
catalog keeps agents_wait |
hook wrapper | 7872998 |
8c131cd |
|---|---|---|---|
| yes | off | full union, "auto" accepted |
full union, "auto" accepted |
| no | off | fastMode?: boolean, "auto" rejected |
full union, "auto" accepted |
| yes | on | full union, "auto" accepted |
full union, "auto" accepted |
| no | on | fastMode?: boolean, "auto" rejected |
full union, "auto" accepted |
- Touched tests (
tool-search-runtime.test.ts,agent-tool-availability.test.ts,gateway-tool-policy.test.ts) pass 78/78 on Windows, Node 24.22.1. - Mutation check: with only
swarm-collector-capability.tsreverted to7872998,advertises canonical Gemini inputs while keeping execution-only exec arguments hiddenfails onproperties.optional.const. The new restricted-catalog rows do guard the collector change. - The branch still merges cleanly with current main (
c74d7a70ae1). No main commit since your sync touches the changed source files.
Note 2 (gateway narrowing precedence) behaves the same on this head, and my probe rows match the earlier table. Still no change requested there.
Nothing else from me.
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for the careful work and the detailed evidence here. I'm closing this because neither problem reproduces on current I used a scratch Gateway started from source with Code Mode on and a real Gemini 3.8 Flash model:
This branch is also about 240 commits behind and conflicts on rebase. If you can still trigger a failure on current |
Closes #194865
What Problem This Solves
User Impact
Why This Change Was Made
Evidence
7872998), a catalog fixture rejected booleantrueandfastMode: "auto"after reader restriction and after the restricted wrapper was registered.8c131cd11113), production-owner capture showed a list-only registration publishinglistandstatuswhen the tool was assembled with both actions.b905def2e430: 97 focused tests (12.60s), test types, targeted lint and formatting, line and assertion ratchets, and build passed.optional: true, removedcollect, and accepted booleantrueandfastMode: "auto".listandstatus, followed by list-only registration, returnedlistin both the catalog schema and declaration.not_foundwith booleantrue.{ "actionEnum": [ "list" ], "inputAction": "\"list\"", "optionalLiteral": "true", "readResult": { "kind": "not_found", "status": "not_found", "path": "missing-policy-proof.txt", "optional": true } }