Repository navigation
refactor(agents): remove stale runner state plumbing - #118495
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 4:49 AM ET / 08:49 UTC. ClawSweeper reviewWhat this changesThis PR centralizes identity-backed agent-tool metadata copying, unifies bootstrap-budget warning state for CLI and embedded runners, and removes unreachable auto-reply working-status plumbing. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain The patch is a coherent net-reducing cleanup with no discrete correctness defect found in the reviewed source, but it still needs inspectable after-fix real-behavior proof before merge. Current main does not already contain its central refactor, and the protected Priority: P3 Review scores
Verification
How this fits togetherAgent runners build workspace bootstrap context and wrap tools before sending work to model and channel execution paths. The copied metadata carries policy, hooks, channel details, terminal presentation, and control-flow identity across those wrappers, while bootstrap analysis feeds prompt warnings and run metadata. flowchart LR
A[Workspace bootstrap files] --> B[CLI and embedded runners]
B --> C[Bootstrap budget diagnosis]
C --> D[Prompt warning and run metadata]
E[Agent tools] --> F[Tool wrappers]
F --> G[Policy hooks and terminal presentation]
H[Auto-reply callbacks] --> I[Channel progress delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -127, Tests +22. Total -105 across 24 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the canonical metadata and bootstrap-state refactor, then add a redacted real runtime transcript or terminal capture showing preserved terminal presentation through the abort wrapper before merging. Do we have a high-confidence way to reproduce the issue? Yes from source: the current abort wrapper copies three identity-backed markers but omits terminal presentation, while sibling wrapper paths already preserve it. A real runtime reproduction has not been supplied in the PR materials. Is this the best way to solve the issue? Yes. A single canonical metadata copier and a shared bootstrap-state builder remove the duplicate owner-boundary logic while preserving each runner's routing decisions; no safer competing implementation was found. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b21056a0dcb8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
da52852 to
56f846b
Compare
a3627ce to
916e0c3
Compare
916e0c3 to
15d0514
Compare
|
Rank-up move disposition: I am not adding a synthetic terminal capture. The affected contract is identity-backed formatter retention across the internal abort wrapper, and there is no stable operator command that deterministically selects that wrapper/presentation pairing without provider and model nondeterminism. The direct regression asserts the exact formatter identity through the real wrapper; exact-head CI and the native Testbox-backed prepare gate are green. A manufactured transcript would be less precise evidence and would not improve the ownership-boundary proof. |
|
Merged via squash.
|
…ion-routing * origin/main: refactor(agents): remove stale runner state plumbing (#118495) test(gateway): skip servers for handler fixtures (#118581) test(tui): reuse real gateway PTY fixture (#118567) fix: keep command tests independent of ambient Gateway tokens (#118577) fix: show effective channel model in Telegram status (#118548) test(system-agent): reuse approval CLI fixture (#118572) test(macos): deduplicate Claude session catalog fixtures (#118571)
* refactor(agents): remove stale runner state plumbing * refactor(agents): keep bootstrap warning owner reachable * refactor(agents): inline bootstrap warning predicates * refactor(agents): extract bootstrap warning contracts * refactor(agents): keep bootstrap detail type private * refactor(auto-reply): drop vacuous abort returns
What Problem This Solves
Removes stale agent/session plumbing that had accumulated after features were disabled or split across runners, and fixes a metadata drift where abort-wrapped tools lost their trusted terminal presentation.
Why This Change Was Made
The reply pipeline retained an unreachable
Working:status path behind a literalfalse; the CLI and embedded runners separately assembled identical bootstrap-budget state; and six tool-cloning paths manually copied identity-backed metadata with one path missing terminal presentation. This change deletes the disabled path, gives bootstrap diagnosis and cloned-tool metadata one canonical owner, and keeps caller-specific routing/order behavior intact.Session-key facade replacements were limited by byte equivalence: requester, depth, and status candidates intentionally preserve raw casing and lookup order, so they remain unchanged. No config, protocol, storage, or Plugin SDK surface changes.
AI-assisted implementation and review.
User Impact
Most of the change is behavior-neutral cleanup. Tools wrapped for abort handling now retain deterministic terminal summaries instead of silently losing that presentation metadata.
Evidence
/Users/steipete/Projects/openclaw/node_modules/.bin/oxfmt <touched TypeScript files>— passed.git diff --check— passed before commit and again on the staged patch.node scripts/run-vitest.mjs src/agents/bootstrap-budget.test.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts— 24 passed.node scripts/run-vitest.mjs src/agents/bootstrap-budget.test.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts src/agents/prompt-composition.test.ts— 30 passed after the CI type/cycle repair.node scripts/run-vitest.mjs src/agents/agent-tools.runtime.test.ts src/agents/agent-tools.schema.test.ts src/agents/agent-tools.deferred-followup-guidance.test.ts src/agents/tools/gateway-caller-context.test.ts src/agents/runtime-plan/tools.test.ts src/agents/embedded-agent-runner/run/tool-activity-heartbeat.test.ts— 111 passed across five shards.node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts— 311 passed.node scripts/run-vitest.mjs src/agents/cli-runner/prepare.test.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-injection.test.ts— 109 passed across two shards.gpt-5.6-solhigh reasoning — clean on the full patch and every CI follow-up; no accepted/actionable findings (0.98–0.99 confidence).node scripts/check-changed.mjsclassified the patch, then failed because no remote provider was ready (blacksmith-testboxdoctor timeout; other configured providers unavailable). Exact-head hosted PR CI supplies the heavy type/lint/guard proof.30788158149— green, including build artifacts, test types, dependency/unused-export checks, import-cycle architecture, lint, focused and compact Node shards, QA smoke, andopenclaw/ci-gate.