Skip to content

fix(agents): subagent completions miss the prompt cache when owners are configured - #180608

Merged
steipete merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/announce-owner-prefix
Oct 26, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/announce-owner-prefix

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Main cfb41dddac89 regression 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 main 026efa81b115.
  • Integrated candidate GREEN: harness 8/8, configured-owner authorization 12/12, prompt-prefix stability 13/13; 462.63 seconds total wrapper. Harness file: 140.31 seconds including compilation and existing runtime fixtures. The single new prompt regression takes 4.89 seconds and reuses those fixtures. Per-file CI timing is not yet available.
  • Targeted type-aware oxlint, oxfmt and whitespace pass. Independent Codex review is scoped-clean through P2. pnpm prompt:snapshots:gen completed: six files regenerated, zero tracked delta. The changed-check plan selects broad checks delegated to PR CI.
  • Production +26/-4 (net +22); test +42/-0; docs +1/-1. The fix shares the existing owner-list computation and carries one existing runner field; removing the configured-owner projection or bounded renderer would leave the defect or violate its prompt budget. Moving the test into the existing harness removes a second runner mock and 19 added test lines from the proposal.
  • Final head 94375a6b7d8ac08633ad9c70802d9943ea217862 integrates main 026efa81b115; 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).
  • Exact-head PR CI run 40391657796 is green: 71 completed jobs, zero failures. ClawSweeper reviewed this exact head at 20:05 UTC with zero findings.

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.

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Oct 22, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The 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.

  • Before: The ordinary turn lists 111 and 333, while the completion omits Authorized Senders.
  • After: Both prompts list 111 and 333, without granting the completion owner authority.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with relevant Gateway request evidence and a meaningful regression; provider cache counters and billing are outside its demonstrated claim.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The retained prior-head trace exercises an isolated built Gateway, local IRC, real subagent completion dispatch, and a recording HTTP provider, reporting identical system messages across all 13 compared requests after the fix; the production repair is unchanged, while live inference savings remain unmeasured.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Subagent completion turns drop configured sender guidance and introduce an avoidable system-prompt difference in long-running conversations.
Reason: The repair restores the documented prompt-stability contract without new settings, state, or authority; existing bounded-renderer behavior remains intact.

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
Reviewed head: 94375a6b7d8ac08633ad9c70802d9943ea217862

Before merge

None.

Findings

None.

Agent review details

How this fits together

Command 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]
Loading

Technical review

Best 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

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +22, Tests +42, Docs 0. Total +64 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 26 4 +22
Tests 1 42 0 +42
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 69 5 +64

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +26/-4; tests +42/-0 The production growth shares existing normalization and supplies one missing prompt input; one regression reuses the existing command harness.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Configured-owner sessions incur avoidable prompt-prefix changes around subagent completions, affecting inference cost and latency without demonstrated message loss or availability failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-22T12:59:28.704Z sha 891cd0f :: needs maintainer review before merge. :: none

Reviewed October 26, 2026, 4:05 PM ET / 20:05 UTC (Revision 2).

steipete and others added 2 commits October 26, 2026 12:53
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]>
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@steipete
steipete merged commit 363aaa0 into openclaw:main Oct 26, 2026
149 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Subagent completion turns drop the Authorized Senders section and miss the prompt cache when owners are configured

2 participants