Skip to content

fix(tui): preserve published model availability - #142160

Merged
obviyus merged 2 commits into
mainfrom
fix/tui-catalog-availability
Sep 8, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/tui-catalog-availability

Conversation

@obviyus

@obviyus obviyus commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #139880.

What Problem This Solves

The terminal picker lost published availability and submitted known unavailable choices as session changes. Embedded mode also maintained separate discovery and filtering.

Why This Change Was Made

Both terminal backends use the selected agent's published model facts. Display projection retains its prepared owner, while embedded history, patch, and creation use raw prepared entries. Unavailable selection returns before session mutation.

User Impact

Unavailable choices remain visible with a reason and recovery guidance. Available and unknown choices can still be selected. Older Gateways retain their supported request and selection behavior.

Consumers: terminal model display and selection, plus embedded session operations, now share published catalog facts.

Evidence

The original selector failed the unavailable-selection regression; all 45 focused cases passed after repair. Four compiled local-terminal scenarios covered replacement, wildcards, another agent's restrictive policy, and empty inventory. Separate session-list commands confirmed saved selections and unchanged state after refusals. Continuous integration passed after one infrastructure retry. Public checks did not cover populated-history refusal or in-flight replacement; those retain owner-level coverage. Live inference, native accounts, and standalone installation were not tested.

@clawsweeper

clawsweeper Bot commented Sep 8, 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 docs Improvements or additions to documentation size: L maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 9:38 AM ET / 13:38 UTC.

ClawSweeper review

What this changes

The terminal model picker preserves published availability, explains unavailable choices without changing the session, and uses the shared catalog projection in local mode.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix absent from current main. No blocking defects were found, and the updated runtime evidence addresses the previous configured-only and wildcard startup concern.

Priority: P2
Reviewed head: 15b2ed04afddb9b40273b7e31c34bdea87b0cf74

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant runtime observations, meaningful boundary coverage, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Reported compiled local-TUI observations exercise the changed embedded publication and picker paths: refusal leaves sessions unchanged, available and unknown selections persist, and wildcard replace startup succeeds. Production code is unchanged since that proof; provider inference is outside its claims.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Reported compiled local-TUI observations exercise the changed embedded publication and picker paths: refusal leaves sessions unchanged, available and unknown selections persist, and wildcard replace startup succeeds. Production code is unchanged since that proof; provider inference is outside its claims.
Evidence reviewed 9 items Introduced production changes: The merge-base-to-head diff changes catalog consumption and picker handling. The picker refuses only explicit false availability; available and unknown choices retain their existing session-update path.
Still needed on current main: Fetched main still applies every picker selection without inspecting availability, and its embedded runtime still explicitly requests static publication.
Shared projection and lifecycle boundary: Embedded listing holds the prepared catalog owner through asynchronous projection. History, create, and patch operations continue receiving raw catalog entries. The shared projection checks generation liveness and preserves unknown availability when details are requested; this is an OpenClaw catalog contract, with no dependency-specific Codex behavior claimed by this patch.
Findings None None.
Security None None.

How this fits together

The terminal UI obtains model choices from a connected Gateway or its embedded local runtime. The selected agent’s catalog feeds the picker, whose accepted choices update the session’s model.

flowchart TD
  A[Selected agent] --> B[Gateway catalog]
  A --> C[Local published catalog]
  B --> D[Terminal model picker]
  C --> D
  D --> E{Known unavailable?}
  E -->|Yes| F[Show recovery guidance]
  E -->|No| G[Update session model]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +20, Tests +263, Docs 0. Total +283 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 82 62 +20
Tests 5 457 194 +263
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 540 257 +283

Review metrics

None.

Technical review

Best possible solution:

Keep one published catalog projection for terminal browsing, retain raw execution operands, and preserve capability-negotiated compatibility with released Gateways.

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

Yes, from source: current main forwards a known-unavailable picker choice to the session patch without checking its availability. This review did not execute that path.

Is this the best way to solve the issue?

Yes. Reusing the existing catalog projection removes competing discovery logic, while the explicit-false guard and capability negotiation preserve unknown and legacy choices.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Reported compiled local-TUI observations exercise the changed embedded publication and picker paths: refusal leaves sessions unchanged, available and unknown selections persist, and wildcard replace startup succeeds. Production code is unchanged since that proof; provider inference is outside its claims.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This fixes a bounded terminal model-selection defect with clear recovery guidance and preserved legacy behavior.
  • 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 (terminal): Reported compiled local-TUI observations exercise the changed embedded publication and picker paths: refusal leaves sessions unchanged, available and unknown selections persist, and wildcard replace startup succeeds. Production code is unchanged since that proof; provider inference is outside its claims.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported compiled local-TUI observations exercise the changed embedded publication and picker paths: refusal leaves sessions unchanged, available and unknown selections persist, and wildcard replace startup succeeds. Production code is unchanged since that proof; provider inference is outside its claims.

Evidence

What I checked:

  • Introduced production changes: The merge-base-to-head diff changes catalog consumption and picker handling. The picker refuses only explicit false availability; available and unknown choices retain their existing session-update path. (src/tui/tui-command-handlers.ts:366, 15b2ed04afdd)
  • Still needed on current main: Fetched main still applies every picker selection without inspecting availability, and its embedded runtime still explicitly requests static publication. (src/tui/tui-command-handlers.ts:360, bd8f393b2366)
  • Shared projection and lifecycle boundary: Embedded listing holds the prepared catalog owner through asynchronous projection. History, create, and patch operations continue receiving raw catalog entries. The shared projection checks generation liveness and preserves unknown availability when details are requested; this is an OpenClaw catalog contract, with no dependency-specific Codex behavior claimed by this patch. (src/tui/embedded-backend.ts:906, 15b2ed04afdd)
  • Released Gateway compatibility: The v2026.9.2 request schema lacks includeDetails and rejects additional properties. The patch sends that field only when the published-catalog capability is advertised, preserving legacy selection behavior otherwise. (packages/gateway-protocol/src/schema/agents-models-skills.ts, 3928bad9badf)
  • Updated real-runtime evidence: The captured body reports a compiled local TUI run that displayed refusal guidance, left the session list empty after refusal, and subsequently persisted unknown/choice and ready/choice. A separate wildcard replace setup started and saved a changed model. These observations address the previous review’s concrete compatibility concern. The live REST body matched the supplied snapshot. (9d5e4804fc75)
  • Proof continuity: The difference from the earlier reviewed head contains only embedded-prepared-runtime.test.ts and model-catalog-availability.test.ts. The production inputs covered by the reported compiled proof are unchanged. (15b2ed04afdd)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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 (1 earlier review cycle)
  • reviewed 2026-09-08T12:56:45.665Z sha 9d5e480 :: blocked before merge. :: none

@obviyus obviyus self-assigned this Sep 8, 2026
@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. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 8, 2026
@obviyus
obviyus merged commit 37bddb2 into main Sep 8, 2026
315 of 318 checks passed
@obviyus
obviyus deleted the fix/tui-catalog-availability branch September 8, 2026 14:50
@obviyus

obviyus commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

Proof: Four compiled local-terminal scenarios cover configured replacement, provider wildcards, a different agent with restrictive policy, and empty replacement. Separate public session commands confirm saved selections and refusal outcomes. All terminal processes exited normally and their enclosing groups stopped.

  • Bug: Known unavailable choices reached the session patch because terminal catalog rows dropped their availability.
  • Fix: Reuse canonical published facts, show a bounded reason and refuse the picker action before session mutation. Preserve available/unknown choices and older Gateway behavior; remove duplicate embedded discovery/filtering.
  • Checks: 45 focused cases and required CI run 34231957834, attempt 2, pass. The baseline refusal failed as intended. One runner-infrastructure retry and earlier test/setup failures remain recorded.
  • Review: The fresh exact-head local review judged the combined public and owner evidence sufficient, with zero findings or security concerns.
  • Limits: Public proof uses build 8ae96957 with product commit 9d5e480; 15b2ed0 changes only test fixtures. The clean behavior report supports the observed scenarios. Populated-history, replacement and lifetime guarantees use the separately reviewed owner/source evidence and bounded PR139880 reuse. No provider inference, native account, enabled-plugin or standalone-install claim.
Before After
A known unavailable picker choice sends a model patch. The visible choice gives login or cooldown guidance and returns before changing the session.
Embedded browsing keeps a separate discovery/filter path. Browsing projects the selected agent's published catalog while execution readers retain raw entries.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
Use canonical published model facts in the terminal picker and refuse known unavailable choices before session mutation. Preserve unknown and legacy choices, raw execution catalogs, selected-agent scope and prepared-owner lifetime.

Remove the embedded discovery/filter path and static publication override. Verified with the baseline regression, 45 focused cases, four compiled terminal scenarios, retained owner/history evidence and exact-head CI.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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