Skip to content

fix(sessions): show storage failure copy in run-failure notices - #170048

Merged
steipete merged 3 commits into
mainfrom
steipete/run-failure-notice-copy
Oct 12, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/run-failure-notice-copy

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Runs that fail before replying can expose raw Gateway storage diagnostics. Using the full transcript-notice copy in the 160-character session-row field also cuts off useful recovery guidance.

User Impact

Recognized storage failures show the existing friendly guidance. Transcript notices retain their warning prefix and log hint; session-list errors show the complete plain summary without those additions. Ordinary errors retain their existing presentation.

Why This Change Was Made

recordGatewaySessionRunFailure classifies the supplied error before text flattening and reuses renderAssistantRequestFailureCopy. resolveSessionRunError uses renderStorageFailureSummary from the same copy owner so the full recovery guidance fits its existing 160-character limit. The summary adds no warning prefix or log hint. details.error keeps its existing diagnostic; the public transcript projection strips that field.

The current callers pass terminal error strings, handled by the existing classifier's exact known-message fallback. No worker contract, classifier, or production copy strings were added. The separate subagent writer-claim matcher controls retry policy, not presentation.

Evidence

  • Original storage-copy baseline: six regressions failed and both ordinary-error checks passed. The stricter session-row baseline then reproduced both truncation failures while the other six checks passed.
  • pnpm test src/sessions/session-run-error.test.ts --maxWorkers=1: 8 passed, 157.08 seconds wall time. Row cases assert exact equality with the complete plain copy; transcript-notice cases retain the full copy.
  • pnpm test src/agents/failover/assistant-request-failure-copy.test.ts --maxWorkers=1: 20 passed, 109.93 seconds wall time.
  • Core and changed-test typechecks, targeted lint, formatting, and git diff --check passed.
  • CI seconds: pending PR CI for the updated head.

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

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR applies existing storage-failure guidance to transcript notices and bounded session-row errors.

Example: A failed run records “database is locked”.

  • Before: The session row displays “database is locked”.
  • After: The session row displays “OpenClaw is busy saving your conversation. Wait a moment, then check the conversation before trying again.”

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused patch with meaningful reported regressions and no identified correctness defect; behavior evidence remains limited to unit coverage.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts this PR from the ordinary contributor proof gate; supplied validation exercises formatter output with mocked transcript I/O.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Failed runs can expose internal storage diagnostics instead of useful recovery guidance.
Reason: The patch closes a concrete presentation gap through the existing owner, and the supplied maintainer-authored classification establishes direction.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current-main presentation gap, and no actionable introduced defect was found.

Priority: P2
Reviewed head: 29f06d0464cd02af8bf8ac5ac63c3c1a4ab93221

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied scenario exercises the changed transcript notice and complete session-row summary through a shipped Gateway or Control UI.
Agent review details

How this fits together

Gateway lifecycle and subagent completion owners supply terminal errors to the session formatter, which produces transcript notices and session-row summaries for clients.

flowchart TD
  A[Gateway lifecycle] --> C[Session failure formatter]
  B[Subagent completion] --> C
  C --> D[Storage classifier and copy owner]
  D --> E[Transcript notice]
  D --> F[Session row summary]
  E --> G[Control UI]
  F --> G
Loading

Technical review

Best possible solution:

Use the existing classifier and copy owner consistently, retaining complete plain guidance for bounded session rows.

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

Current-main source deterministically presents “database is locked” as raw session text and a generic transcript notice; the reported failing baselines support that path, and no target code was executed during review.

Is this the best way to solve the issue?

Reusing the existing classifier and fixed copy is a focused repair that preserves ordinary errors, state-contention precedence, diagnostics, and write authority.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Durable run-failure notices keeps the original intent (94c0f0d: Persist actionable runtime-loss notices while retaining diagnostics and a single terminal outcome.)
  • Bounded session-row presentation keeps the original intent (779e6cf: Preserve terminal diagnoses and recovery guidance within bounded session errors.)
  • Storage-failure guidance keeps the original intent (c91b1ea: Classify recognized storage failures and render shared recovery guidance without exposing arbitrary provider bodies.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c8d84ec adds src/sessions/session-run-error.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c8d84ec1b653; files: src/sessions/session-run-error.ts)
  • Vincent Koc: Raw commit d0b48d6 adds src/agents/failover/assistant-request-failure-copy.ts:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d0b48d63efb8; files: src/agents/failover/assistant-request-failure-copy.ts)
  • Ayaan Zaidi: Raw commit ee8657a adds src/agents/failover/assistant-request-failure-copy.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ee8657a02329; files: src/agents/failover/assistant-request-failure-copy.ts)

PR surface

Source +16, Tests +89. Total +105 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 18 2 +16
Tests 1 89 0 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 107 2 +105

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves recovery guidance for failed runs without changing storage ownership, retries, configuration, or setup.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 (2 earlier review cycles)
  • reviewed 2026-10-12T17:41:03.384Z sha e23b298 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T17:59:47.458Z sha df3a2e0 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 2:30 PM ET / 18:30 UTC (Revision 3).

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 12, 2026
@steipete
steipete merged commit 80347a9 into main Oct 12, 2026
115 of 118 checks passed
@steipete
steipete deleted the steipete/run-failure-notice-copy branch October 12, 2026 21:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…claw#170048)

* fix(sessions): show storage failure copy in run-failure notices

* fix(sessions): keep session-row storage errors within the row limit

* test(sessions): explain run-failure notice store isolation
hilsbos pushed a commit to hilsbos/openclaw that referenced this pull request Oct 22, 2026
…claw#170048)

* fix(sessions): show storage failure copy in run-failure notices

* fix(sessions): keep session-row storage errors within the row limit

* test(sessions): explain run-failure notice store isolation

(cherry picked from commit 80347a9)
Co-authored-by: RomneyDa <[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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant