Repository navigation
refactor(agents): deslop agents - #163963
Conversation
Inline single-use adapters, share canonical contracts, and remove obsolete internal options and pre-July in-process compatibility. Preserve prompts, authority fences, resource settlement, and current state contracts. Fix process send-keys incorrectly treating inherited object properties as cursor-mode-sensitive keys, with original-failing input-delivery regressions.
|
🦞👀 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: blocked before merge. Reviewed October 2, 2026, 11:36 PM ET / October 3, 2026, 03:36 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR simplifies agent-runtime adapters, caches, prompt assembly, and internal contracts, and fixes literal key input to interactive processes before cursor mode is known. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: the branch contains useful work still absent from current main, and no blocking introduced defect was identified. The earlier stored-data migration concern does not apply to the process-local caches inspected. Priority: P2 Review scores
Verification
How this fits togetherThe agent runtime turns configuration, conversation history, and model selections into prompts and executable tools. Its lifecycle owners coordinate authorization, process input, completion recovery, and returned results. flowchart TD
A[Configuration and conversation] --> B[Agent runtime preparation]
B --> C[Prompt and model selection]
B --> D[Current execution authority]
C --> E[Model tool requests]
D --> F[Tool execution and processes]
E --> F
F --> G[Results and completion recovery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1037, Tests -115, Other +2. Total -1150 across 56 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep runtime decisions with their existing owners, preserve released reload entrypoints, and retain the focused process-input repair. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main misclassifies inherited object-property names as cursor keys when mode is unknown. The branch includes focused process-entrypoint regressions; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Own-property membership narrowly repairs key classification, and the inspected simplifications reuse existing owners without adding configuration or parallel implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 81987cd91a5a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Remove redundant root-agent adapters, duplicated state projections, unused auth options, and pre-July process-global compatibility while retaining current prompts, authorization fences, and settlement ordering. Keep media status with its operation owner and reuse canonical contracts. Fix process send-keys rejecting literal constructor and __proto__ input before cursor mode is known. Both regression cases fail on the original code and pass with the fix. Validation: 1,460 passing tests across 80 files, three existing Windows-only skips on macOS; successful runtime build and core typecheck; both import-cycle checks report zero; independent Codex review clean through P2. Exact-head hosted CI gates this merge.
What Problem This Solves
The root agent runtime retains single-use adapters, duplicated state projections, and obsolete internal options that make the same behavior harder to follow. This is a maintainer-requested subsystem simplification batch.
User Impact
The refactors preserve configuration, persisted data, protocol shapes, tool descriptions, and prompt bytes. The included process-tool fix restores literal key input before cursor mode is known. July 2026 and newer upgrade shapes remain supported; only older in-process compatibility paths are retired.
Why This Change Was Made
The batch removes 1,037 net production lines from the root of
src/agentswithout relocating code. Each simplification stays with its existing owner:Fixes Found Along the Way
process send-keystreated inherited object properties as cursor keys, so literalconstructorand__proto__inputs were rejected while cursor mode was unknown. Use own-property membership and retain the existing guard for actual cursor keys. Both new process-tool regressions fail on the original condition and pass with the fix.Evidence
Independent Codex review: scoped-clean through P2.
77 focused owner/sibling test files: 1,417 passed, three existing Windows-only cases skipped on macOS.
Separate bootstrap, process-delivery, and PTY encoding suites: 43 passed. Total: 80 files and 1,460 passing tests.
PTY negative control: both new cases fail on the original code with
status: failedinstead ofrunning; the entire fixed delivery suite passes.Runtime build, all 96 plugin bundles, CLI bootstrap import guard, and built plugin-load checks passed as test prerequisites. No generated files changed outside the lane.
Remote Testbox admission expired before checkout; the direct AWS broker also timed out. Validation used the explicitly authorized local fallback at
nice -n 15, one command at a time.Changed test cost (
pnpm test <file> --maxWorkers=1): bootstrap budget 56.90s command wall time / 35.39s Vitest; process delivery 293.55s wall / 255.20s Vitest. The overloaded Mac's transform/import work dominates; new literal-key cases reuse the existing process fixture without new timers, process boots, or production seams. The delivery suite also protects Code Mode persistence/acknowledgment contracts.Both mandatory import-cycle checkers report zero. Core TypeScript check passed.
Conflict-marker, line-cap growth, and max-lines suppression checks passed. The optional repository-wide assertion inventory was stopped after scoped proof; full ratchets remain part of hosted CI.
Initial hosted CI identified a parameter-reassignment lint error, two formatting misses, two stale test option fields, a shrink-only assertion baseline update, and the missing Knip entry for a retained upgrade barrel. The follow-up fixes all five; the July/September released runtime entry stays intact.
Repair-focused validation: all 79 tests pass across the patch parser, CLI-backend, and model-catalog recovery suites. Core lint, the messaging test-type graph, dependency/file analysis, and both cycle checks pass on the repair commit. The generic lint wrapper timed out preparing unrelated plugin-SDK declarations; the supported core-only lint route passed.
Exact-head hosted CI will gate squash auto-merge.