Skip to content

Agent chat: the thread rail shows every prompt of the chat, read in the background - #25160

Open
teamleaderleo wants to merge 1 commit into
rail-opus-earlier-prompts-indexfrom
rail-opus-rail-every-prompt
Open

teamleaderleo wants to merge 1 commit into
rail-opus-earlier-prompts-indexfrom
rail-opus-rail-every-prompt

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

HOLD: base red web / react-apps-check hides webview test signal on feat-cmux-next (owner nx-ci); this PR touches webviews/ and lands once that check is green again.

Leo (2026-10-25, the thread rail): "if you haven't loaded in chats ... the session rails ... should be able to still, like, gradually load that stuff in".

This is PR #25160, the rail integration stacked on PR #26033 (rail-opus-earlier-prompts-index). PR A owns the prompt index, backward event paging, client.earlier, and loadThrough(seq); this PR lands after A and consumes that contract. The branch is mine and was rebuilt from feat-cmux-next.

What changed

  • minimapTurns prepends indexed prompts with index: -1 above the loaded window, counts the complete prompt set through each tick's aria-setsize, and retains the current promptId/row-id keys and Agent chat: polish minimap hover cards #25960 card metadata.
  • ThreadMinimap subscribes to client.earlier. Clicking or scrubbing an unloaded prompt asks loadThrough(seq) to materialize it, then hands the existing jump path the real row; no second scroll compensator is introduced.
  • The full-height map receives loaded turns only, so the windowed map keeps its bounded work while the compact rail can represent the full prompt history.
  • thread-rail-every-prompt.test.ts is a real Chromium browser test: it pages a tail-only attach, verifies the full aria-setsize, clicks the first unloaded tick, and waits for user-1 to materialize through history paging.

Coordination

big-red/nx-chat acknowledged ACK-nx-history-contract-1027. nx-chat owns logical/physical history coordinates and the existing row-id prepend anchor (preserveScrollAnchorTop in conversation/scrollAnchor.ts, called by VirtualTranscript). PR A owns the complementary prompt index.

Public shapes consumed from PR A:

client.earlier: EarlierPromptsStore = {
  subscribe(listener: () => void): () => void,
  get(): readonly AcpmuxRow[],
}
client.loadThrough(seq: number): Promise<void>

Tests

Rebased onto A 181d9797847473707e927b7e4cda26e60090a22f. The rail-only commit is unchanged (git range-diff). A's unknown-boundary and equal-count regressions fail on 8885fc97 and pass on the current stack. The 235 generated page/byte splits still match whole-transcript keys. The failed-result regressions for read failure and the 200-page cap fail on 1c1fd5d4 and pass on this stack; the next prompt appears and is published exactly once.

Current stack: 31 focused tests pass, one history browser-lane test is skipped in the ordinary local run, and CMUX_BROWSER_TESTS=1 bun test test/thread-rail-every-prompt.test.ts passes in Chromium. A's PR body records the 320,000 worst-case transition bound and cap retention measurements (5,749,799 serialized transition bytes while unresolved, zero on completion; prompt display/refresh storage and JS overhead excluded).

  • thread-rail-every-prompt.test.ts Chromium browser lane passes with CMUX_BROWSER_TESTS=1.
  • Related earlier-prompt, long-chat, scroll-map, card-metadata, turn-key, and history-paging suites pass locally; the normal local run skips browser lanes outside CI/Freestyle.
  • PR A regression tests fail on f6262e04 and pass on the new stacked head: cross-page continuation state and final failed-read batch publication.
  • bun run typecheck, check:fixed-waits, check:layers, check:design-tokens, targeted formatting, and git diff --check pass.
  • python3 scripts/cmux-next/prepush-gate.py passes on the exact stacked head; no native build was run.

Perf (same harness, windowed rail, readDelay 300 ms, cmux-ci Chromium, 3 runs each; identical across runs)

