Skip to content

fix: transcript failures cool healthy credentials and hide recovery guidance - #150882

Merged
steipete merged 4 commits into
openclaw:mainfrom
DonnieFi:fix/150809-transcript-validation-local-error
Sep 17, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
DonnieFi:fix/150809-transcript-validation-local-error

Conversation

@DonnieFi

@DonnieFi DonnieFi commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150809.

What Problem This Solves

Gateway transcript-validation failures could be reported as provider-session expiry and cool healthy shared credentials, disrupting other sessions using the same credential. The thrown-error reply path also hid the transcript diagnosis.

User Impact

Transcript-validation failures stay local, and both assistant errors and thrown run failures explain that the Gateway rejected a transcript entry with recovery guidance. Genuine provider-session expiry keeps its existing credential-health behavior. Raw transcript and provider details remain out of normal replies.

Why This Change Was Made

Recognize the validator message before the broad expiry matcher and carry bounded format-error copy through the existing reply renderer. The requested retry cleanup removes duplicate assistant-policy inputs and fallback attempt records, an unused cooldown field, and a test cast by narrowing the real cooldown dependency contract. Retry budgets, timing, replay guards, cancellation, and credential-bookkeeping order are preserved.

Thanks @DonnieFi for the original classification fix and shared-credential proof.

Evidence

  • The extended regression failed on the original PR: the real SessionManager validator passed through prompt-failure handling but the final reply was only “request format rejected.” It passes with the correction and verifies that no credential-health write or profile rotation occurs.
  • 572 tests passed across 13 focused files covering classification, prompt and assistant failure handling, retry policy/controller, model fallback and cooldown probes, terminal authority, and final reply copy.
  • Independent P0–P2 review of the complete candidate found no actionable findings.
  • Before/after captures use the real Control UI and production-generated reply text with a mocked Gateway and entirely synthetic data. Each capture sends and completes a chat turn.
  • node scripts/check-changed.mjs passed, including core and test typechecks, formatting, lint, dead-export scans, and architecture guards.
  • Exact-head CI for cac212e61234fdab8bb63888dcd7478378726f97: run 35239056929 passed, including the required openclaw/ci-gate.

Before:

Before: transcript failure reported as provider session expiry

After:

After: bounded Gateway transcript diagnosis and recovery guidance

The original long-session/legacy-history trigger remains unverified. The proof induces the actual validator error rather than reconstructing the reporter's accumulated session. The contributor's earlier Gateway/SQLite proof at 0dbc9835c36ad531b9baeabe866b289a54fa7f3a showed subsequent reuse of the same shared credential and a genuine-expiry cooldown control; the health writer remains unchanged.

Gateway-owned "Invalid session transcript entry" matched the CLI expiry
classifier and cooled healthy shared credentials. Keep that failure local
and leave genuine invalid-session expiry unchanged.
@DonnieFi
DonnieFi requested a review from a team as a code owner September 17, 2026 12:24
@clawsweeper

clawsweeper Bot commented Sep 17, 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 agents Agent runtime and tooling size: S labels Sep 17, 2026
@DonnieFi

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 17, 2026, 11:30 AM ET / 15:30 UTC (Revision 5).

ClawSweeper review

What this changes

The PR keeps transcript-validation failures from cooling healthy credentials, preserves recovery guidance in assistant and thrown-error replies, and consolidates existing retry bookkeeping.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This fix remains necessary: current main and the latest release retain the misclassification. The revised patch preserves the established recovery policy, and no blocking code defect was found.

Priority: P1
Reviewed head: cac212e61234fdab8bb63888dcd7478378726f97

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with sufficient retained production-boundary proof, inspected visible-copy evidence, and no actionable code findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Retained Gateway/SQLite proof demonstrates credential reuse after an induced validator failure and genuine-expiry cooldown behavior; inspected before/after Control UI captures demonstrate the revised reply text. The new regression connects the validator to thrown-error rendering. The original legacy-history trigger remains outside this proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained Gateway/SQLite proof demonstrates credential reuse after an induced validator failure and genuine-expiry cooldown behavior; inspected before/after Control UI captures demonstrate the revised reply text. The new regression connects the validator to thrown-error rendering. The original legacy-history trigger remains outside this proof.
Evidence reviewed 9 items Current main still needs the fix: Fetched main checks the broad invalid-session matcher without a preceding transcript-validation exception.
Latest release retains the same mechanism: The v2026.9.4 classifier contains the broad invalid-session matcher under the older classify.ts path. Release source was verified through GitHub after the local historical blob read failed.
Local producer and existing health policy: SessionManagerEntries throws the exact transcript-validation message. The existing auth-profile policy excludes format failures from shared health, and prompt-failure handling avoids rotation and health writes for this classification. This is an OpenClaw-owned contract; the change does not depend on the Codex implementation.
Findings None None.
Security None None.

How this fits together

OpenClaw classifies agent-run failures before deciding whether to retry, rotate credentials, or report an error. These decisions affect shared credential availability and the explanation returned to users.

flowchart TD
  A[Agent run failure] --> B[Error classification]
  B --> C[Transcript validation]
  B --> D[Provider session expiry]
  C --> E[Local format failure]
  E --> F[Bounded recovery guidance]
  D --> G[Existing credential health policy]
Loading

Before merge

  • Complete next step (P2) - Confirm listed secops-owner involvement for auth-profile-failure-policy.test.ts, or complete the already-requested team review.
Agent review details

Security

None.

PR surface

Source -2, Tests +106, Docs +2. Total +106 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 77 79 -2
Tests 6 112 6 +106
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 191 85 +106

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150809
Summary: This PR targets the linked incident's misclassification and credential-health defect; the issue remains open pending resolution.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep transcript failures session-local through the existing format policy and bounded reply renderer, while preserving genuine provider-expiry handling.

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

Yes, for the narrow classification defect: the real validator's error matches current main's expiry matcher and reaches shared-health policy. This review did not execute the path or reconstruct the reporter's accumulated session.

Is this the best way to solve the issue?

Yes. The patch reuses existing classification, credential-health, and reply-rendering owners without changing configuration or persisted formats.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Misclassifying a local transcript failure can cool healthy shared credentials and disrupt other agent sessions, consistent with the reported multi-hour incident.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Retained Gateway/SQLite proof demonstrates credential reuse after an induced validator failure and genuine-expiry cooldown behavior; inspected before/after Control UI captures demonstrate the revised reply text. The new regression connects the validator to thrown-error rendering. The original legacy-history trigger remains outside this proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained Gateway/SQLite proof demonstrates credential reuse after an induced validator failure and genuine-expiry cooldown behavior; inspected before/after Control UI captures demonstrate the revised reply text. The new regression connects the validator to thrown-error rendering. The original legacy-history trigger remains outside this proof.

Evidence

What I checked:

  • Current main still needs the fix: Fetched main checks the broad invalid-session matcher without a preceding transcript-validation exception. (src/agents/failover/classify-core.ts:102, b669279a2e01)
  • Latest release retains the same mechanism: The v2026.9.4 classifier contains the broad invalid-session matcher under the older classify.ts path. Release source was verified through GitHub after the local historical blob read failed. (src/agents/failover/classify.ts:410, 3a9d69db306c)
  • Local producer and existing health policy: SessionManagerEntries throws the exact transcript-validation message. The existing auth-profile policy excludes format failures from shared health, and prompt-failure handling avoids rotation and health writes for this classification. This is an OpenClaw-owned contract; the change does not depend on the Codex implementation. (src/agents/sessions/session-manager-entries.ts:63, cac212e61234)
  • Thrown-error recovery guidance: The reply path now passes preserved format diagnostics through the existing bounded renderer. The extended prompt-failure regression connects a real SessionManager validation error to the final reply while asserting no credential-health write or profile rotation. (src/auto-reply/reply/agent-runner-failure-reply.ts:394, cac212e61234)
  • Proof continuity and inspected screenshots: The captured body, sourceRevision 65e807fe8c188b0de6b77c785d49a94fe1b9396f90af45c339273b830a1332ec, preserves the earlier Gateway/SQLite credential-reuse and genuine-expiry control results at 0dbc983. The completed earlier review accepted that production-boundary proof. Both downloaded screenshots were inspected: the before image shows provider-session expiry, and the after image shows the bounded transcript diagnosis and recovery guidance. The images demonstrate visible copy through a mocked Gateway, not credential persistence. The original accumulated-history trigger remains unverified. (cac212e61234)
  • Cleanup preserves existing decisions: The introduced assistant closure retains the same policy inputs and credential-bookkeeping order. The fallback record helper retains the same fields, and the removed cooldown leaderCandidate field has no production consumer. Probe timing, cancellation guards, and stored-data formats are unchanged. (src/agents/embedded-agent-runner/run/assistant-failure.ts:257, cac212e61234)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-17T12:30:39.978Z sha 0c24bee :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T12:50:28.522Z sha 951c136 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T13:09:17.915Z sha 0dbc983 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T14:19:15.848Z sha 0dbc983 :: blocked before merge. :: none

