Repository navigation
refactor(agents): deslop embedded agent runner third pass - #159597
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: blocked before merge. Reviewed September 27, 2026, 6:31 PM ET / 22:31 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch simplifies embedded agent runs by using the existing tool adapter directly, sharing compaction hook dispatch, consolidating private types and helpers, and updating related tests and build entries. Merge readiness⛔ Blocked before merge - 4 items remain Current main retains the forwarding path this PR removes, so the merged earlier cleanup does not make this work redundant. I found no concrete introduced defect in the reviewed paths; the PR description still needs to reflect the current head and the now-merged fixture repair. Priority: P3 Review scores
Verification
How this fits togetherThe embedded agent runner turns an admitted session’s prompt, tools, and model choice into a provider call. It also manages compaction and passes the result to reply delivery. flowchart LR
A[Admitted session] --> B[Prompt and tool preparation]
B --> C[Embedded agent runner]
C --> D[Model provider]
C --> E[Compaction hooks]
D --> F[Reply result]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the direct adapter and shared compaction owner while preserving prompt bytes, live authority checks, and run lifecycle ordering. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup rather than reporting a defect to reproduce. Is this the best way to solve the issue? Yes: using the existing tool adapter and compaction owner removes duplicate paths without introducing a new public contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e74690a70ca8. 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 (10 earlier review cycles; latest 8 shown)
|
3396375 to
33b9a72
Compare
af2138a to
ed20828
Compare
ed20828 to
d7fee2a
Compare
…59597) * refactor(agents): deslop embedded agent runner third pass * refactor(agents): finish runner adapter cutover and validation fixes * refactor(agents): keep model observation types with their owner * refactor(agents): remove redundant async-wait narration
Consolidate equivalent embedded-runner projections and owner helpers, remove unused plumbing, and simplify redundant branches while preserving run authority, cancellation, prompt/transcript bytes, tool policy, transport shaping, and usage accounting. Production change: 361 added / 1,002 removed, net -641 lines. Preserve real model-selection exports in the command test mock. Missing provider maps return undefined on both main and the refactor; the legacy automatic fallback still wins over the colliding alias. Keep the unchanged collision configuration in the existing fixture helper to satisfy the line-cap ratchet. Validation: main/PR comparison with model-selection fully unmocked; 138 command tests; all 20 facade-mocking siblings plus embedded runner tests (355 files / 5,827 tests); final check-changed; independent autoreview through P2. No production behavior change is claimed. Related: #159597 Exact-head CI exception: checks-node-compact-small-18 has the same two sparse-runner missing-prerequisite failures as unrelated PR #160075 run 36528303180. All other execution jobs passed or skipped. See PR Evidence.
…160906) Consolidate equivalent embedded-runner projections and owner helpers, remove unused plumbing, and simplify redundant branches while preserving run authority, cancellation, prompt/transcript bytes, tool policy, transport shaping, and usage accounting. Production change: 361 added / 1,002 removed, net -641 lines. Preserve real model-selection exports in the command test mock. Missing provider maps return undefined on both main and the refactor; the legacy automatic fallback still wins over the colliding alias. Keep the unchanged collision configuration in the existing fixture helper to satisfy the line-cap ratchet. Validation: main/PR comparison with model-selection fully unmocked; 138 command tests; all 20 facade-mocking siblings plus embedded runner tests (355 files / 5,827 tests); final check-changed; independent autoreview through P2. No production behavior change is claimed. Related: openclaw#159597 Exact-head CI exception: checks-node-compact-small-18 has the same two sparse-runner missing-prerequisite failures as unrelated PR openclaw#160075 run 36528303180. All other execution jobs passed or skipped. See PR Evidence.
What Problem This Solves
The embedded runner still repeats private forwarding, type declarations, predicates, and result projections after its earlier cleanup passes. This third pass removes 1,001 net production lines while keeping each responsibility with its existing owner.
User Impact
No intended user-visible change. Prompt, transcript, and tool bytes; exact steering/queue call shapes; compaction, model fallback, lifecycle ordering, and authority revalidation remain unchanged. No configuration default, persisted schema, migration, retention, or permission contract changes. The assertion baseline is developer-check metadata only.
Why This Change Was Made
The full production subtree and recent merged changes were reviewed before editing. Related: #158879.
splitSdkTools, its ignored sandbox flag, and every caller/build entry. Preserve the explicit three-argument call shape.Fixes Found Along the Way
The compaction harness supplied a getterless auth store and resolved credentials to an unrelated constant. The typed adapter cutover exposed that mismatch. Its shared fixture now supports runtime-key storage/lookup and explicit credential precedence; the exact xAI credential assertion remains unchanged. No test cases were added.
Validation also caught the deleted wrapper's private build entry, a numeric accumulator type needed by declaration generation, and a type-only diagnostic import cycle. Those are corrected. Nine assertion-baseline entries shrink by fourteen assertions; none is raised.
Evidence
BLOCKED by upstream CI; not READY-TO-LAND. Published head:
d7fee2a7b9cfa4688c16a67543a5777b5e8c463f. No merge was requested.pnpm buildpassed (354.51s); 5,498 runner/ask-user tests across 350 files passed (372.89s); 59 import-boundary tests across 17 files passed (63.52s).agent-runner.runreplyagent.e2e.test.tsadopted transcript-only cancellation case throwsAgentDatabaseRegistryChangedErrorbefore model execution. Existing PR refactor(auto-reply): deslop auto-reply fourth pass #159527 owns the exact predecessor-cleanup race and ordered regression proof. No duplicate repair, retry, timeout increase, or weakened assertion is included here.check-changedfails at the inherited media-retention fixture's TS2554:media-generate-background-retention.test.ts:233calls the new callback without its session-read owner. Exact-head hosted CI fails at the inherited ACP fixture's TS2367:manager.preactive-cancellation.test.ts:46compares its two-valued phase with the removedqueuedcase. PR fix: repair artifact and upgrade validation after Task retirement #159819 owns both repairs, plus the retirement's stale test-ownership metadata and diagnostics staging. It remains open; its latest head also has a failing CI check. This PR is waiting for that canonical repair before rebase and final static/hosted acceptance.601bb5ba37e5f578a35b2d7a176cd24bfde38135fixes the earlier schema-scope CI failure. Incorporated main repair559b4f84f6150781523bd2b66b2c08fcdc15220ffixes stale Workboard asset pointers; the Testbox-generated manifest matched that repair byte-for-byte.All seven changed test files also pass individually. These are measured Linux Testbox wall times for
pnpm test <file> --maxWorkers=1, including wrapper startup, on the prepared build:src/agents/agent-bundle-mcp-tools.request-boundary.test.tssrc/agents/agent-tool-definition-adapter.metadata.test.tssrc/agents/agent-tools.before-tool-call.integration.e2e.test.tssrc/agents/embedded-agent-runner/compact.hooks.test.tssrc/agents/embedded-agent-runner/run/attempt-session.test.tssrc/agents/embedded-agent-runner/run/attempt.configured-mcp-lifecycle.test.tssrc/agents/provider-stream.lifecycle.test.tsHosted per-file timings are unavailable: the type failure cancelled the test jobs before they ran.
Provider: blacksmith-testbox. Final proof lease
tbx_01m3j0me64mq3xy4n1hxkmqkfhis stopped, as are all earlier task-owned leases. Testbox run. Commands ran through the repository wrapper:pnpm install --frozen-lockfile,node scripts/check-changed.mjs,pnpm build,node scripts/run-vitest.mjsfor the focused, runner/ask-user, importer, and boundary selections, and the seven single-worker commands above. The compound invocation exited 1 because of the documented upstream static and E2E failures; passing phases are recorded separately.