Repository navigation
refactor(agents): reuse owned tool projection arrays - #139424
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: needs maintainer review before merge. Reviewed September 5, 2026, 5:53 PM ET / 21:53 UTC. ClawSweeper reviewWhat this changesThe PR reuses freshly allocated tool-filter results in agent preparation and adds coverage for retained tool lists across refreshes. Merge readiness✅ Ready for maintainer review Keep open: this is a coherent ownership cleanup, and current main still contains the redundant copies. No introduced correctness or security defect was found; maintainer-authored work is also protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherAgent tool preparation combines core and plugin tools, filters incompatible schemas, and prepares the tools exposed to models. Retained arrays and independent prompt snapshots keep tool availability consistent during refreshes. flowchart TD
A[Core and plugin tools] --> B[Policy and normalization]
B --> C[Schema filtering]
C --> D[Owned tool array]
D --> E[Tool catalog and model tools]
D --> F[Independent prompt snapshot]
G[Tool refresh] --> C
C --> H[Update retained view]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +47. Total +46 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Reuse the projector-owned arrays while preserving source snapshots, both schema passes, independent prompt baselines, and in-place refresh. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR claims behavior-preserving cleanup, and its new test explicitly checks preservation rather than reproducing a defect. Is this the best way to solve the issue? Yes: direct reuse follows the existing projector's allocation contract; another copying helper would retain the redundancy without improving isolation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9387e3fd735d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Simplifies tool preparation in the native runtime and shared harness bridge, where unnecessary intermediate arrays obscure the distinction between private projections and retained refresh views.
Why This Change Was Made
Reuse the schema projector's freshly owned arrays at three handoffs instead of immediately copying them. Source-entry snapshots, both schema passes, independent prompt baselines, and in-place refresh of the published tool array remain unchanged.
User Impact
No user-visible behavior change. This is a small ownership cleanup, not a demonstrated general latency or memory improvement. Production is −1 LOC; preservation coverage is +47 test LOC.
Evidence
Focused validation commands
The added test uses the real schema projector to preserve retained views and cron/inherited capability captures across two refresh generations. It passes on both variants and is not a claimed bug reproduction. No import or package boundary changed; no live-provider, Gateway-turn, or cold-start improvement is claimed.