Repository navigation
fix(agents): tailor private completion guidance to requester routes - #182124
Conversation
Reuse the message tool implicit-target check for private announce and settle wakes. Channel-less requesters record the reviewed outcome in their session without a messaging send; channel and WebChat guidance stays unchanged. Cover both wake producers, migrate the prompt-cache fixture, and document channel-less private completion. Focused regressions fail on the base and pass twice with the fix; prompt-cache and prefix-stability checks, targeted typechecks, lint, format, and snapshot generation pass.
|
🦞👀 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 SummaryThis 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. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. What this changesThis PR tailors private subagent completion guidance to whether the requester has a conversation target. Example: A parent started with openclaw agent receives a private child result without a channel or destination.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-authored correction to guidance that remains unconditional on current main, with no introduced correctness or security defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSubagent announce and batch-settle producers combine child results with requester routing context to create per-turn instructions for the resumed parent. flowchart TD
A[Completed child result] --> B[Announce or batch settle]
C[Requester delivery context] --> B
B --> D[Shared completion guidance]
E[Existing implicit target resolver] --> D
D --> F[Parent continuation]
F --> G[Session result or permitted message]
Technical reviewBest possible solution: Use the existing target resolver in the shared completion-instruction owner and pass requester routing from both wake producers. Do we have a high-confidence way to reproduce the issue? Current main unconditionally asks private requesters to use messaging tools, while the message-tool target resolver rejects absent destinations and session keys; source inspection establishes the misleading guidance without guaranteeing model compliance. Is this the best way to solve the issue? The patch is the smallest complete correction: it changes the shared instruction owner, migrates both producers, and retains channel, WebChat, follow-through, and private-delivery contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 75deca89d9a5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +22, Tests +58, Docs +2. Total +82 across 8 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 23, 2026, 11:01 PM ET / October 24, 2026, 03:01 UTC. |
…penclaw#182124) Reuse the message tool implicit-target check for private announce and settle wakes. Channel-less requesters record the reviewed outcome in their session without a messaging send; channel and WebChat guidance stays unchanged. Cover both wake producers, migrate the prompt-cache fixture, and document channel-less private completion. Focused regressions fail on the base and pass twice with the fix; prompt-cache and prefix-stability checks, targeted typechecks, lint, format, and snapshot generation pass.
Absorb openclaw/openclaw main at 9629838 (967 commits past 7ab6453) into P ea81534. 39 textual conflicts, resolved upstream-first; every ours/combined resolution keeps a continuation or carried-fleet symbol and is listed with its reason in the lane's table.tsv / RESOLUTION.md. Schema: upstream took agent schema 32-34 (PostgreSQL-only vector decoder, binary vector projection, index ordering; SQLite advances metadata only) and state 32. The continuation recipient-authority step moves from 32 to 35, above upstream's steps; on SQLite a P-era 32 database is upstream's 32 plus the authority table, which the idempotent step admits. Ports into upstream's new owners: - agent-runner-result-complete.ts deleted upstream (openclaw#181917, inlined into agent-runner-result.ts); the continuation delta moves onto the inlined block. - subagent registry activation returns AgentRecoveryProgress (openclaw#181428); the continuation activation latch follows progress.settled. - announce reply-instruction / params moved by the fork receive upstream's requesterOrigin (openclaw#182124) and onAccepted (openclaw#182285). - diagnostic trace context moved to the shared AsyncContext carrier (openclaw#181780); the fork's test reset clears only its own field. Generated files regenerated with their generators (postgres schema, config doc baseline). Refs karmaterminal/openclaw-bootstrap#1727 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Private completion wakes (announce and requester-settle) always told the requester: "If the original request requires a user-facing update, send it through an available, permitted messaging tool; do not rely on your final reply for delivery." A requester with no conversation target, such as a parent started with
openclaw agent(Gateway agent RPC), then calledmessage(action=send)and got "Action send requires a target. This turn has no current conversation". In live fleets that was one wasted tool call per fleet; parents reported "an earlier report-send attempt failed because no conversation target".User Impact
Channel-less requesters record private completion outcomes in their session without attempting a target-less message send. Channel and WebChat guidance is unchanged. No migration or user action is required.
Why This Change Was Made
Root cause
src/agents/subagents/completion/subagent-completion-instructions.tsexported one unconditional instruction string, used by both announce and settle wake producers without considering the requester's delivery route.Fix
buildSubagentPrivateCompletionInstruction(requesterOrigin)keeps the messaging sentence only when the requester has a deliverable target: WebChat, or a target the message tool would resolve implicitly. It reusesresolveImplicitMessageActionTarget, the message tool's own predicate. Channel-less requesters are told their final reply is recorded in the session and no messaging send is needed. Both producers pass the requester origin. Channel and WebChat wording is unchanged. This is wake input text (per-turn), not system prompt;docs/tools/subagents/announce.mddocuments it.Evidence
subagent-announce.test.ts(base: 2 failed / 15) andsubagent-announce.requester-settle-wake.private.test.ts(base: 4 failed / 7), asserting a channel-less requester gets no messaging-tool instruction and a channel requester keeps it.embedded-agent-runner.prompt-cache.test.tsandagent-tools.prefix-stability.test.tspass, andpnpm prompt:snapshots:genshows no diff.