Skip to content

fix(desktop,agent): files panel button off a right-docked terminal; canonical run fold cache - #1602

Merged
huichen merged 4 commits into
mainfrom
pr/huichen
Nov 13, 2026
Merged

huichen merged 4 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two fixes that landed on dev-huichen after #1601: the desktop's collapsed files panel no longer draws its button and drawer over a right-docked terminal, and an agent run whose journal lives in the canonical stream tables now reports its epoch, so its fold cache is actually consulted.

Commits

  • fix(desktop): the files panel's button no longer lands on a right-docked terminal
  • fix(agent): keep the fold cache reachable for canonical runs

Verification

Self-test on a detached worktree at 957fc7ab5, Rust pinned to 1.99.1 per rust-toolchain.toml, ulimit -n 8192:

  • cargo fmt --all -- --check -> clean
  • cargo clippy -p future-agent --all-targets -- -D warnings -> clean
  • cargo test -p future-agent --lib session::journal_compaction -> 34 passed
  • desktop: npx tsc --noEmit -> clean; eslint on the three changed sources -> clean; npx vitest run src/components/layout/AppShell.test.tsx src/features/terminal -> 19 files / 373 tests passed
  • make check-docs -> 417 docs OK, 0 pairs pending bilingualization, provider matrix 13 rows OK

User-visible changes

  • Desktop layout: the collapsed files panel's toggle button and the panel's drawer are now anchored to the content column instead of the window. Before: with the terminal docked right, the button was drawn over the terminal's header next to its close control (measured at 1440x900: ~1232..1264 px); the drawer covered the terminal too. After: 972..1004 px, inside the conversation, and the drawer stops at the terminal's left edge. Revert f8d195bb6.
  • Opening a run: a run created since a conversation's journal was converted to the canonical stream tables now reports its epoch, so the fold cache from perf(agent): cache a run's folded snapshot beside its journal #1486 is consulted. Before: every open of a run no longer in the agent's memory re-folded the whole journal, the cost that cache was measured to remove (4.1 s -> 0.2 s on a 136k-event run, per perf(agent): cache a run's folded snapshot beside its journal #1486); after: cache hits again. Cache identity is unchanged, so a restart or fork that bumps the epoch is still a miss. Revert 78abb3abf.
  • No migration, no setting or default change, no API change.

Notes

The terminal-right screenshot scenario now asserts the gap between the collapsed files button and a right-docked terminal, so a regression fails the capture rather than needing a pair of eyes.

…ked terminal

Reported on the docked-right screenshot: the collapsed files panel's button (top
right of the conversation) was drawn over the terminal's own header, next to its
close control.

That button — and the panel's drawer — are absolutely positioned, and their
containing block was the shell root, i.e. the window. That was the same thing as
"the conversation's right edge" only while nothing else sat to the right of the
content column.

The right-docked terminal is now a sibling of that column instead of a child of
it, and the column itself is `relative`. The two affordances therefore resolve
against the column (conversation + files panel) and stop at the terminal's left
edge; the drawer stops there too, so it no longer covers the terminal either.

Measured at 1440×900: the column is 1020..1440 and the button 972..1004, so it
sits inside the conversation as intended (it used to be at ~1232..1264, on the
terminal's header). The `terminal-right` scenario now asserts that gap, so a
return of the overlap fails the capture instead of needing a pair of eyes.
`run_epoch` asked only `run_events`, but a converted conversation keeps its
journal in the canonical stream tables and writes no `run_events` row at all.
It therefore answered `None` for every run created since the conversion, and
`uncaptured_run_snapshot` — whose cache block is gated on `if let Some(epoch)`
— never consulted the fold cache added in #1486. Every open of a run no longer
in the agent's memory paid the whole fold again: the cost that cache was
measured to remove (4.1 s -> 0.2 s on a 136k-event run).

The epoch now comes from whichever store holds the run: the canonical stream
tables first (newest epoch; a retired stream is not a source), then the legacy
table, which is the shape `run_replay_watermark` already used for the same
question. The cache identity is unchanged — version, epoch and the stored
fold's own validation still decide a hit, so a restart or fork that bumps the
epoch is still a miss.

Test: a canonical run reports its epoch and hits its cached fold, and a newer
epoch on the same run invalidates it. Falsified against the previous
`run_epoch`, which returned `None` on the same fixture.
@huichen
huichen enabled auto-merge (squash) November 13, 2026 14:18
@huichen
huichen merged commit e9909f0 into main Nov 13, 2026
25 checks passed
@huichen
huichen deleted the pr/huichen branch November 13, 2026 14:51
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