Skip to content

fix(ui): reload projects after startup identity resolves - #133817

Merged
steipete merged 1 commit into
mainfrom
codex/workspace-catalog-reset
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/workspace-catalog-reset

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #133744 (workspace and worktree selection recovery).

What Problem This Solves

Fixes an issue where users opening New Session during sign-in could see registered projects disappear from the project picker and stay missing until reload or reconnect.

Why This Change Was Made

Late recovery-scope initialization clears the project catalogue without changing the connection. The catalogue owner now retires its existing Lit task when it resets, so the normal task lifecycle fetches the current catalogue and rejects old in-flight responses. This uses the existing discovery path and removes an obsolete comment about error-driven selection clearing.

User Impact

Registered projects remain available after sign-in completes. Ordinary reconnect failures still retain the last successful project selection, and existing workspace/worktree behavior is preserved.

Evidence

  • Live reproduction on f3607b1963dbc56fac01fe16eb6040fdbe62d653: a production Gateway and Chromium UI loaded the project catalogue, then lost it when a deliberately delayed recovery-scope digest completed. The registered project remained absent for the full assertion window.
  • Both new regression cases fail before the fix and pass afterward: already-loaded catalogue and a still-pending old response.
  • 41 focused tests passed: cd ui && node ../scripts/run-vitest.mjs run --config vitest.config.ts src/pages/new-session/draft-place-browser.test.ts src/pages/new-session/draft-place-state.test.ts src/pages/new-session/draft-persistence.test.ts.
  • Formatting, git diff --check, and independent Codex autoreview passed.
  • Production: +2/-1 (net +1, including the new invariant comment and removal of an obsolete comment). The one executable addition retires the lifecycle-owned request. Tests: +24/-0. Docs: one sentence added to the existing paragraph.
  • Exact-head live proof passed on abc8535bde44c844a8df1caa269b7508c8d95c27, using Blacksmith Testbox tbx_01m1b4m2jyemex936z8epkge2x (environment run): the same delayed-recovery-scope reproduction passes, plus seven production-UI sessions using a real OpenAI API key and openai/gpt-5.6-luna through the OpenClaw runtime. Each model read a unique filesystem fixture and wrote its marker in the correct workspace; provider calls went to https://api.openai.com/v1, with no mock provider or model fallback.
  • The live run covered plain directories, unborn repositories, committed repositories, and managed worktrees; three concurrent turns received the correct attachments after committed-draft reload. Submitted drafts stayed cleared. A managed-worktree turn returned the expected reply after ten Gateway restarts, preserving project/base/name/isolation and leaving the source checkout untouched.
  • Stress passed: 360 repository-discovery requests (concurrency 12), 120 direct session creations (concurrency 8), 12 managed-worktree creations (concurrency 4), and 30 UI transitions. No browser page errors.
  • Hosted CI: exact-head run, completed successfully on the reviewed head.

Proof scope: this exercises a real Gateway, production browser UI, local filesystem/Git, and real OpenAI requests. It does not claim live cloud-worker or Codex-runtime execution.

Before: registered projects disappear after startup identity resolution.

Project picker missing its registered projects

After: the same project catalogue is available after startup identity resolution.

Project picker retains registered projects after sign-in

@clawsweeper

clawsweeper Bot commented Aug 31, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 05:29
@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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 1:40 AM ET / 05:40 UTC.

ClawSweeper review

What this changes

The PR refreshes the New Session project catalog after startup identity resolution resets the project-picker owner, with a regression test and matching Control UI documentation.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The focused repair is correct: it invalidates the unchanged catalog task so startup identity resolution fetches projects again and rejects the prior response. This maintainer-labeled PR should remain open for normal maintainer handling while its exact-head CI completes.

Priority: P2
Reviewed head: abc8535bde44c844a8df1caa269b7508c8d95c27

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with a race-aware regression test and detailed supplied real-environment evidence; exact-head CI completion remains the operational merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies the author as a MEMBER, so external-contributor proof gating does not apply; nonetheless, the supplied PR body ties the changed project-catalog owner to an exact-head Testbox production Gateway and Chromium run with an observed post-fix retained catalog.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies the author as a MEMBER, so external-contributor proof gating does not apply; nonetheless, the supplied PR body ties the changed project-catalog owner to an exact-head Testbox production Gateway and Chromium run with an observed post-fix retained catalog.
Evidence reviewed 6 items Changed owner boundary: The project-catalog owner derives task arguments from the Gateway client, advertised method, and connection epoch; the introduced reset invalidates that task before clearing the visible catalog, allowing the unchanged normal inputs to run again after the update.
Caller and trigger: A changed recovery scope causes Gateway discovery invalidation; when the host selection is reset, DraftPlaceState calls resetProjects. This connects late identity resolution to the catalog owner rather than adding a parallel refresh path.
Regression coverage: The new table-driven test covers both a previously loaded catalog and an in-flight old response, then asserts that only the new catalog remains after the owner reset.
Findings None None.
Security None None.

How this fits together

The Control UI New Session page discovers registered Gateway projects before a user chooses a workspace or worktree. Identity resolution can reset that browser-side catalog owner without reconnecting, so the picker must obtain a new authoritative project list.

flowchart LR
  A[Gateway connection] --> B[Startup identity resolution]
  B --> C[New Session state reset]
  C --> D[Project catalog task]
  D --> E[Gateway project discovery]
  E --> F[Project picker]
  F --> G[Workspace or worktree session]
Loading

Before merge

  • Resolve merge risk (P1) - Six exact-head CI checks were still in progress in the supplied snapshot; merge should wait for the completed green rollup on the reviewed head.
  • Complete next step (P2) - The maintainer label and pending exact-head checks require normal maintainer merge handling; there is no concrete repair-lane task remaining.
Agent review details

Security

None.

PR surface

Source +1, Tests +24, Docs 0. Total +25 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 1 +1
Tests 1 24 0 +24
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 27 2 +25

Review metrics

Metric Value Why it matters
Production versus test delta production +1 net (2 added, 1 removed); tests +24; docs 0 net (1 line replaced) The sole executable production addition retires a stale lifecycle request; the larger test change covers the loaded and in-flight race states.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one catalog lifecycle owner: retire the stale task at reset, let its normal reactive inputs refetch the authoritative catalog, and merge after the exact reviewed head is green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one catalog lifecycle owner: retire the stale task at reset, let its normal reactive inputs refetch the authoritative catalog, and merge after the exact reviewed head is green.

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

No current-main run was performed in this read-only review, but the source establishes the reset path and the supplied exact-head evidence describes the production-browser reproduction. The package source for the directly used Lit task was not present locally, so confidence remains medium.

Is this the best way to solve the issue?

Yes. The patch repairs the lifecycle owner that clears the catalog and uses its existing discovery task, while the regression test covers stale results rather than introducing a second fetch mechanism.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded project-picker regression in the New Session web flow without evidence of data loss, a security boundary failure, or an availability outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies the author as a MEMBER, so external-contributor proof gating does not apply; nonetheless, the supplied PR body ties the changed project-catalog owner to an exact-head Testbox production Gateway and Chromium run with an observed post-fix retained catalog.

Label justifications:

  • P2: This repairs a bounded project-picker regression in the New Session web flow without evidence of data loss, a security boundary failure, or an availability outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies the author as a MEMBER, so external-contributor proof gating does not apply; nonetheless, the supplied PR body ties the changed project-catalog owner to an exact-head Testbox production Gateway and Chromium run with an observed post-fix retained catalog.

Evidence

What I checked:

  • Changed owner boundary: The project-catalog owner derives task arguments from the Gateway client, advertised method, and connection epoch; the introduced reset invalidates that task before clearing the visible catalog, allowing the unchanged normal inputs to run again after the update. (ui/src/pages/new-session/draft-place-browser.ts:341, abc8535bde44)
  • Caller and trigger: A changed recovery scope causes Gateway discovery invalidation; when the host selection is reset, DraftPlaceState calls resetProjects. This connects late identity resolution to the catalog owner rather than adding a parallel refresh path. (ui/src/pages/new-session/draft-gateway-state.ts:259, abc8535bde44)
  • Regression coverage: The new table-driven test covers both a previously loaded catalog and an in-flight old response, then asserts that only the new catalog remains after the owner reset. (ui/src/pages/new-session/draft-place-browser.test.ts:108, abc8535bde44)
  • Current-main comparison: The fetched current main revision retains the pre-fix reset implementation, while the verified test merge contains only this focused task invalidation and its associated test/docs change; the PR is not already implemented on main. (ui/src/pages/new-session/draft-place-browser.ts:339, f7f38bcc88a3)
  • Related merged work: The linked merged recovery repair is adjacent rather than a replacement: it preserves worktree details through reconnects, whereas this PR refreshes the project catalog after identity resolution. (ui/src/pages/new-session/draft-place-state.ts:362, d8d70cfbf04e)
  • Supplied real-environment evidence: The PR body identifies an exact-head Testbox run using a production Gateway and Chromium UI, with before/after screenshots and an observed successful delayed-recovery-scope scenario. The linked run and media could not be independently fetched in this read-only environment. (abc8535bde44)

Likely related people:

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

Rank-up moves

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

  • Wait for the remaining exact-head checks to complete green before merging.

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

Copy link
Copy Markdown
Contributor Author

Ready to land abc8535bde44c844a8df1caa269b7508c8d95c27. Exact-head CI completed successfully, satisfying ClawSweeper's remaining before-merge item and Rank-up move. No code findings remain; normal maintainer landing is proceeding through scripts/pr.

The changed owner and its caller were inspected directly, including the installed Lit Task implementation: run(args) replaces the previous arguments and advances the current call ID, so reset retires old responses and the next normal update refetches with the connected client. The loaded/pending regressions fail before the fix and pass after. All 41 focused tests and fresh independent Codex autoreview passed.

Exact-head production Gateway/Chromium proof passed in Blacksmith Testbox tbx_01m1b4m2jyemex936z8epkge2x (environment run): the original delayed-identity catalogue loss is repaired, seven real OpenAI sessions returned the expected fixture content and wrote to the correct workspaces, three simultaneous attachment turns survived committed-draft reload, and managed-worktree selection survived ten Gateway restarts. Stress also passed 360 Git-discovery requests, 120 direct creations, 12 worktree creations, and 30 UI transitions. Before/after screenshots are in the PR body. The isolated Gateway state and Testbox leases are cleaned up.

The focused command was cd ui && node ../scripts/run-vitest.mjs run --config vitest.config.ts src/pages/new-session/draft-place-browser.test.ts src/pages/new-session/draft-place-state.test.ts src/pages/new-session/draft-persistence.test.ts; production proof used freshly built qaRuntime plus the production UI and standalone real-Gateway browser drivers. Production delta is +1 net line; tests +24. No cloud-worker or Codex-runtime execution is claimed.

@steipete
steipete merged commit b4002e3 into main Aug 31, 2026
220 checks passed
@steipete
steipete deleted the codex/workspace-catalog-reset branch August 31, 2026 05:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 docs Improvements or additions to documentation 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: XS 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