Repository navigation
fix(exec): keep owner memory trusted after background commands finish - #204785
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 changesPreserve the originating Gateway owner's authority when a background command resumes the same agent session. Example: A Gateway owner starts a background command, then the automatic completion turn writes MEMORY.md.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current owner-continuation bug with a focused change, sufficient real-model proof, and no actionable findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBackground exec captures its requester and destination, session-event admission resumes the conversation, and tracked file tools use runtime ownership and taint to classify memory writes. flowchart TD
A[Owner conversation] --> B[Background exec]
B --> C[Captured requester and session]
C --> D[Session event admission]
D --> E[Tracked memory write]
E --> F[Memory provenance]
F --> G[Automatic memory context]
Technical reviewBest possible solution: Land the scoped continuation repair through the existing session-event authority owner while preserving memory taint and quarantine rules. Do we have a high-confidence way to reproduce the issue? Current-main source establishes both missing handoff steps, and supplied base/head Gateway logs demonstrate the resulting memory exclusion; this read-only review ran no target code. Is this the best way to solve the issue? The patch repairs the authority handoff at its existing producer and consumer rather than weakening memory provenance, with distinct negative cases protecting guest, tainted, and cross-session behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0f1bb35f4d3d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests +193. Total +201 across 4 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel 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 (3 earlier review cycles)
Reviewed November 25, 2026, 11:57 PM ET / November 26, 2026, 04:57 UTC (Revision 4). |
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Sanitized runtime receipts for The wake transcript retained |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Real-model proof for Redacted log excerpts: The wake remained an |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…#204785) * fix(exec): preserve ownerContinuation on exec-completion wake targets * fix(exec): retain owner authority on same-session completion Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: tideclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 21a85ac) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…#204785) Preserve live owner authority for completion of a command in the originating session without authorizing the internal event as a command or inheriting ownership across a route. Release adaptation: require the release authority’s operator.admin scope for exec events (main uses grant.owner), and use the release’s existing authority constructor and tool-construction plan in the regression. Companion audit found no later same-path or PR/SHA follow-up on pinned main. (cherry picked from commit 21a85ac) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…openclaw#204785) * fix(exec): preserve ownerContinuation on exec-completion wake targets * fix(exec): retain owner authority on same-session completion Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: tideclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Fixes #204767
What Problem This Solves
When a Gateway owner’s background command finishes and wakes their WebChat session, the wake can lose the owner decision. A tracked edit to
MEMORY.mdthen becomes untrusted and drops out of automatic context.User Impact
An untainted completion in the same owner session keeps ordinary agent provenance. Guest, tainted, and cross-session cases still produce untrusted provenance. Existing quarantined files are not reclassified.
Why This Change Was Made
Capture operator-owner continuation only when the caller, the process, and the wake target share the same agent session. Build the exec event context through the existing owner-binding path without authorizing the completion text as a command.
Evidence
MEMORY.mdprovenance. On pre-fixa298c5a19cb6the owner and tainted-owner cases failed because runtime ownership was false; the clean owner write was untrusted. With the fix, the clean owner is owner/agent; tainted owner is owner/untrusted; guest and cross-session are non-owner/untrusted.pnpm test src/agents/bash-tools.exec-notify.owner-continuation.test.ts --maxWorkers=1: 4 passed. The requester, storage-failure, background-followup, and session-event handoff suites also passed while validating the same production change. Focused lint, format, and agent-tool typecheck passed.Real behavior proof
Real-model Gateway proof and redacted logs. Three disposable Gateway runs used Qwen3-1.7B via loopback llama.cpp with no provider API key. The model generated the native tool calls and arguments for background
execand the trackedMEMORY.mdwrite on the automatic wake. The adapter required the one relevant offered tool on action steps; it did not supply or rewrite arguments or replies. The network-tainted wake calledweb_fetchfirst and got an HTTP 200 result marked untrusted.MEMORY.mdprovenance/newc734b2de, cleanuntrustedf286bd3a, cleanagentf286bd3a, network-tainteduntrustedIn all three runs, the persisted wake transcript remained
internal_systemwithsenderIsOwner=false(not human authorship). All three proof runs exited 0 and disposable processes and state were removed. Earlier scripted comparison.