red added 2 commits September 17, 2026 09:41
check-dependencies failed because knip reported this string as an unused
export. Tests now assert the literal banner so they fail if that copy
changes.
… credentials

ClawSweeper asked for the live SessionManager validator through the prompt
failure handler, not only classify and copy helpers.
@DonnieFi

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@spiral-cmd

Copy link
Copy Markdown

Great work on this, @DonnieFi — the negative lookahead on invalid session(?! transcript) was spot on. We hit this incident hard on 2026-09-17 (multi-hour outage, all agents on ollama-cloud offline simultaneously) and spent the investigation time at the plugin layer, not realising the error was dying inside the Gateway validator before the provider was ever called. Our classifyFailoverReason hooks were downstream of the bug and never consulted — so no plugin-layer workaround could fully fix it.

The fix shape is clean: one early-return guard in classify-core.ts before the expiry matcher runs, a tightened negative lookahead in isCliSessionExpiredErrorMessage, and Gateway-owned copy that's actually actionable ("Compact or reset this session") instead of the misleading "provider session expired." The end-to-end test using a live SessionManager validator to confirm credentialMarks: [] is the right proof — that's exactly the blast-radius check that matters.

We'll pick this up in the next openclaw update gate. Looking forward to it shipping.

@DonnieFi

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
…andling

Classify Gateway transcript validation before provider session expiry and carry bounded recovery copy through the thrown-error reply path. Consolidate retry decisions and fallback records, remove an unused cooldown field, and narrow the cooldown dependency contract without changing retry budgets or replay guards.

Co-authored-by: red <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M and removed size: S labels Sep 17, 2026
@steipete steipete changed the title fix: Gateway transcript errors take healthy providers offline as session expiry fix: transcript failures cool healthy credentials and hide recovery guidance Sep 17, 2026
@steipete

Copy link
Copy Markdown
Contributor

Owner involvement is satisfied: @steipete explicitly requested this repair and landing, including the retry cleanup, and is an active maintainer of the listed openclaw/openclaw-secops team.

Reviewed commit: cac212e. The production credential-health policy is unchanged; its added test preserves genuine session-expiry behavior. The local validator-to-final-reply regression, 572 focused tests, full changed-file validation, and independent P0–P2 review pass. Both inspected synthetic screenshots render in the PR body. Exact-head CI remains the final merge gate.

@steipete
steipete merged commit 85f6969 into openclaw:main Sep 17, 2026
237 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

@DonnieFi
DonnieFi deleted the fix/150809-transcript-validation-local-error branch September 17, 2026 21:11
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…uidance (openclaw#150882)

* fix: stop treating transcript validation as provider session expiry

Gateway-owned "Invalid session transcript entry" matched the CLI expiry
classifier and cooled healthy shared credentials. Keep that failure local
and leave genuine invalid-session expiry unchanged.

* fix: keep transcript-validation copy unexported

check-dependencies failed because knip reported this string as an unused
export. Tests now assert the literal banner so they fail if that copy
changes.

* test: prove Gateway prompt failure keeps transcript errors off shared credentials

ClawSweeper asked for the live SessionManager validator through the prompt
failure handler, not only classify and copy helpers.

* fix(agents): keep transcript failures local through retry and reply handling

Classify Gateway transcript validation before provider session expiry and carry bounded recovery copy through the thrown-error reply path. Consolidate retry decisions and fallback records, remove an unused cooldown field, and narrow the cooldown dependency contract without changing retry budgets or replay guards.

---------

Co-authored-by: Peter Steinberger <[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 P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

"provider session expired" misclassification hides gateway-internal transcript validation error

3 participants