chat build ticks worst frame gap long tasks (total, longest)
500 prompts, 50 loaded, 3 s base 02151f8c 50 16.8 ms 0
stacked A + B 61bd0b5c 500 16.8 ms 0
2,000 prompts, 50 loaded, 6 s base 02151f8c 50 16.8 ms 0
stacked A + B 61bd0b5c (68 ticks drawn by the window) 2,000 16.8 ms 0

These are the same-harness windowed-rail measurements as the original PR, with the rebuilt stacked head recorded above.

Timers and stop conditions

  • One idle callback at a time per pane; each callback reads at most one 400-record page.
  • Index reading stops on no older records, 200 pages, failed read, chat switch/reset, or close(); every stop cancels pending idle work.
  • A waiting click/scrub ends on reader input, another jump, loading ending without the target row, or chat switch.
  • loadThrough uses the existing history guards and stops on exhaustion, no progress, stale selection/epoch, or client close; it never writes scrollTop.

Changelog

Changed: the left prompt rail now represents every prompt in a long chat and materializes an unloaded prompt through the existing history/anchor path.

Agent session: agent session

@teamleaderleo

teamleaderleo commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@blacksmith-sh

blacksmith-sh Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-5tasl created for this PR by the cmux coordinator.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review f26869f: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr25160 -f ref=rail-opus-rail-every-prompt -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards.

