Skip to content

fix(system-agent): avoid TUI startup catalog preparation - #113136

Merged
steipete merged 3 commits into
openclaw:mainfrom
eugene-harold-krabs:fix/tui-startup-catalog-snapshot
Jul 29, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
eugene-harold-krabs:fix/tui-startup-catalog-snapshot

Conversation

@eugene-harold-krabs

Copy link
Copy Markdown
Contributor

What Problem This Solves

PR #108287 is blocked by a recurring checks-node-compact-large-5 timeout in src/system-agent/tui-backend.test.ts at runs OpenClaw inside the shared TUI shell. The failure repeats after the unrelated release-maintainer regression was removed from main, so this is now the active upstream blocker for GitLab work item https://gitlab.com/xrow-public/helm-openclaw/-/work_items/47.

The TUI route has already been verified before requireTuiVerifiedInference runs. Loading the prepared model catalog again during TUI startup can add filesystem-backed catalog discovery work to this hot path. The startup path only needs catalog metadata for thinking-default resolution, so this changes it to read the existing prepared catalog snapshot instead of loading/preparing the catalog again.

Evidence

I could not run the focused Vitest test locally because this isolated workspace volume is full and package installation hit ERR_PNPM_ENOSPC; CI should provide the meaningful validation for this branch.

Related blocker: https://gitlab.com/xrow-public/helm-openclaw/-/work_items/47

@eugene-harold-krabs
eugene-harold-krabs force-pushed the fix/tui-startup-catalog-snapshot branch 6 times, most recently from 6c99643 to 39827ec Compare July 23, 2026 21:17
@eugene-harold-krabs
eugene-harold-krabs force-pushed the fix/tui-startup-catalog-snapshot branch 8 times, most recently from c1cb6ce to 9486fd7 Compare July 24, 2026 00:46
@eugene-harold-krabs

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@eugene-harold-krabs
eugene-harold-krabs force-pushed the fix/tui-startup-catalog-snapshot branch from 9486fd7 to d8046fa Compare July 24, 2026 04:15
@eugene-harold-krabs
eugene-harold-krabs force-pushed the fix/tui-startup-catalog-snapshot branch from d8046fa to b3e3e37 Compare July 24, 2026 04:50
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 6:51 PM ET / 22:51 UTC.

ClawSweeper review

What this changes

Changes system-agent TUI startup to use an already prepared model-catalog snapshot for optional thinking-default label resolution instead of preparing/loading the catalog again.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

The patch is a focused, plausible repair for duplicated prepared-catalog work on the verified TUI inference path, and its target CI shard passed. It should remain open for a clean-base refresh and real after-fix behavior evidence rather than be closed or replaced.

Priority: P2
Reviewed head: b3e3e377be59523598e7beb411c27a087e53b412

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is narrowly scoped and has successful CI, but merge-gating real behavior proof is still absent.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The target CI shard passed, but the supplied proof is a mocked test and static diff check rather than an after-fix run showing the verified TUI startup path. Add redacted terminal output, logs, or a recording of that run after rebasing; update the PR body to trigger a fresh review, or ask a maintainer to comment @clawsweeper re-review if needed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The target CI shard passed, but the supplied proof is a mocked test and static diff check rather than an after-fix run showing the verified TUI startup path. Add redacted terminal output, logs, or a recording of that run after rebasing; update the PR body to trigger a fresh review, or ask a maintainer to comment @clawsweeper re-review if needed.
Evidence reviewed 4 items Focused runtime change: The proposed TUI path replaces an awaited catalog preparation call with a lookup of the prepared snapshot and treats absent snapshot metadata as optional, matching the nearby comment that catalog metadata must not become a startup dependency after route verification.
Boundary test update: The test mock now supplies an undefined catalog snapshot while retaining the catalog-loader mock, covering the intended no-snapshot startup path at the TUI boundary.
Target CI result: The supplied check state reports success for checks-node-compact-large-5, the shard that previously timed out in the shared-TUI-shell test named in the PR body.
Findings None None.
Security None None.

How this fits together

The system-agent TUI starts an interactive OpenClaw session after resolving a verified inference route. That route supplies model and agent details to the TUI, where optional prepared-catalog metadata improves the displayed thinking default without needing to perform new catalog discovery.

flowchart LR
  A[OpenClaw TUI startup] --> B[Verified inference route]
  B --> C[Prepared catalog snapshot]
  C --> D[Optional thinking metadata]
  B --> E[Model selection]
  D --> F[Interactive TUI session]
  E --> F
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The target CI shard passed, but the supplied proof is a mocked test and static diff check rather than an after-fix run showing the verified TUI startup path. Add redacted terminal output, logs, or a recording of that run after rebasing; update the PR body to trigger a fresh review, or ask a maintainer to comment @clawsweeper re-review if needed.
  • Resolve merge risk (P2) - The branch is behind current main; refresh the merge result and rerun the focused TUI path so the timeout improvement is shown against the current base.
  • Resolve merge risk (P1) - The supplied evidence is CI and mocked test coverage, not an after-fix run demonstrating that verified TUI startup avoids the extra catalog-preparation work.
  • Complete next step (P2) - The remaining merge blocker is contributor-provided real behavior proof and a current-base refresh, not a concrete mechanical repair for an automated fix lane.
Agent review details

Security

None.

PR surface

Source 0, Tests -3. Total -3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 1 4 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 7 -3

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the snapshot-only lookup, rebase onto current main, and add redacted after-fix terminal or runtime output showing verified TUI startup completes without catalog preparation before merging.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the snapshot-only lookup, rebase onto current main, and add redacted after-fix terminal or runtime output showing verified TUI startup completes without catalog preparation before merging.

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

No high-confidence current-main reproduction was independently established. The PR identifies a concrete shared-TUI-shell timeout and the changed source path explains how duplicate catalog preparation can contribute, but the supplied evidence does not include a fresh failing run on current main.

Is this the best way to solve the issue?

Yes, provisionally. Reading an existing prepared snapshot preserves catalog metadata as an optional label enhancement while removing filesystem-backed preparation from an already verified startup route; the remaining requirement is runtime proof on the refreshed base.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded system-agent startup and CI-timeout repair with limited user-facing blast radius, but it can block dependent contribution work.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The target CI shard passed, but the supplied proof is a mocked test and static diff check rather than an after-fix run showing the verified TUI startup path. Add redacted terminal output, logs, or a recording of that run after rebasing; update the PR body to trigger a fresh review, or ask a maintainer to comment @clawsweeper re-review if needed.

Label justifications:

  • P2: This is a bounded system-agent startup and CI-timeout repair with limited user-facing blast radius, but it can block dependent contribution work.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The target CI shard passed, but the supplied proof is a mocked test and static diff check rather than an after-fix run showing the verified TUI startup path. Add redacted terminal output, logs, or a recording of that run after rebasing; update the PR body to trigger a fresh review, or ask a maintainer to comment @clawsweeper re-review if needed.

Evidence

What I checked:

  • Focused runtime change: The proposed TUI path replaces an awaited catalog preparation call with a lookup of the prepared snapshot and treats absent snapshot metadata as optional, matching the nearby comment that catalog metadata must not become a startup dependency after route verification. (src/system-agent/tui-backend.ts:503, b3e3e377be59)
  • Boundary test update: The test mock now supplies an undefined catalog snapshot while retaining the catalog-loader mock, covering the intended no-snapshot startup path at the TUI boundary. (src/system-agent/tui-backend.test.ts:16, b3e3e377be59)
  • Target CI result: The supplied check state reports success for checks-node-compact-large-5, the shard that previously timed out in the shared-TUI-shell test named in the PR body. (src/system-agent/tui-backend.test.ts:1, b3e3e377be59)
  • Related work is distinct: The linked SQLite PR is an upstream consumer blocked by the timeout; its shared-WAL safety override is not the same system-agent behavior and does not supersede this PR. (9fbe83822bfc)

Likely related people:

  • eugene-harold-krabs: The supplied PR history identifies this contributor as the author of both commits and of the timeout investigation; no independent current-main feature-history attribution was available in the review evidence. (role: current patch author and failure reporter; confidence: low; commits: c4eb17b0b3eb, b3e3e377be59; files: src/system-agent/tui-backend.ts, src/system-agent/tui-backend.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and provide redacted terminal or runtime output showing the shared TUI shell completes without catalog preparation.
  • Keep the proof focused on the changed startup path; redact local paths, endpoints, tokens, and other private details.

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.

@steipete
steipete merged commit 198e702 into openclaw:main Jul 29, 2026
194 of 200 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main: (100 commits)
  fix(hooks): kill gog process tree on gmail-watcher shutdown (#112452)
  fix(memory): avoid phantom continuation pages (#115722)
  fix(agents): reject cancelled foreground commands (#115694)
  fix(telegram): prevent false empty replies after message-tool delivery (#115588)
  refactor: unify session cost rollup scans (#115749)
  fix(agents): honor completed semantic command exits (#115737)
  feat(agents): persist last-used session model as the agent default (#115717)
  feat(openai): support GPT-Live over backend WebSocket (#115622)
  fix(ui): unify sidebar thread density (#115646)
  feat(ui): path-based agent and panel URLs on Settings > Agents (#115673)
  feat(gateway): serve HTTP byte ranges on media routes (#115667)
  refactor: consolidate Teams and Zoom meeting plugin shells (#115707)
  fix(browser): release unread CDP response streams (#115675)
  feat(ui): move settings save feedback into the sidebar footer (#115679)
  fix(plugins): enforce hook security invariants (#115701)
  refactor: deduplicate extension normalization primitives (#115650)
  feat(gateway): add least-privilege voice-node pairing (#115712)
  fix(ui): restore in-flight assistant replies after reconnect (#115691)
  fix(whatsapp): infer native media from filenames (#115725)
  fix(system-agent): avoid TUI startup catalog preparation (#113136)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…3136)

* fix(system-agent): avoid TUI startup catalog preparation

* test(system-agent): mock prepared catalog snapshot

* test(system-agent): prove nonblocking setup catalog startup

---------

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

P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants