Repository navigation
fix(agents): subagent completions miss the prompt cache when owners are configured - #180608
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. What this changesThe PR passes configured owners into command-run prompts so subagent completions retain the Authorized Senders section. Example: A Telegram session configures ownerAllowFrom as ["telegram:111", "discord:222", "333"] and receives a subagent completion.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it repairs a current prompt-stability defect with a focused change and no actionable findings; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCommand authorization normalizes configured channel identities, and command attempts pass descriptive prompt inputs to embedded and CLI runners before provider request construction. flowchart TD
A[Configured owners] --> B[Command authorization normalization]
B --> C[Ordinary reply]
B --> D[Command attempt context]
D --> E[Embedded or CLI runner]
C --> F[Bounded prompt renderer]
E --> F
F --> G[Provider request]
Technical reviewBest possible solution: Retain the shared configured-owner projection through the existing bounded renderer and runner parameters while keeping execution authority separate. Do we have a high-confidence way to reproduce the issue? Current main omits ownerNumbers from command attempts while ordinary replies provide it, matching the linked issue's isolated Gateway request comparisons; this read-only review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: reuse command-auth normalization, pass the existing runner field, preserve prompt bounds, and cover the omission in the existing harness. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6f3b2b34d040. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +22, Tests +42, Docs 0. Total +64 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 4:05 PM ET / 20:05 UTC (Revision 2). |
Share configured-owner normalization with ordinary command authorization and carry the descriptive list through the existing bounded prompt projection. Reuse the command harness fixture for the prompt-byte regression. Co-authored-by: Masato Hoshino <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
) Preserve configured owner guidance on subagent completion turns through shared owner normalization and the existing bounded prompt renderer. Sender authority is unchanged. Focused regressions, prompt snapshots, and exact-head CI passed. Closes openclaw#180607 Related: openclaw#150081 Co-authored-by: Masato Hoshino <[email protected]>
Closes #180607
Related: #150081
What Problem This Solves
Fixes completion turns dropping the configured Authorized Senders section from a session's system prompt.
User Impact
Command-origin runs, including subagent completions, retain the configured owner guidance for their channel and account. This removes an avoidable system-prompt difference; actual provider cache hits and billing are not measured here. Sender authority is unchanged.
Why This Change Was Made
Ordinary turns already pass the configured owner list into the bounded prompt renderer. Command attempts now use that same normalization owner and existing runner parameter for both embedded and CLI execution.
Thanks @masatohoshino for the fix and isolated Gateway request trace.
Accepted edge: above the existing 16-owner prompt bound, an authenticated owner turn can prioritize its current sender while a senderless completion cannot. Later history differences are separate from this system-prompt repair.
Evidence
cfb41dddac89regression RED: the command completion omits Authorized Senders (1 expected failure, 7 skipped; 85.58 seconds wrapper, 66.04 seconds Vitest). The owner modules and regression inputs are unchanged through final integrated main026efa81b115.pnpm prompt:snapshots:gencompleted: six files regenerated, zero tracked delta. The changed-check plan selects broad checks delegated to PR CI.94375a6b7d8ac08633ad9c70802d9943ea217862integrates main026efa81b115; the four reviewed files and their tested owner/dependency inputs are unchanged. The final integrated regression replay also passed (1 passed, 7 skipped; 139.50 seconds wrapper, 122.13 seconds Vitest).No fresh Gateway or live-provider cache test was performed for this integration; a new recording-provider harness would exceed this lane's live-proof budget. The contributor's prior-head isolated Gateway, local IRC and recording HTTP provider trace is supporting evidence: before, 4 of 13 parent requests changed system bytes when Authorized Senders disappeared or returned; after, all 13 compared system messages matched. That trace demonstrates request construction, not live inference savings.