Skip to content

perf(gui): share gRPC channel, batch polls, sync names, fix Win tests & build-gui - #44

Merged
huichen merged 4 commits into
mainfrom
fix/gui-channel-poison-and-rename-sync
Jul 26, 2026
Merged

huichen merged 4 commits into
mainfrom
fix/gui-channel-poison-and-rename-sync

Conversation

@huichen

@huichen huichen commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator
  • gRPC channel: cache single HTTP/2 connection (OnceCell + health check)
    instead of per-call TCP connect/teardown; pin channel driver on a
    process-lifetime runtime so it survives throwaway startup threads
    (fixes "Service was not ready: transport error" at startup).
  • useAsyncResource: silent reload on poll ticks, skip re-render when
    data unchanged (optional isEqual comparator).
  • Thread store: shallow-compare guards on streaming + run status
    setStates; replace N x listRuns fan-out with single batch
    list_latest_run_infos.
  • Fix 3 Windows test failures: NUL excludesFile in shadow review,
    platform-aware path asserts in preview-link & markdown-refs tests.
  • Converge GUI DB title toward the agent session_name (TUI /name
    never wrote the GUI DB, causing "name reverts after restart"):
    sync_thread_title (no updated_at bump), on-poll sync in
    get_thread_agent_state, and startup-import sync.
  • Makefile: build-gui now produces standalone futureos.exe
    (build-gui-dist preserves the old frontend-only pass for check-gui),
    gui-sidecars target deduplicates binary copy in install-gui.

huichen added 4 commits July 26, 2026 20:17
… & build-gui

- gRPC channel: cache single HTTP/2 connection (OnceCell + health check)
  instead of per-call TCP connect/teardown; pin channel driver on a
  process-lifetime runtime so it survives throwaway startup threads
  (fixes "Service was not ready: transport error" at startup).
- useAsyncResource: silent reload on poll ticks, skip re-render when
  data unchanged (optional isEqual comparator).
- Thread store: shallow-compare guards on streaming + run status
  setStates; replace N x listRuns fan-out with single batch
  list_latest_run_infos.
- Fix 3 Windows test failures: NUL excludesFile in shadow review,
  platform-aware path asserts in preview-link & markdown-refs tests.
- Converge GUI DB title toward the agent session_name (TUI /name
  never wrote the GUI DB, causing "name reverts after restart"):
  sync_thread_title (no updated_at bump), on-poll sync in
  get_thread_agent_state, and startup-import sync.
- Makefile: build-gui now produces standalone futureos.exe
  (build-gui-dist preserves the old frontend-only pass for check-gui),
  gui-sidecars target deduplicates binary copy in install-gui.
…ename

Follow-up to the previous commit's review findings:

- useAsyncResource: depsChanged was computed via useMemo keyed on `deps`,
  which only recomputes when deps change — so it could never observe an
  unchanged-deps poll tick and stayed `true` forever, flipping `loading`
  on every 1.5s approvals poll. Compute it on every render against the
  deps snapshotted by the last effect run; poll ticks are now truly
  silent (no setLoading, no re-render when isEqual also dedups data).
- Down-agent tolerance: with the shared lazy channel, connect_agent
  succeeds even when the agent dies afterwards, so transport failures
  surfaced as plain string errors and the AgentUnavailable matchers
  stopped firing. New map_rpc_error() classifies tonic Unavailable as
  AgentUnavailable; applied to abort_agent_thread (local run cancel
  works again when the agent is down) and reload_agent_credentials
  (restores "down agent is success").
- rename_thread is now all-or-nothing: propagate to the agent FIRST and
  only persist the DB rename on success. A local-only rename would be
  silently reverted by the new title sync once the agent came back.
  "session not found" stays a benign case (no agent session → nothing
  can sync a stale name back).
- tokio: explicitly enable rt-multi-thread (used by the pinned channel
  runtime; previously only enabled transitively via tauri).
- Fix 2 ESLint errors + 1 jsdoc warning introduced by the previous
  commit (comma-dangle, arrow-parens, no-multi-asterisks) that broke
  `make lint-gui` / `check-gui`.
@huichen
huichen merged commit 2f4adbd into main Jul 26, 2026
16 checks passed
@huichen
huichen deleted the fix/gui-channel-poison-and-rename-sync branch July 26, 2026 13:17
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