Skip to content

fix(startup): keep Git panels from blocking conversation restoration - #747

Merged
pascalandr merged 5 commits into
devfrom
fix/git-panel-startup
Sep 22, 2026
Merged

pascalandr merged 5 commits into
devfrom
fix/git-panel-startup

Conversation

@pascalandr

@pascalandr pascalandr commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Restore saved conversations promptly with the Git panel open. Preserve Solid project-shell identity during metadata and sibling-project restoration, defer inactive Git readers, and keep foreground message requests independent of secondary HTTP fan-out.

Publish the visible project's recent worktree conversations from its first verified page, before historical pagination completes. Promote project/location and worktree membership dependencies on selection; keep historical cursors and hidden projects within the secondary budget. Partial rows join their request's reconciliation baseline so removed worktrees cannot leave ghost conversations.

Run status/diff process creation in the existing Windows Git worker. Bound untracked-file stat submission and prioritize worktree authority commands over pending display work. Preserve UTF-8 content, final newlines and large blobs.

Lifecycle and refresh semantics

  • Cancel queued and dispatched optional SDK reads with a dispatch-time deadline.
  • Fence passive and explicit refresh/mutation continuations on worktree changes, deactivation and disposal.
  • Preserve commit drafts and the last successful status snapshot on failures.
  • Keep native ownership validation and 200-message windows; no new persistent transcript cache.

Gatekeeper

Independent review round 1 reported three findings: dispatched SDK cancellation, late explicit/mutation continuations, and worker admission behind untracked-file batches. All corrected.

Round 2: ZERO FINDINGS, with nine independent isolated source-level checks.

The visible-list extension received additional independent reviews. One finding about partial rows being mistaken for concurrent creations during worktree removal was fixed and regression-tested. Final review: ZERO FINDINGS, including isolated checks for membership removal, concurrent rename/local creation and deletion without resurrection.

Validation

  • 23 browser scenarios: restored selection and 200 messages with Git open on Electron/Tauri adapters, stable shell/draft lifetime, cancellation/deadlines and late commit handling. Both desktop adapters additionally verify partial cross-worktree publication under a blocked secondary budget, exclusion of foreign roots, selection promotion, and final removal of a no-longer-owned partial row.
  • Server Git status/content and common-directory/worker admission regressions.
  • 10 SDK/background/prioritized-read queue tests; 9 startup/reconnect store tests.
  • UI typecheck and production build; server TypeScript compilation.
  • Installed native verification with the usual profile: the final first-switch capture makes PR726 available in 2.04s after renderer navigation, then completes its first 200-message read 6.08s after selection, with no HTTP or renderer errors. Normal native restoration of PR726 earlier measured 5.064s, with variability up to 11.233s during concurrent activity. These are renderer timings, not executable-launch timings.
  • Restored the complete published e68ac52 server after a parallel installation had left older inventory modules. Installed server JavaScript artifacts match the compiled source; the shared daemon and user profile were preserved.

CI qualification

Compatibility migration CI fails on the unchanged historical credential assertion at scripts/test-opencode-history-migration.mjs:191: the latest upstream response adds method: "key". Runtime-contract qualification passes at minimum/latest; this failure is separate from the changed session/Git behavior and is not represented as a green check.

Existing large source files touched: packages/ui/src/components/instance/instance-shell2.tsx (~1308 lines), packages/ui/src/lib/api-client.ts (~597 lines), useGitChanges.ts (~519 lines), packages/ui/src/stores/instances.ts (~2197 lines), and packages/ui/src/stores/session-api.ts (~1898 lines).

…ation

Preserve project-tab record identity through metadata refreshes and sibling
restoration so Solid does not remount existing shells or discard commit drafts.
Reactive payload getters continue to expose refreshed instance and sidecar data.

Run Git display reads only for the visible panel, cancel queued reads and fence
late results on deactivation or disposal, and share the two-request secondary
HTTP budget with visible-panel priority ahead of bulk scans. Keep foreground
conversation reads independent and retain coalesced filesystem refreshes.

Move status and diff process creation off the Windows HTTP/SSE thread using the
existing Git worker. Preserve exact UTF-8 content, trailing newlines, large blobs
and accepted nonzero numstat exit codes without retaining completed snapshots.

Cover 200-message restoration with Git open on both host adapters, stable shell
and draft lifetime, cancelled queued/disposed reads, admission priority, and real
Git content. Verified with browser regressions, server Git tests, queue tests,
UI typecheck/build, server compilation and installed native startup captures.
Address all three independent gatekeeper findings. Propagate cancellation to the
optional SDK status transport and apply its deadline at dispatch so abandoned
requests cannot occupy the shared secondary slots indefinitely.

Fence explicit refresh and mutation continuations by panel generation and
worktree identity. Preserve a draft edited during commit, another worktree's
draft and the last successful status snapshot on failure. Late mutations still
invalidate filesystem display data without resetting the new panel context.

Bound untracked-file statistics submission to two operations and prioritize
worktree ownership/inventory Git commands over pending display commands. The
existing worker remains off the HTTP thread and retains its two-process budget.

Add real browser transport-abort and stale-continuation regressions, and a real
Git trace regression for authorization admission ahead of a display batch.
Twenty-one browser scenarios, Git regressions, UI build and server compilation
pass. Second independent gatekeeper review reports zero findings, including
nine isolated source-level checks of cancellation, drafts and worker admission.
@pascalandr
pascalandr marked this pull request as ready for review September 22, 2026 12:36
@pascalandr

Copy link
Copy Markdown
Contributor Author

Independent gatekeeper review

Reviewed source head: da6d22c8a324eecb4a277f8bb28817c9ed1c202d.

Round 1 found three concrete issues:

  1. Optional dispatched SDK status reads did not receive cancellation and could retain the shared HTTP slots.
  2. Explicit refresh and mutation continuations could launch diffs or reset another worktree's state after deactivation.
  3. Untracked-file numstat batches could delay worktree authorization in the shared worker FIFO.

All three were corrected. Round 2 independently reviewed the resulting source and reported ZERO FINDINGS. Nine isolated checks exercised real Solid reactivity, queues and worker scheduling, including an old-worktree commit completing after navigation to a valid new worktree and a 1,000-file untracked batch.

Validation

  • 21 browser scenarios passed, including 200-message restoration with Git open on both host adapters, actual SDK transport abort/deadline, explicit refresh cancellation, stable shells/drafts, and a late commit across worktrees.
  • Real Git status/content regressions passed; the 4-test common-directory suite passed, including authority admission ahead of a queued display batch.
  • UI typecheck/production build, server TypeScript compilation and scoped git diff --check passed.
  • Installed desktop investigation identified an older inventory module left by a concurrent installation, which still spawned three processes per checkout. Restored the complete published e68ac52 server and applied the reviewed patch. Every installed server JavaScript artifact now matches the compiled source.
  • Normal native relaunch restored PR726 directly in 5.064 seconds, Git selected, one 200-message request and no wrong selection or renderer error. The shared OpenCode daemon and saved profile were preserved.

CI qualification

Runtime-contract CI passes on minimum/latest. Compatibility migration CI currently fails on the unchanged historical credential assertion in scripts/test-opencode-history-migration.mjs:191: the latest OpenCode response now includes method: "key". This PR does not modify that script or credential handling. Do not interpret the gatekeeper verdict as a fully green CI run.

…l scans

The first selection of another-worktree conversation could be delayed until all
historical session pages and queued secondary Git/permission reads completed.
Promote the selected project's location and worktree membership dependencies
with reactive selection, keeping hidden projects within the two-read budget.

Publish the first verified project page additively beside the initial directory
page. Keep historical cursor traversal in the background and retain complete
inventory reconciliation as the authority for removing absent rows. Preserve
request-generation, cancellation, runtime-state and deletion fences; saved
transcripts continue to request 200 messages independently.

Exercise both desktop adapters with both secondary slots held indefinitely:
recent linked-worktree rows publish, foreign roots are excluded, historical
cursors stay queued, and selecting another project promotes its dependencies.
Correct a pre-existing SDK queue regression test that awaited the secondary
model catalogue before releasing the very slots it needs.

