Skip to content

fix(gateway): stop dashboard title work from blocking session rollover - #162689

Merged
obviyus merged 4 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-162420-dashboard-title-admission
Oct 7, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-162420-dashboard-title-admission

Conversation

@ericcaiwx-star

@ericcaiwx-star ericcaiwx-star commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #162420

What Problem This Solves

The first Control UI message after a daily reset can fail with timed out draining work before reply session rollover. Deferred dashboard title work holds session admission while waiting for reply progress; rollover must drain that admission before the reply can progress.

Why This Change Was Made

scheduleDashboardSessionTitle now waits for turn.released before acquiring session admission. It preserves current main's boolean release result and turn.settled retry/fallback behavior. The guarded title writer still checks session identity and an existing explicit name. Real competing session work still blocks rollover.

The rebase retains main's settled-turn fallback regression. The daily-rollover proof now reports the actual agent.wait error and checks drain-timeout text instead of labelling every run error as a drain timeout.

User Impact

A dashboard reply can perform its daily rollover while title readiness is pending, then title generation can acquire admission after reply progress. No configuration, environment variable, stored-data contract, or reset-policy change.

Verification

Pinned current-main baseline: a6e31e2247ebdc477be43c8ba6b5e73bf6082928.
Candidate: 430322d2cf1d1dc684071c09c3978590fc1e4790 (unchanged contributor head).

Built both revisions in isolated Node 24.21.0 Linux containers, with Gateway state on tmpfs. Used a configured one-minute idle reset, real WebSocket chat.send / agent.wait, and no clock changes. Sent a first message, waited 65 seconds, then sent the first message after reset.

  • Base: first reply succeeds; the post-reset reply fails with Error: timed out draining work before reply session rollover: agent:main:dashboard:rollover-proof.
  • Candidate: both replies succeed. The post-reset reply is Rollover proof reply; session 70ce7fd8-cd6a-4dd7-b709-44c983953559 retains its identity, rotates its lifecycle revision, and receives display name Rollover proof reply.
  • Real competing-work control: held the loopback provider response of an active Gateway reply for 75 seconds and sent competing work after 65 seconds. Current main reports it queued with providerStarted: false, then completes after release. Candidate also waits until release (10.074 seconds after the second send). The existing 31 admission/lifecycle tests pass on both revisions.
  • Regression discrimination: the PR's two regression files have two expected failures on current main (the actual rollover drain timeout and the unresolved title-gate admission assertion); all five tests pass on the candidate. The failing base fixture additionally reports an admission-closed teardown rejection; candidate has no unhandled errors. Candidate regression wrapper wall time: 66.04 seconds. Candidate admission-control wrapper: 20.40 seconds. Combined baseline run: 77.96 seconds.
  • Live gate: one Gateway Responses request was forwarded to real gpt-5-mini, with reasoning low and max_output_tokens: 4096. HTTP 200; Gateway returned a real release-planning answer and recorded response model gpt-5-mini-2025-08-07. Other requests, including title generation, used the loopback fixture. Credentials and the credential-bearing container were removed.
  • pnpm tsgo and both pnpm build:docker builds passed. No additional source change or push was necessary.
  • Exact-head openclaw/ci-gate: success; no failed or cancelled jobs. ClawSweeper is ready on the same SHA: fix(gateway): stop dashboard title work from blocking session rollover #162689 (comment).

Commands:

node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-title-preparation.test.ts src/gateway/server.chat-dashboard-title-rollover.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/sessions/session-lifecycle-admission.test.ts --maxWorkers=1
pnpm tsgo
pnpm build:docker

Only title-work admission ordering changes. The session-identity and explicit-name guards remain intact; no transcript or session-store format changes. Current main has no intervening commits on the PR's three files, and merge-tree is clean.

No overlap with Pash/Sarah changes.

Thanks to @ericcaiwx-star for the fix and @dimonnld for the report.

@clawsweeper

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

@ericcaiwx-star
ericcaiwx-star marked this pull request as ready for review October 1, 2026 12:37
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 6:15 AM ET / 10:15 UTC (Revision 4).

ClawSweeper review

What this changes

The PR delays dashboard title work’s session admission until reply progress, preventing background naming from blocking automatic session rollover.

Merge readiness

✅ Ready for maintainer review

This remains a useful, narrowly scoped fix: current main and the latest release retain the circular wait. The refreshed production-boundary proof supports the repair, and no blocking introduced defect was found.

Priority: P1
Reviewed head: 430322d2cf1d1dc684071c09c3978590fc1e4790

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, maintainable repair has strong boundary evidence and preserves the newer title-retry behavior.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The exact-head transcript exercises the changed title scheduler through real Gateway WebSocket requests and SQLite daily rollover in an isolated Mac setup, observing a successful reply and lifecycle refresh without a drain timeout. Controlled owner coverage and a failing pre-fix negative control supplement that proof; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The exact-head transcript exercises the changed title scheduler through real Gateway WebSocket requests and SQLite daily rollover in an isolated Mac setup, observing a successful reply and lifecycle refresh without a drain timeout. Controlled owner coverage and a failing pre-fix negative control supplement that proof; no stored-data contract changes.
Evidence reviewed 9 items Verified introduced change: The pinned introduction diff moves the reply-gate await before session admission while preserving the boolean release result and settled-turn retry. The verified test-merge comparison contains the same production change.
Still necessary on current main: Fetched main still awaits turn.released inside generateTitle, which runs after acquiring session admission. It therefore retains the reported circular dependency.
Latest release retains the defect: The v2026.9.8 source also acquires session admission before awaiting title readiness; the requested repair is not already shipped.
Findings None None.
Security None None.

How this fits together

Gateway chat dispatch schedules background session naming alongside foreground replies. Automatic rollover drains session work before preparing the reply, so naming must not hold admission while waiting for that reply’s progress.

flowchart TD
  A[Dashboard message] --> B[Gateway reply dispatch]
  B --> C[Automatic rollover]
  C --> D[Drain competing session work]
  D --> E[Reply progress or settlement]
  E --> F[Acquire title admission]
  F --> G[Generate and safely save title]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +268. Total +269 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 2 +1
Tests 2 269 1 +268
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 272 3 +269

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #162420
Summary: This PR specifically repairs the admission deadlock reported by the canonical issue; serial-provider title contention is adjacent and independently repaired.

Members:

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

Technical review

Best possible solution:

Keep title readiness outside session admission while preserving foreground reply priority, bounded title retries, and guarded persistence.

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

Yes: current main establishes the circular wait between pending title readiness and rollover admission draining, supported by user failure traces and the contributor’s negative control. This read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: moving the wait before admission repairs the owning scheduling invariant without disabling reset, extending timeouts, or replacing the existing title writer.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The repair addresses confirmed current-release dashboard reply failures after daily reset, including embedded sessions without worker placement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The exact-head transcript exercises the changed title scheduler through real Gateway WebSocket requests and SQLite daily rollover in an isolated Mac setup, observing a successful reply and lifecycle refresh without a drain timeout. Controlled owner coverage and a failing pre-fix negative control supplement that proof; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The exact-head transcript exercises the changed title scheduler through real Gateway WebSocket requests and SQLite daily rollover in an isolated Mac setup, observing a successful reply and lifecycle refresh without a drain timeout. Controlled owner coverage and a failing pre-fix negative control supplement that proof; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (3 earlier review cycles)
  • reviewed 2026-10-01T12:44:19.526Z sha 37417acff69f3bb6c4817e31076ba8d10e8a6929 :: needs real behavior proof before merge. :: [P2] [P2] Replace the regression’s wall-clock polling with controlled timing
  • reviewed 2026-10-01T13:54:12.044Z sha 0e446403e17625f223805eed777b053ac64da4fc :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T14:11:03.146Z sha 029e478a082965f55e6fbc66f83f2972ad264c58 :: needs maintainer review before merge. :: none

@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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 1, 2026
ericcaiwx-star and others added 4 commits October 4, 2026 17:27
Daily reset waits for the session lease that title generation holds until reply progress, so the first message after reset times out.

Co-authored-by: Cursor <[email protected]>
The title-gate regression advances fake timers, and a gateway chat.send covers a stale daily dashboard session through a successful reply.

Co-authored-by: Cursor <[email protected]>
@ericcaiwx-star
ericcaiwx-star force-pushed the codex/fix-162420-dashboard-title-admission branch from 029e478 to 430322d Compare October 4, 2026 10:07
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 7, 2026
@obviyus
obviyus merged commit 3c904ae into openclaw:main Oct 7, 2026
135 of 136 checks passed
@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Landed in 3c904ae. Thanks @ericcaiwx-star! Verified on a built Gateway with a one-minute idle reset: main failed the first post-reset chat.send with the rollover drain timeout; with this the reply arrives, the session rotates, and the title lands on the right session, while a genuinely competing reply still serializes rollover.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
openclaw#162689)

Make deferred dashboard title work wait for the turn to be released before acquiring session admission, so the first Control UI message after a session reset no longer fails with a rollover drain timeout. Genuine competing session work still serializes rollover, and the guarded title writer still targets the same session identity.

Closes openclaw#162420.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 11, 2026
#162689)

Make deferred dashboard title work wait for the turn to be released before acquiring session admission, so the first Control UI message after a session reset no longer fails with a rollover drain timeout. Genuine competing session work still serializes rollover, and the guarded title writer still targets the same session identity.

Closes #162420.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 3c904ae)
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
openclaw#162689)

Make deferred dashboard title work wait for the turn to be released before acquiring session admission, so the first Control UI message after a session reset no longer fails with a rollover drain timeout. Genuine competing session work still serializes rollover, and the guarded title writer still targets the same session identity.

Closes openclaw#162420.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 3c904ae)
(cherry picked from commit 6667a88)
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

gateway Gateway runtime 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. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily reset rollover of a worker-placed dashboard session fails: "timed out draining work before reply session rollover"

2 participants