Skip to content

fix: steered sessions fail to resume after restart - #170252

Merged
roboclaw-bot merged 1 commit into
mainfrom
fix/restart-recovery-after-steering
Oct 12, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
fix/restart-recovery-after-steering

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes conversations being permanently marked failed after a Gateway restart when another session had steered the active human-started turn.

User Impact

Interrupted conversations can resume without requiring a replacement session merely because a steering update was the latest transcript input. Authorization, revocation, delivery, and replay-safety checks remain unchanged. This does not automatically reopen sessions already marked failed.

Why This Change Was Made

Steering updates are context inside the active turn, not a new owner of that turn. Recovery now preserves a retained, source-keyed human Control UI or channel claim instead of classifying the whole turn from its latest transcript entry. Unscoped and internal delegated inputs still fail closed.

Evidence

  • The new human-turn steering regression failed on the original code and passes with the fix.
  • Complete recovery-owner suite: 152/152 passed (180.18 seconds wall time; 174.58 seconds Vitest). After behavior-neutral cleanup, all eight selected recovery/refusal cases passed again.
  • Production and agent-session test typechecks, typed lint, formatting, and source line-growth checks passed.
  • Independent P0–P2 review and source-aware authority review found no actionable defects.
  • Exact-head CI run 38309902518 is green. An additional 37 authority/currentness tests passed.

Isolated live Gateway proof

On this head, an actual compiled Gateway received authenticated public RPCs and a real sessions_send(mode: "steer") tool invocation, persisted the original human claim and steering update, then was killed and replaced by a new process on the same SQLite database. Model I/O used a deterministic local HTTP/SSE fixture—not live inference.

Case Result
Authorized steered human turn Recovered to done, exactly one final reply, and file effects exactly before\nafter\n.
Original device revoked after recovery admission Public device.token.revoke caused an error/killed outcome; zero final replies or after-effects and no bypass retry.
Delegated input without a retained human claim Durable delegated-authority refusal, zero recovery provider requests, and no after-effects.

All six Gateway processes and the owned container were confirmed absent afterward; no operator service/state was changed. Production source SHA-256: 63889225b7d642ecf82d70e97e9e8b283bf46d9464fc30bea528ad1243a92bea.

Fixture limitation: the live suite exited 1 (2 passed, 1 failed). After the delegated-denial and zero-effect assertions passed, its final notice assertion incorrectly expected an internal reason in chat.history. The captured response correctly contained the public replacement-session notice. That one expectation was corrected and checked against the recorded response; the corrected full case was not rerun. This is not reported as a three-test green suite. Cold build: 20m32s; live cases: 93.5s. The temporary proof fixture is not part of the product patch.

Reported and requested by @steipete.

Work sessions

Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 12, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 12, 2026 21:19
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Preserve a human-started turn’s recovery claim when an inter-session steering message becomes its latest transcript input.

Example: The human run human-run-with-steering receives a sessions_send update before a Gateway restart.

  • Before: Recovery classifies the steering input as delegated and tombstones the interrupted session.
  • After: Recovery retains the original human source claim and proceeds through the existing admission checks.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no concrete introduced defect, but required authority-chain proof is incomplete.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A human-started conversation can become permanently failed after restart because another session supplied a steering update.
Reason: This collaborator-authored fix restores documented continuity with a small change confined to the existing recovery owner.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it addresses a concrete recovery failure still present on current main, and its collaborator authorship independently prevents automatic closure.

Priority: P1
Reviewed head: 6dccbf9d746b413df69b526c543e3d65c688b522

Before merge

  • Add real behavior proof - Authority-chain proof required: The recovery-store predicate is exercised through real SQLite-backed recovery with mocked Gateway dispatch, but no completed artifact shows this head restoring a steered human turn through final execution or delivery. Record allowed recovery and rejection of an unowned delegated source, then revoke or reassign the retained human authority after admission and demonstrate zero final I/O and no retry that bypasses rejection. An authorized production-path harness may inject those states through the real owners; redact IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security review attention item - No concrete bypass was found, but the expanded authority admission path requires final-effect verification.
  • Resolve merge risk - The expanded recovery path admits inputs previously rejected by a security guard; rejection of stale or reassigned human authority before final effects remains unverified for this scenario.

Findings

None.

Tests

  • Missing end-to-end proof: Show a human turn receiving inter-session steering, cold-restarting, and completing through production recovery, alongside forbidden-source and post-admission revocation/reassignment cases with zero final effects.
Agent review details

How this fits together

Gateway startup recovery reads interrupted session claims and transcript checkpoints, then either settles, refuses, or dispatches a continuation through the normal agent owner.

flowchart TD
  A[Interrupted session] --> B[Saved source claim]
  A --> C[Transcript checkpoint]
  B --> D[Recovery source classification]
  C --> D
  D --> E[Current authority admission]
  E --> F[Agent continuation]
  F --> G[Guarded final effect]
Loading

Technical review

Best possible solution:

Keep source classification with the existing recovery owner while preserving current authority checks through execution and delivery.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically refuses the supplied retained-human-claim/inter-session-tail input; the author reports a failing-before/passing-after regression, which was inspected but not executed during this read-only review.

Is this the best way to solve the issue?

The narrow predicate change addresses the mistaken source classification without adding another recovery owner or removing downstream authorization checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 432d890350b0.

Merge-risk options

Maintainer options:

  1. Hold for authority verification (recommended)
    Keep the PR open until the changed recovery path has the allowed and forbidden final-effect evidence described below.

Provenance checked

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete bypass was found, but the expanded authority admission path requires final-effect verification.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 134631a adds src/agents/main-session-recovery/main-session-restart-recovery-store.ts:488 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 134631a3f3d4; files: src/agents/main-session-recovery/main-session-restart-recovery-store.ts)
  • Vincent Koc: Raw commit 6b5fb4b adds src/agents/main-session-recovery/main-session-harness-completion.test-harness.ts:419 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6b5fb4b23509; files: src/agents/main-session-recovery/main-session-harness-completion.test-harness.ts)
  • RoboClaw: Raw commit f4bb84b adds docs/gateway/restart-recovery.md:629 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f4bb84b5c812; files: docs/gateway/restart-recovery.md)

PR surface

Source +5, Tests +48, Docs +6. Total +59 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 1 +5
Tests 1 56 8 +48
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 68 9 +59

Review metrics

Metric Value Why it matters
Production versus test LOC Production +6/-1; tests +56/-8 A focused source-classification change is supported by retained-human and unscoped-refusal regression cases.

Labels

Label changes:

  • add P1: A real interrupted conversation can be permanently tombstoned after steering, breaking automatic continuation.
  • add merge-risk: 🚨 security-boundary: The patch broadens admission through a delegated-source security guard, requiring final-effect authority validation.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P1: A real interrupted conversation can be permanently tombstoned after steering, breaking automatic continuation.
  • merge-risk: 🚨 security-boundary: The patch broadens admission through a delegated-source security guard, requiring final-effect authority validation.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof for unowned delegated input and show that revocation or reassignment of the retained human authority prevents I/O after admission.

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.

Reviewed October 12, 2026, 5:25 PM ET / 21:25 UTC.

@roboclaw-bot
roboclaw-bot merged commit 3b93ac3 into main Oct 12, 2026
209 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/restart-recovery-after-steering branch October 12, 2026 23:13
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

RomneyDa pushed a commit that referenced this pull request Oct 13, 2026
Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit 3b93ac3)
RomneyDa pushed a commit that referenced this pull request Oct 13, 2026
Backport of 3b93ac3 (#170252) adapted for 2026.10.3.

Applied the retained-human-source guard to 10.3's inter_session refusal by hand (the store
diverged heavily). Regression rewritten in 10.3's fixture style: control-ui/channel steered
turns resume, an unscoped control-ui steering tail still tombstones. Docs keep only this PR's paragraph.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit 3b93ac3)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal.

Co-authored-by: steipete <[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 gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant