Repository navigation
fix(app): use worktree inventory for session accents - #45506
Merged
Merged
Conversation
Hona
enabled auto-merge (squash)
August 27, 2026 06:56
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reproduction and Cause
sandboxesis empty from/api/project./api/worktree/{projectID}.Before this change, the button remains neutral.
useSessionModel().workspace.current()classified the session against raw client project metadata, which lacks the discovered workspace. Global sync already enriches project inventory with the worktree response, and the timeline already uses that inventory.The regression runs the production app route, client synchronization, session model, and composer against isolated API fixtures. Before the fix, the managed-worktree and live-inventory-update checks failed on the actual rendered button background; the local-root control passed. All pass with the fix.
Coverage
worktree.updatedevent refreshes the button without navigation or losing the draft.Validation
Run from
packages/appon Windows:bun run test:unit: 543 passed.bun run test:browser: 56 passed.bun test ./e2e/performance/unit: 48 passed.bun typecheckandbun run typecheck:e2e: passed.workspace-accent.spec.ts,composer-command-draft.spec.ts,new-session-workspace-branch.spec.ts, andprompt-thinking-level.spec.ts: 14 passed, one worker, no retries.git diff --check: passed. Scoped Oxlint: no errors; two pre-existingconsistent-returnwarnings on unchanged lines inmodel.ts.The test captures a fixture-only composer screenshot in its Playwright report. Before/after screenshots were inspected locally: neutral before, blue after. GitHub image upload was unavailable in this environment.
Performance
Production session-tab-switch benchmark, serial Chromium execution, three samples per scenario before and after. Baseline:
8252897a33. All 15 samples passed in each phase. No wrong-destination or unknown samples; no blank samples in cached scenarios.Median sampled DOM observation times, milliseconds:
No timing regression was observed in this small local sample; this is not a performance-improvement claim or a packaged Electron benchmark. Raw benchmark logs and observations were retained locally.
Evidence Limits
The installed
0.0.0-beta-18371message-bubble behavior is separate: its commit predates #45486. This PR does not duplicate that restoration or change the installed executable.Validation used the real production renderer with controlled API fixtures, not the installed desktop end to end. The installed frontend cache was not inspected, and stale frontend refresh or server corruption is not claimed as the cause. No existing desktop or OpenCode service restart was initiated for validation.
Requested by: @Hona (Hona via Slack)