CI failed on 02e62c5a7c (run 40486047659 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-check (1) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs agent-pane-background-tasks.test.ts the summary card lists the chat's background tasks: running ones first, the finished folded: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts newtab at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 2x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts newtab at 2x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts under Increase Contrast a focused edge keeps the resting edge, never a dimmer one: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts keyboard focus changes what a solid Send, Stop, the prompt editor's Send and a plain button paint; s...: failed (job)
  • seen on other PRs agent-pane-jump-latest-motion.test.ts chromium: a reply streaming in during Jump to latest's glide is followed to its latest row: failed (job)
Matched log lines
web / react-apps-check (1): (fail) the summary card lists the chat's background tasks: running ones first, the finished folded [1761.39ms]

Not re-run automatically: web / react-apps-check (1), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

web and size checks: green

CI fast guards failed on 02e62c5a7c (https://github.com/manaflow-ai/cmux/actions/runs/40486047659). It does not block the merge; a red guard merged into main breaks it for every open PR.
The log named no failed step; see the run.

Agents: python3 scripts/ci/guard_attribution.py fix applies the mechanical fixes locally.

Gallery before/after for f26869f: 16 states rendered, 2 images differ, 2049 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40470543214 -R manaflow-ai/cmux -n gallery-advisory-25160-f26869f8dc20eb46deda2fe93ca68002580ee90e (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/new-chat Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/new-chat Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/after-turn Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/after-turn Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/working Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/working Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/typing-in-dock Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/typing-in-dock Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/long-title Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/long-title Apple System Colors unchanged 0% own App.tsx
agent-pane.gutter-select/from-left-margin Apple System Colors Light unchanged 0% own App.tsx
agent-pane.gutter-select/from-left-margin Apple System Colors unchanged 0% own App.tsx
agent-pane.gutter-select/from-right-margin Apple System Colors Light unchanged 0% own App.tsx
agent-pane.gutter-select/from-right-margin Apple System Colors unchanged 0% own App.tsx
agent-pane.orchestration-lab/local-queue Apple System Colors Light unchanged 0% own App.tsx
agent-pane.orchestration-lab/local-queue Apple System Colors unchanged 0% own App.tsx
agent-pane.orchestration-lab/build-box Apple System Colors Light unchanged 0% own App.tsx
agent-pane.orchestration-lab/build-box Apple System Colors unchanged 0% own App.tsx
agent-pane.orchestration-lab/cloud-fair-share Apple System Colors Light unchanged 0% own App.tsx
agent-pane.orchestration-lab/cloud-fair-share Apple System Colors unchanged 0% own App.tsx
agent-pane.streaming-follow-motion/steady-reveal Apple System Colors changed 15.1% own App.tsx
agent-pane.streaming-follow-motion/steady-reveal Apple System Colors Light changed 1.52% own App.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

teamleaderleo added a commit that referenced this pull request Oct 26, 2026
…their keys, load in O(n)

Review of #25160 (gpt-6-astra):
- A prompt sent now that goes on with the turn it stopped (`continues`) got
  a tick of its own while unloaded and lost it once loaded. The rail now
  reads the records that decide that (queue_order, turn_result,
  queue_removed, prompt_refused) with the prompts and applies the
  transcript's rule (TurnStarts), across page edges too.
- A tick's key is the prompt's promptId (else its row id), never its shown
  text, which changes when an addressed message's sender is listed late;
  the earlier rows are built again then, on their own senders.
- Pages append their own rows (no copy of the ones before), and the rail
  reads them from their own store instead of the pane's snapshot, told
  once the prompts grow by half: O(log n) rail draws, no pane render per
  page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f7b-11f6-73e0-8276-7c0e3bb3ead4&host=huge-blue
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo force-pushed the rail-opus-rail-every-prompt branch from e52a5df to 45609b6 Compare October 26, 2026 00:32
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next fast gates / post cmux-next/fast-gates is red on 15 of 18 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / nightly-guards / workflow-guard-tests / release-notary is red on 17 of 18 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

high-signal review link / link is red on 14 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 14 h, and no lane holds a lease on it. The orphan sweep could not merge feat-cmux-next in: conflicts in webviews/src/agent-session/acpmux/direct.ts. Listed for a lane to resolve.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra xhigh, next-review): BLOCK at 45609b6

  • direct.ts:1272, ThreadMinimap.tsx:133 — The new EarlierPrompts store is never connected to the rendered minimap. ThreadMinimap still derives turns only from the snapshot’s rows, with no subscription to client.earlier and no loadThrough path for unloaded ticks. The background reads therefore have no UI effect; the rail remains limited to the loaded transcript tail, so the PR’s stated behavior is absent.

@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo changed the base branch from feat-cmux-next to rail-opus-earlier-prompts-index October 27, 2026 08:04
@teamleaderleo
teamleaderleo force-pushed the rail-opus-rail-every-prompt branch from f26869f to 61bd0b5 Compare October 27, 2026 08:24
@teamleaderleo
teamleaderleo force-pushed the rail-opus-rail-every-prompt branch from 61bd0b5 to e5e3c33 Compare October 27, 2026 08:42
@teamleaderleo
teamleaderleo force-pushed the rail-opus-rail-every-prompt branch from e5e3c33 to 0fd067f Compare October 27, 2026 09:29
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo force-pushed the rail-opus-rail-every-prompt branch from 0fd067f to 02e62c5 Compare October 27, 2026 10:07
teamleaderleo added a commit that referenced this pull request Oct 31, 2026
…(acpmux prompt index) (#29632)

* Agent chat: the thread rail lays out every turn from the first frame

acpmux answers one prompt index read (_acpmux/events promptIndex: each
prompt's seq, promptId and the start of its text, parsing only prompt
lines); the snapshot's earlierPrompts carries the prompts older than the
held rows, and the rail draws their ticks at their final places. Older
pages fill them in instead of adding ticks. The rail half carries
02e62c5 from #25160 onto this data source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* test(agent-pane): history paging counts the rail's one prompt index read apart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* fix(agent-chat): the rail's earlier prompts never reuse a committed list

Review at 5e99538: the combined list reused an array a committed result
still held. It is now a new array whenever its parts change, ticks stay
while only a reply streams, the band never sits on an unloaded prompt, a
pending jump belongs to its chat, and the index is read again for a
replaced history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* test(agent-chat): no findLast in the rail layout test (tsc lib)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* style(agent-chat): vp fmt the rail's prompt index code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* test(agent-pane): chat open trips count the rail's prompt index read apart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 02e62c5a Deployed Oct 27, 2026 by teamleaderleo via wait for same-key tree publisher #63772
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant