Skip to content

fix(desktop): branch long sessions without loading the transcript in the renderer - #121239

Merged
OutThisLife merged 4 commits into
mainfrom
bb/desktop-branch-safe-load
Sep 24, 2026
Merged

OutThisLife merged 4 commits into
mainfrom
bb/desktop-branch-safe-load

Conversation

@OutThisLife

Copy link
Copy Markdown

Summary

Branching a long Desktop session loaded the whole parent transcript into the renderer twice, once to read it and once from the echoed branch response. That froze or crashed the window (#103139). With this change the backend that owns the parent copies the history, and the transcript never crosses the wire.

This carries forward @benjaminbrumbaugh's #103154, rebased onto main with the original commits and authorship kept. The contributor branch couldn't be updated because the fork's workflow files differ from main.

What changed

  • session.branch_stored (new): a whole-session branch of a stored parent. The gateway reads the parent from its own profile store, seeds the child and returns messages_omitted: true.
  • session.branch_whole (new): a whole-history session.branch of a live session that doesn't echo the transcript back.
  • Desktop calls the new methods and falls back to the old calls on an older gateway that answers "unknown method". Message-level branches (count) still use session.branch and get the full response.
  • On top of the salvage: main now validates params against tui_gateway/contracts and rejects unknown keys. The PR's copy_parent_history / omit_messages wire flags would therefore have failed with 4000. session.create and session.branch keep their wire shape. The two new methods have their own contracts (regenerated TS + OpenRPC), and the handlers take the behaviour as keyword arguments.

Tests

  • scripts/run_tests.sh tests/tui_gateway/: 2042 passed.
  • vitest use-session-actions.test.tsx: 110 passed.
  • tsc -p apps/desktop: clean.

Fixes #103139
Supersedes #103154

benjaminbrumbaugh and others added 4 commits September 24, 2026 03:47
Rebased onto main, where params are validated against tui_gateway/contracts
and unknown keys are rejected: the copy_parent_history / omit_messages flags
on session.create and session.branch now answered 4000. Keep both methods'
wire shape unchanged and give the two new methods their own contracts
(session.branch_stored, session.branch_whole) with messages_omitted results;
the handlers take the behaviour as keyword arguments, not wire flags.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 1e40a85 — fix(desktop): declare the branch methods in the typed gatewa

debug info

CI timings

CI timings · View report · View job

Wall time 5m48s vs 6m8s (-5.4%). 3 job(s) slower, 12 faster,

  • Check no committed infographics / check-no-committed-infographics: +218.0s
  • Python tests / Run tests: +39.0s
  • Python tests / e2e: -19.0s
  • OS-specific tests / macOS-only tests: -18.0s
  • Check no case-colliding filenames / check-case-collisions: -16.0s

@OutThisLife
OutThisLife enabled auto-merge (rebase) September 24, 2026 08:56
@OutThisLife
OutThisLife merged commit ecacf3d into main Sep 24, 2026
38 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-branch-safe-load branch September 24, 2026 08:57
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.

[Bug]: Desktop whole-session branching fails on oversized transcripts

2 participants