Skip to content

fix: recover Session Observer models after catalog failure - #137171

Merged
shakkernerd merged 3 commits into
mainfrom
fix/session-observer-catalog-retry
Sep 3, 2026
Merged

shakkernerd merged 3 commits into
mainfrom
fix/session-observer-catalog-retry

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #137103

What Problem This Solves

Fixes an issue where the Session Observer model picker could remain empty after
its first catalog request failed temporarily. The picker appeared healthy and
hid available utility models until the selected agent, Gateway client, or page
changed.

Why This Change Was Made

The Session Observer caller now preserves catalog request failures instead of
accepting the shared store's fallback as a successful empty catalog. Its
existing unavailable state remains retryable on the next status poll, while
shared cache fallback behavior stays unchanged for callers that intentionally
use it.

The regression test exercises the real mocked Gateway request, shared catalog
store, Config page lifecycle, polling retry, recovered picker options, and
utility-model patch. It replaces the former unit test that mocked the catalog
store itself and could not catch this failure.

User Impact

After a temporary Gateway or catalog failure, users see that explicit models
are unavailable. When the Gateway recovers, the same page automatically
retries and restores available utility models without requiring an agent
switch or reload.

Evidence

  • Reproduced on base 7b67c28e2e9: the initial catalog request failed, the
    unavailable warning remained absent, and the browser regression failed on
    that missing state.
  • Proven source head f0b1595ba9d: the browser scenario passed, explicitly observed
    the next system.info poll, issued a second prepared models.list request
    for the same client and agent, removed the warning, rendered both recovered
    models, and emitted the canonical utility-model patch.
  • Prepared head 4265ad427a2 is a conflict-free rebase onto current main;
    git range-diff maps all three commits as patch-equivalent.
  • Focused exact-head coverage passed 223 UI owner and sibling tests plus 31
    Session Observer runtime tests.
  • A task-local real Gateway integration passed the captured utility-model
    patch through canonical config.patch, read it back through config.get
    with unrelated settings preserved, and completed one Session Observer model
    call through production utility-model resolution.
  • Blacksmith Testbox ran the browser, Gateway, and focused UI suites against
    exact prepared head 4265ad427a2 with exit code 0.
  • Direct Codex source inspection at 728cb12fe579 confirmed that refresh
    failure can preserve the current catalog while a genuinely empty
    model/list is a valid successful response, so the repair remains
    caller-local.
  • Prepared base 0c64b9ea962 is confirmed as genuine upstream history; the
    prepared merge tree is conflict-free and current origin/main contains that base.
  • Prepared-head CI completed all required UI, build, type, lint, security,
    contract, and aggregate gate lanes successfully.
  • Fresh autoreview and independent Workloop whole-outcome review are clean on
    exact prepared head 4265ad427a2.

ClawSweeper Before-Merge Items

  • Current-main comparison: resolved by direct source and merge-tree inspection
    at 0c64b9ea962.
  • Exact-head checks: all required CI passed on prepared head 4265ad427a2.
  • ClawSweeper: exact-head Platinum review completed with no before-merge items.
  • Maintainer decision: landing is explicitly authorized by the issue owner.

Visual Evidence

Before After
Session Observer picker after recovery poll on the baseline, showing one models.list request and only Auto and Disabled Session Observer picker after recovery poll on the fixed head, showing two models.list requests and both recovered models

Initial Failure And Automatic Recovery

pr-137171-session-observer-recovery.webm

Visual Verification

  • Baseline: origin/main@7b67c28e2e96237b4eea9ce095a74d6936ce8c50
  • Proven source head: f0b1595ba9d41d353d77aa872e52a582eed58779
  • Prepared head: 4265ad427a29488c3754767b3a34b834dcbdee7f
  • Scenario: reject the first prepared catalog request, restore two models, and
    advance the next 10-second status poll without replacing the client or
    agent.
  • Initial failure state: baseline warning absent; fixed warning visible.
  • Recovery requests: one additional system.info; models.list advances from
    one to two.
  • Recovered options: baseline has Auto and Disabled; fixed head also has
    Claude Recovered and GPT Recovered.
  • Saved selection: agents.defaults.utilityModel = openai/gpt-recovered.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 5:34 AM ET / 09:34 UTC.

ClawSweeper review

What this changes

The PR makes the Session Observer utility-model picker preserve an initial catalog failure as retryable and adds Control UI browser coverage for recovery on the next status poll.

Regression provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

No blocking correctness finding. Current main still converts this caller’s failed initial catalog request into an empty successful result, while the PR makes that failure retryable at the Config-page boundary; the maintainer-authored, protected PR should remain open for normal maintainer handling.

Priority: P2
Reviewed head: 4265ad427a29488c3754767b3a34b834dcbdee7f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused caller-boundary repair with strong behavior-level regression coverage; no correctness defect was found in the introduced change.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. Its supplied browser scenario is directly tied to the changed Config-page owner and observes the failure warning, poll-driven retry, recovered picker options, and configuration patch.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. Its supplied browser scenario is directly tied to the changed Config-page owner and observes the failure warning, poll-driven retry, recovered picker options, and configuration patch.
Evidence reviewed 6 items PR owner-boundary repair: The introduced Config-page call opts into failure rejection; its existing catch resets the picker to unavailable with no cached client or agent, allowing the following status poll to load again.
Shared catalog contract: The shared loader intentionally returns cached or empty models after a failure unless rejectOnFailure is true; with that option it rethrows, preserving the distinction needed by this caller while leaving other callers unchanged.
Retry entry point: Each successful system.info poll invokes the Session Observer model loader for the currently selected agent, which supplies the recovery trigger after the failure state clears its loaded identity.
Findings None None.
Security None None.

How this fits together

The Control UI polls the Gateway for system status, then loads configured models for the Session Observer utility-model picker. The picker needs to distinguish an unavailable catalog from a valid empty catalog so a later poll can recover without changing page, client, or agent.

flowchart LR
  A[Gateway status poll] --> B[Config page]
  B --> C[Configured model catalog]
  C --> D{Catalog result}
  D -->|Models available| E[Session Observer picker]
  D -->|Temporary failure| F[Retryable unavailable state]
  F --> A
  E --> G[Utility-model configuration]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +138. Total +138 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 180 42 +138
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 181 43 +138

Review metrics

Metric Value Why it matters
Production versus test LOC production +1/-1 (net 0); tests +180/-42 (net +138) The only production change selects an existing failure contract at the caller; the net test growth replaces a mocked unit case with a browser-boundary regression scenario.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #137103
Summary: The linked issue describes the same initial catalog-failure state and this PR’s introduced browser scenario covers its specified recovery path.

Members:

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

Technical review

Best possible solution:

Keep the shared fallback policy for consumers that intentionally tolerate it, while this retrying picker continues to request rejection and shows its existing unavailable state until the next successful poll.

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

Yes, source-reproducible: the shared loader’s empty fallback reaches the Config-page success path on current main, records the client and agent, and makes the next poll skip the request. The added browser scenario encodes that same failure-and-recovery sequence, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The page is the consumer that needs failure to remain distinct from a valid empty catalog; using its existing rejectOnFailure contract avoids changing fallback behavior for sibling consumers that already own their own error treatment.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d15d0fa6c253.

Labels

Label justifications:

  • P2: This repairs a bounded settings-picker recovery defect without data loss, execution failure, or a security boundary change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. Its supplied browser scenario is directly tied to the changed Config-page owner and observes the failure warning, poll-driven retry, recovered picker options, and configuration patch.

Evidence

What I checked:

  • PR owner-boundary repair: The introduced Config-page call opts into failure rejection; its existing catch resets the picker to unavailable with no cached client or agent, allowing the following status poll to load again. (ui/src/pages/config/config-page.ts:811, 4265ad427a29)
  • Shared catalog contract: The shared loader intentionally returns cached or empty models after a failure unless rejectOnFailure is true; with that option it rethrows, preserving the distinction needed by this caller while leaving other callers unchanged. (ui/src/lib/model-catalog-store.ts:216, 4265ad427a29)
  • Retry entry point: Each successful system.info poll invokes the Session Observer model loader for the currently selected agent, which supplies the recovery trigger after the failure state clears its loaded identity. (ui/src/pages/config/config-page.ts:357, 4265ad427a29)
  • Behavior-level regression coverage: The new browser scenario injects an initial models.list failure, advances one status-poll interval after recovery, and asserts the second request, restored options, cleared warning, and canonical configuration patch. (ui/src/e2e/session-observer-model-catalog-recovery.e2e.test.ts:126, 4265ad427a29)
  • Current-main comparison: The fetched current-main Config-page source still calls the catalog loader without rejectOnFailure, so this focused repair is not already implemented on main. (ui/src/pages/config/config-page.ts:811, d15d0fa6c253)
  • Relevant area history: Recent model-catalog work changed both the shared store and this Config-page consumer, providing routing context for the affected boundary. (ui/src/lib/model-catalog-store.ts, 150eb9a924c0)

Likely related people:

  • Erick Kinnee: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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 (3 earlier review cycles)
  • reviewed 2026-09-03T08:27:58.394Z sha 94ffb1c45dcd79d6c7aa3a3d33e7d3e236deed00 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-03T08:59:29.034Z sha f0b1595ba9d41d353d77aa872e52a582eed58779 :: blocked before merge. :: none
  • reviewed 2026-09-03T09:25:58.440Z sha f0b1595ba9d41d353d77aa872e52a582eed58779 :: blocked before merge. :: none

@shakkernerd shakkernerd self-assigned this Sep 3, 2026
@shakkernerd
shakkernerd force-pushed the fix/session-observer-catalog-retry branch from f0b1595 to 4265ad4 Compare September 3, 2026 09:27
@shakkernerd
shakkernerd merged commit bf5c6d7 into main Sep 3, 2026
148 checks passed
@shakkernerd
shakkernerd deleted the fix/session-observer-catalog-retry branch September 3, 2026 10:23
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Session Observer model choices now recover automatically after a transient initial catalog failure.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…137171)

Restores automatic Session Observer model-catalog recovery after a transient initial failure while preserving successful empty-catalog behavior.

Refs openclaw#137103.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

[Bug]: Session Observer model picker stays empty after an initial catalog failure

1 participant