Validate with the 23 browser restoration/Git scenarios, 10 SDK/queue checks,
UI typecheck and production build, and native installed-profile captures.
…tion

Adopt newly inserted partial-page rows into this request's reconciliation
baseline. Otherwise a worktree removed before historical pagination finishes
leaves its sessions misclassified as concurrent local creations and retained
after the complete membership filter excludes them.

Only adopt rows absent from the live session map before this request inserts
them. Preserve genuine concurrent local/SSE additions and newer runtime state.
Extend both desktop browser regressions with a worktree disappearing between
partial publication and final reconciliation while historical reads are blocked.

The regression passes on Electron and Tauri. Independent gatekeeper verification
reports zero findings after testing removal from list/store, concurrent rename,
local creation and deletion without resurrection. UI typecheck/build and nine
startup/reconnect store tests pass. Installed-profile verification displays PR726
in 2.04s and completes its first 200-message read 6.08s after selection without
HTTP or renderer errors.
…ture

The isolated tab chrome fixture mounts RightPanel directly and must provide its
new required isActive accessor, just like both production shell mounts. Without
it the fixture throws before rendering tabs, so four scrollbar, keyboard, drag
and touch regressions time out rather than testing the intended UI behavior.

Keep the fixture explicitly visible and retain all existing gesture and geometry
assertions. This changes no production behavior.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Final gatekeeper and CI disposition

Final reviewed head: 3657b556dd5f292d2b82a6d2cbf2a2741919003b.

Independent gatekeeper verdict: ZERO FINDINGS after correcting all findings, including partial-page reconciliation. The final isolated tab fixture now provides the required visible-panel accessor; all four tab chrome browser regressions pass locally (zoom/DPI/RTL, wheel/keyboard/resize, pointer reorder and touch). The optional Electron fixture was skipped in that invocation.

The full CI run 35731699196 was not green. Disposition:

  1. Four tab-chrome timeouts were caused by the missing fixture accessor introduced with this PR's required lifecycle contract. Fixed in the final commit and independently reviewed.
  2. Two system-messages.test.ts search timeouts were reproduced on an unmodified archive of base commit e68ac524, using the same dependencies. Exact same assertions fail at lines 105 and 122. Evidence: isolated baseline under the approved temporary directory; no live sessions or daemon were used for these tests.
  3. Latest-runtime contract, pruning and migration jobs failed before native execution because the optional platform CLI binary was missing after @opencode/cli@latest installation (ENOENT / command not found). Minimum-runtime contracts and Windows/macOS Tauri jobs passed. An earlier run instead reached the already documented historical credential shape assertion; neither issue is caused by this patch.

Change-specific validation: 23 restoration/Git browser scenarios, 4 tab-chrome scenarios, 10 SDK/queue checks, 9 startup/reconnect store checks, server Git regressions, UI typecheck/build and server compilation. Final native first-switch capture: PR726 available in 2.04s, first 200-message response complete 6.08s after selection, no HTTP/renderer error. Actual project tabs and model menu verified in the usual installed profile.

Proceeding with the user-requested administrator merge with these explicit CI exceptions. This is not a claim that the entire repository test suite passes.

@pascalandr
pascalandr merged commit ac7129d into dev Sep 22, 2026
9 of 14 checks passed
@pascalandr
pascalandr deleted the fix/git-panel-startup branch September 22, 2026 13:31
pascalandr added a commit to pascalandr/CodeNomad that referenced this pull request Sep 22, 2026
Integrate upstream PR NeuralNomadsAI#747 so the plugin-controls branch remains based on the current dev head before final qualification.

Preserve the independent V2 plugin controls, visibility gating, worktree-scoped cache, native Windows path handling, and separate Global and Project indicators while incorporating upstream Git-panel startup restoration changes.

Upstream PR NeuralNomadsAI#747 documents the same current CI baseline failures: two system-message browser timeouts and the additive OpenCode latest credential method field in migration compatibility.

# Conflicts:
#	packages/ui/tests/browser/fixtures/tab-chrome.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant