Skip to content

perf(tui,agent): io off the frame path, git-log lanes; fork chips and picker, palette trims, /rename - #1436

Merged
huichen merged 78 commits into
mainfrom
pr/huichen
Oct 30, 2026
Merged

huichen merged 78 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

The TUI stops making the reader wait: the event loop no longer blocks on io, the git panel grows into a real log view, and a transcript scroll becomes one region scroll instead of a whole-band repaint. Around that, the palette keeps only the verbs with no other door, each message gains the desktop's copy and fork controls with one branch chip under the newest reply, and a session can be exported as one readable HTML file. Latest additions: goal workers inherit the supervisor's model and thinking, the clipboard reads on alt+v where Windows owns ctrl+v, and the paging loop is reached through one async state machine instead of two (the fix for the Windows host-remote stack overflow below).

Commits

  • feat(tui,agent): /fork is the only road to a branch, and it lists answers too
  • perf(tui): the loop stops waiting for the listing, the page above, and git
  • perf(tui): read the two conversations beside the cursor ahead of the step
  • perf(tui): open a conversation on its last three exchanges, not its last ten
  • feat(tui): draw the git log's lane graph one commit per row
  • feat(tui): read the git log by date-time, committer, lanes, subject
  • feat(tui): lead a git log row with the refs, then the subject
  • perf(agent,tui): bound a history page by rows and bytes, not by exchanges alone
  • refactor(tui): drop the reduce-motion preference and always animate
  • feat(tui): keep a git log row as tight as its own lanes
  • refactor(tui): drop the /transcript palette verb
  • fix(tui): list the palette's skills alphabetically
  • fix(tui): a blank row between a thought marker and the answer
  • refactor(tui): list only the verbs with no other door in the palette
  • docs(agent,rpc): write down the two page-boundary decisions, so they are not undone
  • refactor(tui): list the command palette alphabetically
  • feat(tui): the attachment count opens the draft's picture; drop /preview
  • refactor(tui): drop the /providers command
  • refactor(tui): drop the /tree session tree and the /sandbox alias
  • feat(agent): export a session as one readable HTML file
  • feat(tui): align the git log's refs column, and drop lanes that carry nothing
  • feat(tui): rename a conversation with /rename
  • perf(tui): a transcript scroll is one region scroll, not a whole-band repaint
  • feat(tui): copy and fork controls under each message, like the desktop
  • refactor(tui): drop the /history verb, ctrl+r holds the session list
  • test(tui): a wrapped line proves the scroll band is measured in physical rows
  • fix(tui): drop the stale tree audit page and fail fast on one
  • feat(tui): a git log branch hangs off the cell the last one left
  • feat(tui): name the git log's nodes the way tig does, o and M
  • fix(tui): reply-only controls, a blank line above them, and a fork that keeps the answer
  • perf(tui): read the branch out of .git/HEAD instead of spawning git
  • fix(tui): one branch chip under the newest reply, not one under every turn
  • feat(desktop,mobile): the transcript's up/down pair lands on prompts only
  • test(tui): assert the fork chip's refusal in the run's own language
  • fix(tui): read the clipboard on alt+v on Windows, where the console owns ctrl+v
  • feat(goal): workers inherit the supervisor's model/thinking, and every run records which case applied
  • chore(skills): bump the skills submodule to f153e3c (worker-config inheritance)
  • perf(rpc): reach the paging loop through one state machine, not two

Verification

At 230c88146 (the first 34 commits), in the main checkout, rustc/clippy 1.99.1 from ~/.rustup (the Homebrew 1.96 that shadows PATH is not what CI uses), ulimit -n 8192:

  • cargo fmt --all -- --check -> clean
  • cargo check -p future-rpc -> clean (29s)
  • cargo clippy -p future-tui -p future-agent --all-targets -- -D warnings -> clean (1m17s)
  • cargo test -p future-tui --lib -> 1651 passed, 0 failed, 4 ignored (13.7s)
  • cargo test -p future-tui --test i18n_guard -> 8 passed
  • cargo test -p future-agent --lib -> 2784 passed, 0 failed, 5 ignored (300.7s)

At 60daf638e, for the four commits added since (rpc paging, goal worker config, Windows clipboard, skills pointer):

  • cargo fmt --all -- --check -> clean
  • cargo clippy -p future-rpc -p future-host -p future-agent -p future-tui -p future-cli --all-targets -- -D warnings -> clean
  • cargo test -p future-rpc --lib -> 240 passed
  • cargo test -p future-host --lib remote -> 599 passed, 9 ignored

Earlier passes at this branch's earlier heads also ran make check-docs (369 docs), cargo test -p future-rpc --lib and the desktop/mobile tsc --noEmit + jest/vitest suites green; the remaining jobs are CI's.

Notes

  • The first frame after selecting a conversation now shows fewer exchanges above the cursor (three, read ahead of the step), and the agent bounds a history page by rows and bytes.
  • reduce-motion is removed from the preferences box: the interface always animates.
  • The git panel's row layout changes shape (refs, date-time, committer, lanes, subject as columns).
  • /transcript, /preview, /providers, /tree, /history and the /sandbox alias are gone; ctrl+r holds the session list, the attachment count opens the draft's picture, and /rename names a conversation.
  • A message now carries the desktop's copy and fork controls; only the newest reply shows the branch chip.
  • A session can be exported as one self-contained HTML file from the agent side.
  • On Windows the clipboard is read with alt+v, because the console owns ctrl+v there; macOS and Linux keep ctrl+v.
  • Goal workers now inherit the supervisor's model and thinking, and each run records which inheritance case applied.

Scroll repaint: one region scroll instead of the whole band

Scrolling moved every row in the transcript band, so the row-by-row diff rewrote all of them. The frame cache now recognises a frame that is the one on screen scrolled up inside the transcript's band and sends one region scroll plus the rows that came in:

\x1b[?25l \x1b[3;38r \x1b[1S \x1b[0m \x1b[38;1H \x1b[K <the new line> \x1b[r \x1b[0m

Measured in-process at 180 columns with a 36-row band: a one-line scroll goes from 8067 bytes to 248 (one CSI 1 S), ten lines from 8067 to 2265 (one CSI 10 S).

Windows host-remote: diagnosed and fixed in this branch

Rust Windows test / host-remote aborted the future-host lib test binary with STATUS_STACK_OVERFLOW on a tokio worker on four consecutive heads of this branch, while the Linux and macOS counterparts and main itself stayed green. It was not the runner, and not host/ (byte-identical to main): this branch added one more async layer to the host's history-read path.

packages/rpc/src/history.rs's read_page differed from read_page_from only by a constant (ExchangeStart::Complete), but being an async fn it brought its own state machine. Making it a plain fn that returns the inner future removes that layer.

Measured with a temporary probe on the process-wide tokio runtime's thread_stack_size (arm64 debug, 8 KiB steps, bisecting the smallest stack that lets remote::commands::bridge_tests finish):

Code Minimum worker stack
Branch before the fix 2017280 B (1970 KiB)
After the fix 1937408 B (1892 KiB, i.e. main's value)

An lldb frame-pointer walk at the overflow moment showed the chain: DesktopHost::execute (359 KiB frame) -> remote_host::business::execute (333 KiB) -> history::execute (90 KiB) -> get_session_entries_before* (~50 KiB x2) -> read_page -> read_page_from. That chain used 92% of the 2 MiB worker stack in debug, and MSVC debug frames are wider than arm64's, so main just fit and this branch overflowed. Pushing the probe's stack down to 1952 KiB (below the 1970 KiB pre-fix threshold) keeps the whole remote suite green, which is the end-to-end proof that the 78 KiB came back.

Remaining risk, deliberately out of scope here: the chain still runs close to the ceiling, because Box::pin(async move { ... }) materialises the whole business dispatch state machine on the stack (DesktopHost::execute and business::execute each take 330-360 KiB). Giving it real headroom means splitting those match arms into their own async fns in a separate host refactor.

Windows agent: pre-existing shutdown-deadline flake, not this branch

Rust Windows test / agent failed service::tests::a_storage_failure_while_persisting_cancelled_runs_is_reported with Agent shutdown deadline exceeded during runs and native background work; instance ownership retained. agent/src/service/ is byte-identical to main here, so this is a shutdown-deadline flake on a loaded runner and is answered with a rerun, not a code change.

Branch hygiene

origin/main (57259b67a) was merged into the frozen PR head at 3dfef3214 to clear BEHIND; the merge was conflict-free and deletes no file that main carries. dev-huichen (tip 60daf638e) is fully contained in this PR: nothing new landed on the integration branch while it was open.

huichen and others added 17 commits October 30, 2026 09:32
…d git

Three doors still awaited their read inside the driver's loop, so the rail, a
streaming reply and the keyboard stopped for the whole of it — the same defect
the switch had, at less frequent doors. All three now start their read and let
the loop's own arm install the answer (`workbench::live::Loaded`), with the
answer dropped when the reader has moved on.

Measured on this branch (release, 300 ms mock agent for the two agent reads, the
real repository for `git`), loop time per door:

  turn boundary, listing      311.6 ms → 0.021 ms   (real: 26–50 ms warm, 10 s cold)
  turn boundary, state        309.2 ms → 0.006 ms   (real: 25 ms)
  scroll up a page            308.5 ms → 0.004 ms   (real: 38–285 ms first read)
  /git panel                  132–287 ms → 0.061 ms (this repository)

and the work that moved off the loop costs the same as before when it lands
(state 0.007 ms, page 0.021 ms to install).

* **turn boundary** — `refresh_state().await` + `refresh_sessions().await` became
  `begin_state_refresh()` + `begin_sessions_refresh()`; the listing already had a
  started-not-awaited form for the rail's clock, and the state now has one too
  (one out at a time, and a failed read still frees the slot, so a decode error
  cannot wedge the footer for the rest of the session). The approval overlay a
  state answer can open is decided where the answer lands.
* **the page above the transcript** — `Loaded::Older` carries the window it
  answers (`session_id`, `next_offset`), and `install_older` drops a page for a
  window the transcript has left instead of prepending rows that do not sit on
  it. `WbAction::LoadOlder` keeps its waiting form only for a surface with no
  driver.
* **`/git`** — the read already ran on a blocking thread; the loop waited for it
  anyway. `begin_git_read` starts it and a generation counter drops a view read
  for a tab the reader has already left, so opening, tab-switching and
  narrowing the filter all keep the surface live.

The three `/refresh`, `/history`, `/tree` verbs took the same treatment: they
re-read the listing and the state, and none of them needs to hold the screen
while it does.
…step

Stepping between conversations still costs the page read of the one landed on —
and on this store that is not small: measured through the real gRPC path at a
300 ms reading cadence, a conversation the agent has not served recently takes
120 ms at the median (225.8 ms for the worst of six, 13.8 ms for the best).

The rail makes the next step's destination predictable, so the driver now reads
the conversations either side of the cursor in the background as soon as a step
settles (`warm_neighbours` → `Live::prefetch_page`). Nothing is installed — the
answer is thrown away on purpose, because the agent keeps the page it
materialized, keyed by the conversation's revision. Measured the same way:

  cold step      120.0 ms median (13.8–225.8 ms, n=6)
  warmed step     18.1 ms median (7.4–61.9 ms, n=6)

per step, same conversations' size mix, alternate conversations, both arms paced
at 300 ms. What is left on a warmed step is the payload itself (a 1099-row page
is still 61.9 ms over the socket), which is the transport, not this.

A prefetch costs the agent one page read off the loop; a conversation the reader
never opens costs exactly that and nothing else, and a page whose conversation
moved on since is keyed by a newer revision and simply read again when opened. A
click warms nothing: it is not the start of a walk.
…ast ten

A switch reads the conversation's tail page before the reader can see anything,
and that page was ten exchanges. Three is what a reader needs when a
conversation opens; the rest is a scroll away, where each page-up reads ten
(`session_older_page` keeps that size: a deliberate page has a screen of reading
in front of it).

Measured on this machine's store through the real gRPC path, every conversation
read once at each size with the order alternating (so the OS file cache warms one
arm and one arm only — the bias runs against the change, not for it):

  3 exchanges   33.7 ms median (4.2–310.8 ms, n=8)
  10 exchanges  49.3 ms median (3.5–254.0 ms, n=8)

per conversation, where it bites at all, it also ships a third of the rows:
193 → 62, 66 → 26, 124 → 82.

It does **not** help a conversation whose history is one or two huge turns: there
three exchanges already is the whole transcript (541 rows, 310 ms either way),
because a page is bounded by the entries in it and not by how many turns they
belong to. That case needs a page bounded by rows — an agent-side change, kept
for its own round with its own numbers.
`/git` showed `git log --graph`'s own drawing: a commit's row plus the
connections below it as further lines (`|\`, `|/`), so most of the pane was
rows with no commit on them and every lane swap was a diagonal. On this
repository the first 60 commits printed as 102 lines, 42 of them bare drawing.

The panel now lays the graph out itself, in tig's shape:

* one row per commit — the cursor, the detail pane and the reader all work on
  the same rows, and no row is a drawing;
* verticals and elbows (`┐ ┘ ├ ┤ ┬ ┴ ┼`) only, never a diagonal, because a
  diagonal says two lanes crossed where they in fact join;
* a lane keeps its column: a new parent takes a free column to the right of the
  commit and only appends when there is none, so opening a branch never shifts
  (or recolours, since colour is the column) the lanes beside it;
* every gutters share one width, so the subjects line up in one column.

The read is now `--topo-order`, in both the all-refs log and a filtered one: a
parent never precedes a child, and a line of work reads as one stretch instead
of being interleaved with every other branch's dated commits, which is what
lets a lane run from a branch's tip to where it joins. Parents are matched on
full ids (`%H`/`%P`), so an abbreviation length that changes mid-log cannot
break a lane. A parent past the page keeps its column as a ghost line, which
says "the history continues" instead of handing that column to another branch.

The demo log is written as the read's own text and parsed by its own parser, so
a frame cannot show a graph the panel would never draw.
The log's row led with the subject and ended with the hash, the date and the
author — the order that served a graph nobody could align, and the width spent
on a hash the detail pane beside it already prints in full.

Rows now read left to right as tig's do:

    2026-10-30 10:12  chenhui    │ ●─┐  Merge branch 'perf/tail-page-3' …

* `2026-10-30 10:12` — the committer's date at minute precision, no zone: a
  `+0800` in every one of 200 rows is six cells that only repeat the local
  clock.
* the committer (`%cn`, which is the person who made this commit, not the
  author the detail pane names), padded to one width for the page and clipped
  with an ellipsis past 10 cells;
* then the graph, whose lanes now start at one cell in every row — the reason
  both columns are padded at all;
* then the subject and its refs. The hash is gone from the row.

Both columns are kept whole or dropped whole: a box too narrow for them *and*
a readable subject loses the committer first and the date-time second, so a
pane that cannot afford them shows the graph and the subject rather than a
title cut to eight cells. At 150 columns the split layout shows both; the
list on its own (`tab`) always does.

The demo log carries times for the same reason, and its rows still come from
the read's own parser.
The row read `subject · HEAD -> dev-huichen, origin/dev-huichen`: what the
commit did, then where it sits. Read the other way round — the refs first, as
tig prints `[dev-huichen] Merge branch …` — a lane is identified before the
work it carries, and a commit with no refs on it still starts at its subject.

Only the order of the two pieces changes: the colours, the ` · ` between them,
and the way a selected row is one band across both are untouched. A test that
took `pieces[0]` for the subject now looks at every piece instead, since which
position the subject has depends on whether the commit carries refs.
…nges alone

A page was bounded by ten exchanges and by an 8 MB byte budget that no real page
ever reached — a guard that never fires reads as a guard that is not there. The
exchange count could not see the expensive case at all: on this store the newest
page of a conversation whose history is one huge turn was **541 rows and
1.69 MB**, and that conversation has three exchanges in total.

Now a page stops at rows or bytes, whichever comes first, and the client is told
it may begin anywhere in the exchange it lands in (`ExchangeStart`, shared with
the host's history read, which keeps its completing behaviour).

First page, what a switch waits for — 5 runs each, same database file, same
client, the two agents run one after the other on it:

  rows    median 87/124/126/138/140          unchanged (a typical page already fit)
          worst  168 / 541 / 813 / 1574 / 326  →  150 / 150 / 150 / 150 / 150
  bytes   median 354k/548k/527k/294k/664k    →  354k/325k/301k/256k/377k
          worst  716k / 1.69M / 2.37M / 4.17M / 2.14M  →  653k / 548k / 527k / 364k / 1.68M
  ms      median 120/102/79/74/78            →  98/97/85/87/85
          worst  205 / 629 / 246 / 360 / 133  →  175 / 180 / 103 / 107 / 117

The one page still at 1.68 MB is a single 1.6 MB entry, which no row or byte cut
can split (the fragment path exists for that, and it is one entry the reader will
open deliberately).

Page-ups to walk a whole conversation to the top are unchanged (worst 12/2/9/3/5
→ 14/3/11/4/5). That is why the ceiling is two numbers: the *first* page is capped
at 150 rows because a switch waits for it, while a page-up may carry 600 because
the reader is already reading and the read no longer holds the screen. Capping
every page at 150 was measured first and rejected: the longest conversation then
took 37 page-ups instead of 12.

A first attempt at this also tried to nudge the cut up to the next call row, so a
page would not begin with a tool result that cannot name its own call. It was
reverted before landing: one turn is hundreds of consecutive results, so the nudge
ate each page and the next request advanced by a row (392 pages for a 541-row
conversation, measured). A page now keeps what it read; a result at its top shows
its call id until the page above arrives.
The preferences box (`ctrl+q`) carried a 减少动态 / "Reduce motion" row, and
the whole surface honoured it: a rail row painted a still `…` instead of a
spinner frame, the activity glyph fell back to `… `, and the ticker stopped
advancing under it.

The row goes, and with it the setting `reducedMotion`, the rebindable
`reduceMotion` action, and the still-mark path in the rail painter: the
spinner is the one thing a terminal client animates, and the surface no
longer has a way to switch it off. A `settings.json` that still carries
`reducedMotion` keeps the rest of its keys — unknown keys are ignored on
load and the field is dropped on the next save.
@huichen
huichen enabled auto-merge (squash) October 30, 2026 03:18
huichen and others added 7 commits October 30, 2026 11:19
Three sources of air sat between a row's columns and its subject, and two of
them were padding:

* two spaces separated the committer from the graph, on top of the committer's
  own cell padding — one is enough for two padded columns;
* the gutter was padded to the widest lane *in the whole page*, so a commit
  that finished after two lanes carried the empty columns of a six-lane fork
  before its refs. It is now cut at the row's own last lane, with the single
  cell that separates the drawing from the fields kept. The lanes still start
  in one cell (that padding stays, it is the graph) and each lane still sits in
  its own column;
* the rows' subjects therefore no longer share one column — they follow their
  own drawing — which is the trade for not reserving the page's widest graph on
  every line.

The columns' drop rule still measures the *padded* pitch: that number is the
same in every row, and a rule reading the trimmed width would show the columns
on some rows and not others.
`/transcript` was one of the five entries the workbench once advertised and
then answered `Unknown command`. Its replacement answered nothing either: the
whole notice named `/export` and `/reply-detail`, both of which the palette
already offers on their own rows, so the row spent a slot on a signpost.

The command goes with its two i18n keys and its surface arm. `render_all_
detailed` — the full-detail render the *inline* pager used, left without a
caller when that pager went — goes too; the one test that used it as "a copy
read as text" now reads the ordinary render, which is what a copy is.
The `/` palette's skill column kept whatever order the skills arrived in: the agent reports them in discovery order and the local fallback reads app scope before the shared one, so the same set of skills came out in a different order and the reader had to scan the whole column to find one. Skills now break rank ties by name, so each rank reads alphabetically; commands keep the order they are declared in.
@huichen huichen changed the title perf(tui): the loop stops waiting on io; the git log draws lanes, columns and refs perf(tui,agent): the loop stops waiting on io, pages bound by rows; a git log with lanes Oct 30, 2026
The collapsed `▸ 思考` marker is a row about the reasoning, not the first
line of the reply — wedged against the prose it read as one paragraph's
opening line. It now gets the same blank row the folded reply's count row
already has, opened or collapsed.

Reported 2026-10-30 against a `思考` marker with `大致可以分成六块,每块
都能真正动手执行…` on the very next row.
The `/` menu (and `ctrl+p`, which opens the same list) carried 33 verbs, and
most of them had a door of their own already: a chord (`ctrl+g` for `/git`,
`ctrl+n` for `/new`), a row in the preferences box `ctrl+q` (`/theme`, `/lang`,
`/mouse`) or a printable key (`?` for `/help`). Each of those spent a row of a
one-screen list on a second name and pushed the verbs that have no other way in
below the fold.

`COMMANDS` is now the sixteen verbs whose typed spelling *is* the way in
(`/queue` … `/pin`, `/delete`), in rank order for an empty query, with the two
verbs that name a conversation under the rail's cursor last. The other
seventeen moved to `TYPED_ONLY`, beside the door each one already has.

They are still recognized when typed: the draft is shared between commands and
prompts, so a verb dropped from the vocabulary entirely would be submitted to
the agent as text — a reader with `/theme` in their fingers must land on the
picker, not ask the model what `/theme` means. `known_command` reads both
lists, so unlisted is not unhandled, and `every_palette_entry_has_a_handler`
walks both so an unlisted verb cannot rot into `Unknown command` either.
huichen and others added 14 commits October 30, 2026 12:28
Every commit was a `●`, so a merge and a plain commit looked the same until
the eye followed the line out to a column and back. tig's two glyphs say it
before that: `M` is a commit that joins lines, `o` one that only continues its
own.

Nothing else moves — the node keeps its lane's colour and the bold weight, the
elbows and the broken horizontals are unchanged, and the `●` badge other tabs
put in the same gutter ("the branch this checkout is on") stays a `●` because it
marks a place, not a commit.
…at keeps the answer

Three fixes to the message controls, all from reading them on screen:

* **A prompt gets no controls.** The copy chip under the reader's own bubble read
  as part of what they typed — the desktop keeps its copy button there, but a
  terminal has no hover to separate it from the fill. Their text can be retyped
  or selected; the row now belongs to replies only.
* **One blank line between an answer and its chips.** Wedged against the last
  paragraph, `[复制] [分支]` read as another line of the answer. The gap is a
  row of its own, so `tab` still lands on the chips and nothing above moves.
* **A fork now carries the reply it was taken from.** The chip (and `/fork`)
  sent `fork` with an empty `mode`, which the agent reads as `through_entry`:
  the child ended at the selected user entry, so the answer the reader branched
  on was missing and the fork opened on a question nobody had answered. The
  request now says `through_turn` — the mode the desktop's own fork sends — and
  the child ends with the whole turn: prompt, tool calls and answer.

`fork_message`'s test asserts the mode, not just the entry id, because that one
field is the bug.
A branch name is one line of one file: <gitdir>/HEAD holds

ef: refs/heads/<name> while a branch is checked out. Reading it costs a
handful of stats and one open, against a process spawn per workspace switch --
49.91 ms -> 0.254 ms median on this machine (5 runs each, same answer), which
on Windows is loader, image checks and the real-time scanner before git has
read a single object.

A shortcut, not a second implementation of git's naming rules: a detached
HEAD (its short sha is core.abbrev's choice), a symref outside refs/heads/, and
any tree with no .git above it all fall through to git rev-parse --abbrev-ref.
The .git file indirection is followed, so a linked worktree and a submodule
still name their own branch.
The fork chip landed under every reply, so a conversation of ten turns ended in
ten `[分支]` chips — the noisiest thing on the screen, and none of them where the
reader was. The desktop it copies draws its fork button in each reply's footer
too, but reveals it only under the message the pointer rests on; a terminal has
no hover, so the same intent is spelled the other way round: the chip rides the
transcript's *newest* reply, once its stream has ended. An older point is still
one `/fork` away, which lists every real user message.

The chip is one row belonging to a message, so it moves the moment another reply
arrives — into a message the incremental append is not redrawing. `ChatArea`
therefore records which message carried it (`chip_owner`) and rebuilds instead of
splicing when the chip would be left behind somewhere else; a reply starting or
ending its stream moves the chip to or from the very message being spliced, which
that splice redraws, so streaming deltas still cost one message rather than the
transcript (the `a_streamed_delta...` case stays green).

Verified on the scripted workbench: the settled transcript now shows one `[分支]`
at the end of the last reply, and a reply still streaming shows none.
…only

Both directions of the corner control now walk the reader's own prompts:
down steps to the closest question below, up to the closest above, and a
reply is never a stop -- a long answer costs one press to pass instead of
one per screenful.

What that removes is the machinery that only existed to make a reply a
stop: the replyTail rung, the block a reply marked for the jump to measure
(data-reply-tail on desktop, the anchor offset reported by the mobile
bubble), and the jump lift that consumed it. The walk is now one list of
question rows in each client, so the shared types and the tests say so.

The tooltip and both locale files name it Next question instead of Next
passage.
The fork chip's refusal is a sentence, and the sentence follows the
interface language, which follows the reader's locale (the test attaches
with no settings, so English on CI and Chinese on a Chinese desktop). The
assertion matched a Chinese fragment, so it was right on exactly one of
them, and CI failed on `--lib` while the local run passed.

Assert the key's rendering in the language this run resolved instead,
which keeps the invariant the test exists for: an unannounced prompt is
refused, with the needs-persisted notice, and no `fork` is sent.
@huichen huichen changed the title perf(tui,agent): io off the frame path, git-log lanes; palette trims, /rename, message actions perf(tui,agent): io off the frame path, git-log lanes; fork chips, palette trims, /rename Oct 30, 2026
…nswers too

A fork chip sat under a reply, then under every reply, then under the newest one —
three attempts at the same wrong idea. The desktop can afford a per-message fork
button because it is revealed on hover; a terminal has no hover, so any chip is
permanent, and a per-message verb on a transcript reads as part of the transcript.
So the chip is gone: no message carries a fork control, and `/fork` is the one
spelling of the verb, where a command belongs.

`/fork` now opens the conversation's own history as a picker: every question the
reader asked and every answer the model wrote, in transcript order, each row
labelled with whose message it is. Picking one forks **after that message** —
`through_entry`, so the child ends with it: pick a question and it stops at the
question, pick an answer and it carries the answer.

That needed one piece of agent work: `get_fork_messages` only lists user turns
(what `session forks` and the desktop's fork button ask for), so a new
`get_fork_entries` returns the whole settled history. "Settled" is the point of
it: the entries a run is still writing are not candidates, because there is no
answer to stop at yet — so while a reply streams, the newest row the picker
offers is the prompt that started it, which is exactly the rule the reader
stated. The demo agent in `tui/examples` answers it from the scripted journal, so
a picker frame names the rows the transcript beside it names.

Removing the chip also removed the plumbing that existed only to serve it: the
per-prompt `user_message` → entry-id bookkeeping, `ChatMessage::entry_id`, the
`fork_owner`/`chip_owner` render bookkeeping, the `RowAction::Fork` stop and its
`chat.button.*.fork` hit region, and two i18n keys. `[复制]` is untouched — it is
a copy button, not a verb that already has a command.
@huichen huichen changed the title perf(tui,agent): io off the frame path, git-log lanes; fork chips, palette trims, /rename perf(tui,agent): io off the frame path, git-log lanes; fork chips and picker, palette trims, /rename Oct 30, 2026
huichen and others added 10 commits October 30, 2026 14:28
…wns ctrl+v

Windows Terminal — the console Windows 11 opens a shell in — binds `ctrl+v` to
its own paste, which carries text and can never carry an image. The byte never
reached the TUI, so pressing it with a screenshot on the clipboard did nothing,
and the app *has* to read the clipboard itself for an image to travel at all.

The clipboard chord is now `alt+v` on Windows: it arrives as `ESC v` from either
Windows front end (conhost and Windows Terminal) and no front end claims it.
`ctrl+v` stays the chord everywhere else and `/paste` stays the typed door for
anyone who rebinds it away.

The keymap's "no alt default" rule is scoped to platforms with a composing
Option (macOS), which is the reason it existed; the help overlay and the
shortcut editor already read `Action::default_key`, so both now name the chord
the platform really has. `docs/guide/tui{,.zh-CN}.md` and
`docs/tui/workbench-spec{,.zh-CN}.md` say which chord Windows uses and why.
…y run records which case applied

`--model` / `--thinking-level` are per-run flags and were applied only when
given, silently. With no goal-level default that made one pasted command line
the de-facto configuration of every worker in a goal (measured: 13 dispatches,
9 of them carrying the same `--model --thinking-level high --max-turns 8`, no
re-judgement in between), and an override left no trace in the log or the run
header.

- Fresh worker session: with neither flag, `future goal run` reads the session
  recorded by `supervisor register` (`get_state`) and applies its model and
  thinking level. With no supervisor to read it sends nothing and lets the
  agent's own default stand - no guessed constant here.
- A resumed session (`--resume-session`) keeps the configuration it already
  has; only explicit flags touch it. Inheriting there would rewrite a running
  conversation's model because the supervisor happens to differ.
- An explicit flag is still an override, now printed
  (`worker ... (override; supervisor was ...)`) and stamped in the run header.
- `run_header` always carries `model` / `thinking_level` / `model_source`
  (`supervisor` | `override` | `default` | `session`), including the `default`
  shape, so a missing field keeps meaning "older log" and never "nothing was
  overridden". Values are read back from the agent after applying, not the
  caller's intent.
- Resolution is a pure function with unit tests for all four cases plus the
  console line; `run_header` has its own test including a legacy line.

Deliberately NOT changed: agent-side inheritance from `parent_session`. That
field is lineage (desktop sidebar, forks), not a configuration source, and
"supervisor" is a goal-plane concept - changing it would alter child-session
behaviour for desktop/mobile without a requirement.

Skill documentation (`skills/builtin/future-goal/SKILL.md`) lives in the
`skills` submodule, so its correction ships as a companion PR there
(futuregene/future-skills#108) rather than in this commit.
`read_page` only ever added a constant to `read_page_from`, but as an
`async fn` it paid for that constant with its own state machine nested
inside the caller's. In a debug build that nesting is real stack, and the
caller it matters to is the host's history read — the deepest `await`
chain in `future-host` (`remote_host::business` -> `history::execute` ->
the page read -> the agent call), which runs on a worker thread with the
platform's default stack.

Measured on the `remote::commands::bridge_tests` group, which reaches
that chain, by bisecting the smallest worker stack the test runtime's
`thread_stack_size` still survives with (arm64 debug, 8 KiB steps):

  before this commit: 2017280 B (1970 KiB)
  after this commit:  1937408 B (1892 KiB), i.e. the pre-branch cost

That 78 KiB is what took `Rust Windows test / host-remote` over the edge:
the chain sat at 92% of a worker's 2 MiB stack, and MSVC debug frames are
wider than arm64 ones, so the extra layer was the difference between
passing (as `main` does) and STATUS_STACK_OVERFLOW. Returning the future
directly removes the layer instead of moving the ceiling.

No behaviour change: the paging loop, `ExchangeStart` semantics and every
assertion stay as they were.
@huichen
huichen merged commit 79bbf41 into main Oct 30, 2026
68 of 70 checks passed
@huichen
huichen deleted the pr/huichen branch October 30, 2026 09:16
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