Repository navigation
fix(exec): preserve approved command output when sessions resume - #117177
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Approved async exec continuations reused the compact background notification formatter, so the agent resumed from the last 400 characters of output with all whitespace collapsed and the head silently dropped. Both hosts now render the continuation through a shared whitespace-preserving formatter bounded at 16,000 UTF-16 units. Compact `notifyOnExit` notifications, poll/retained output, and the gateway diagnostics branch are unchanged. The truncation marker deliberately reports no exact omission count: output can already be capped at capture time without leaving a marker, so an exact number would describe only this cut while reading as though nothing else was lost. Closes #41152 Co-authored-by: Copilot App <[email protected]> Copilot-Session: 2d9762e2-f967-4cdd-9895-299512a20114
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:56 PM ET / August 1, 2026, 03:56 UTC. ClawSweeper reviewWhat this changesThe PR preserves approved asynchronous exec output through an authenticated Gateway handoff, resizes it for the resumed model context, and avoids duplicate direct delivery when the accepted agent run is still responsible for replying. Merge readinessKeep this PR open for maintainer review. The core truncation defect remains on current main, and the patch replaces it with an authenticated, context-sized continuation path; the remaining question is whether an accepted run may remain the sole delivery owner after the bounded Gateway-observation window expires. Priority: P1 Review scores
Verification
How this fits togetherApproved exec commands complete in the Gateway or node host after the original agent turn has ended. Their completion is sent back through a resumed agent session, which writes the transcript and normally delivers the final user-facing reply; direct sending is only a recovery path. flowchart LR
A[Approved async exec] --> B[Gateway or node host]
B --> C[Authenticated completion handoff]
C --> D[Resumed agent run]
D --> E[Context-sized untrusted output]
D --> F[Session transcript and reply]
C --> G[Direct fallback only on terminal failure]
Decision needed
Why: The code deliberately prioritizes avoiding duplicate output over a second direct status send; source and tests confirm this is intentional, but the acceptable availability tradeoff is product and operational policy rather than a mechanical correctness fact. Before merge
Agent review detailsSecurityNone. PR surfaceSource +688, Tests +687. Total +1375 across 29 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one durable delivery owner per approved completion, but have the responsible maintainer explicitly accept the bounded-observation policy or choose a durable recovery mechanism that can prove the accepted run will eventually deliver exactly once. Do we have a high-confidence way to reproduce the issue? Yes, source provides a high-confidence reproduction: current main routes approved Gateway and node-host completions through the compact notification formatter, while the PR’s focused tests exercise multiline output and the accepted-run ambiguity path. Is this the best way to solve the issue? Unclear until the delivery-owner policy is accepted. The authenticated handoff and model-aware sizing are the right owner-boundary repair for the truncation bug, but the no-second-send availability behavior needs an explicit maintainer choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9dfbf6a8a06c. 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 (4 earlier review cycles)
|
3bae200 to
5a6716c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head closeout for
The branch is mergeable and has a clean live merge-tree against current |
* commit '441d6ab254df14fb6939a8a261f474904ff9c500': (388 commits) fix(qqbot): ignore blank app id fallbacks (openclaw#109460) fix(feishu): consume implicit reply targets across media delivery (openclaw#117196) fix(exec): preserve approved command output when sessions resume (openclaw#117177) fix(qa): use public subagent fanout evidence (openclaw#116832) fix(googlechat): cancel unread auth response bodies before release (openclaw#115873) fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666) fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969) fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392) fix(mistral): keep terminal error branch lint-clean fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110) refactor(i18n): remove unused Apple contradiction report (openclaw#117182) fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167) perf: count large histories before Gateway prewarm (openclaw#117118) fix(signal): restore provider-safe original attachment filenames (openclaw#115107) refactor(channels): unify setup ownership across bundled channels (openclaw#117188) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) ...
…nclaw#117177) * fix(exec): preserve approved exec continuation output Approved async exec continuations reused the compact background notification formatter, so the agent resumed from the last 400 characters of output with all whitespace collapsed and the head silently dropped. Both hosts now render the continuation through a shared whitespace-preserving formatter bounded at 16,000 UTF-16 units. Compact `notifyOnExit` notifications, poll/retained output, and the gateway diagnostics branch are unchanged. The truncation marker deliberately reports no exact omission count: output can already be capped at capture time without leaving a marker, so an exact number would describe only this cut while reading as though nothing else was lost. Closes openclaw#41152 Co-authored-by: Copilot App <[email protected]> Copilot-Session: 2d9762e2-f967-4cdd-9895-299512a20114 * fix(exec): secure approved continuation handoff * test(exec): cover authenticated approval handoff * fix(exec): retain approved followup delivery ownership * fix(exec): retain compact continuation fallback * fix(exec): bound accepted followup observation * fix(exec): keep observer diagnostics internal --------- Co-authored-by: Omar Shahine <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: 2d9762e2-f967-4cdd-9895-299512a20114
* commit 'ae4e662145b6aa162777cdb1c011b3f04ddd230d': (388 commits) fix(qqbot): ignore blank app id fallbacks (openclaw#109460) fix(feishu): consume implicit reply targets across media delivery (openclaw#117196) fix(exec): preserve approved command output when sessions resume (openclaw#117177) fix(qa): use public subagent fanout evidence (openclaw#116832) fix(googlechat): cancel unread auth response bodies before release (openclaw#115873) fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666) fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969) fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392) fix(mistral): keep terminal error branch lint-clean fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110) refactor(i18n): remove unused Apple contradiction report (openclaw#117182) fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167) perf: count large histories before Gateway prewarm (openclaw#117118) fix(signal): restore provider-safe original attachment filenames (openclaw#115107) refactor(channels): unify setup ownership across bundled channels (openclaw#117188) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) ...
Closes #41152
Source work: #117072 by @omarshahine.
The contributor commit is preserved as the first commit in this branch. This
replacement is necessary because the source branch has maintainer edits disabled
and the final fix requires broader handoff, context-budget, disclosure, and
delivery-deduplication changes.
What Problem This Solves
Fixes an issue where an approved async command could resume the agent with
collapsed or heavily truncated output, losing indentation, tabs, leading context,
and enough result data to continue the task correctly.
Why This Change Was Made
Approved command output now crosses an authenticated single-use runtime handoff,
is wrapped as untrusted data, and is sized after the resumed model context is
known. Direct channel fallback has a separate compact redacted budget and stable
delivery intent, while ambiguous wait results leave delivery ownership with the
accepted agent run instead of risking a duplicate reply or command rerun.
User Impact
Agents can continue approved commands from useful multiline output without
rerunning the command. If session resume definitively fails, the user receives
one compact, redacted direct status message.
Evidence
runExecProcessproducer proof covers multiline output, tabs,and payloads larger than 16k.
budget (16,000 characters), transcript replacement, and UTF-16-safe cuts.
total budget, stable delivery intent, bounded ambiguous waits, and no direct
duplicate while the accepted run still owns delivery.
macOS path-normalization failures (
/varvs/private/var,cdvs/usr/bin/cd).https://github.com/openclaw/openclaw/actions/runs/30677907527 remained stuck in
Run Testboxwith no output for 41 minutes and was cancelled. The localfallback passed guards, formatting, boundaries, dead-code scans, and core
typecheck. Core-test typecheck reports only a stale shared-install link for
@openclaw/session-url-contract/parse; hosted PR CI is the authoritativeclean-install gate.