Recall sent prompts with ArrowUp/ArrowDown in the `clai2` web UI prompt box
Merged
MP
1mo ago+157+157+012345678901234567890123456789-40-40-01234567890123456789
- Fixes #11284
Why we make these changes
In the clai2 web UI, ArrowUp in the prompt box didn't recall earlier prompts, though the terminal prompt does (#11284). The composer's onKeyDown only handled the arrows while slash-command suggestions were open, and it kept no history. This change makes the arrows work the way the terminal's PromptBuffer.vertical/recall does.
New public surface
none (the composer gets an optional internal history prop)
User-visible behavior
Before: after sending hello, ArrowUp in the empty composer did nothing.
After: ArrowUp fills the composer with hello, and ArrowDown brings back the empty draft.
- Up on the composer's first line steps back through the shown session's sent prompts, newest first. Down on the last line steps forward, and the unsent draft comes back past the newest entry. Queued prompts stay editable in the queue panel above the box.
- Elsewhere in a multi-line draft, Up/Down still move the caret. With
/suggestions open, they still pick a suggestion. - Shift/Ctrl/Alt/Cmd+arrows, a selection, or nothing to recall keep the browser's default behavior.
- Typing, sending, or switching sessions ends the walk. A recall drops slash completions still pending for the draft it replaced.
- Prompts come from the session's transcript, so recall survives the composer moving after the first message, a reload, and a session switch.
- Documented in
clai2_web_README.md,docs/reference.mdandFILE_MAP.md. The bundledapp.jsis rebuilt with Node 24.22.1 (.nvmrc).
Verification
test_composer_recalls_sent_promptsfails onmainat the first recall assertion, and passes with the fix.tsc --noEmit,npm run build(reproducible bundle), ruff, pyright and pre-commit all pass locally. The browser job runs in CI. The local WSL Chromium produces no animation frames, so I checked the browser test there with forced clicks and a polyfilledrequestAnimationFrame.
What changes for existing users
The web composer's Up/Down now recall prompts, as the terminal's do.
PR decisions
2026-10-26 · pre-push review 1 of 3 at 3bc994d055e96198a82411e262f9d5913148e33c · iter -
- Decision: reserved; dispatching
- Why: tree 97312d80a772c7aba2e9d02c8808495b4198cec9; scope origin/main 2142330ea...3bc994d05 (full branch)
- Source: https://github.com/pydantic/pydantic-ai/tree/clai2-fix/issue-11284
2026-10-26 · pre-push review 1 of 3 at 3bc994d055e96198a82411e262f9d5913148e33c · iter -
- Decision: remediated: modifier arrows no longer recall; web docs + FILE_MAP updated (c848620f9)
- Why: tree 97312d80a772c7aba2e9d02c8808495b4198cec9; full branch vs 2142330ea; 2 findings, both valid
- Source: https://github.com/pydantic/pydantic-ai/tree/clai2-fix/issue-11284
2026-10-26 · pre-push review 2 of 3 at c848620f9a2a3a8db22b95c6c6c7e485abc456d0 · iter -
- Decision: reserved; dispatching
- Why: tree 8087551b6f8547f5f6eeb2707d792452adac6324; scope 3bc994d05..c848620f9 plus prior findings
- Source: https://github.com/pydantic/pydantic-ai/tree/clai2-fix/issue-11284
2026-10-26 · pre-push review 2 of 3 at c848620f9a2a3a8db22b95c6c6c7e485abc456d0 · iter -
- Decision: no findings
- Why: tree 8087551b6f8547f5f6eeb2707d792452adac6324; delta 3bc994d05..c848620f9; prior findings verified fixed
- Source: https://github.com/pydantic/pydantic-ai/tree/clai2-fix/issue-11284
2026-10-26 · exempt delta: merge origin/main at 617bc322a · iter -
- Decision: no re-review; chains from reviewed c848620f9 (review 2 of 3)
- Why: only conflict was the generated app.js, rebuilt reproducibly with npm run build (repo tooling); source diff vs base identical except a FILE_MAP blob-index line from main's own edit
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · pre-push review 3 of 3 at e28fa8626976af3858fcd1cea110e002d93ab5fe · iter -
- Decision: reserved; dispatching
- Why: tree a3e004789e40ad8ec90d8a6679257dfbeb4f635b; delta 617bc322a..e28fa8626 (Macroscope thread fix)
- Source: https://github.com/pydantic/pydantic-ai/pull/11352#discussion_r4380096913
2026-10-26 · pre-push review 3 of 3 at e28fa8626976af3858fcd1cea110e002d93ab5fe · iter -
- Decision: no findings
- Why: tree a3e004789e40ad8ec90d8a6679257dfbeb4f635b; delta 617bc322a..e28fa8626
- Source: https://github.com/pydantic/pydantic-ai/pull/11352#discussion_r4380096913
2026-10-26 · Macroscope thread: stale completions after recall · iter -
- Decision: valid, reproduced; step() invalidates pending completions and clears suggestions
- Why: delayed /complete showed 29 options over a recalled prompt and Tab rewrote it
- Source: https://github.com/pydantic/pydantic-ai/pull/11352#discussion_r4380096913
2026-10-26 · exempt delta: test-harness repair at 515b4e6c1d82a44d0f5d7874df235ff4b8d8daf1 · iter -
- Decision: no re-review; chains from reviewed e28fa8626 (review 3 of 3)
- Why: test code only: body() instead of finished() plus unroute, fixing a CI teardown 'Target closed' error; established expectation unchanged
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/40366942844
2026-10-26 · merge origin/main at e508a56c238ad4fe9f91ff2692af64defe913bd4 · iter -
- Decision: no further review (budget 3 of 3 used); local checks rerun
- Why: PR left the merge queue as UNMERGEABLE after #11314/#11315/#11327/#11341 landed; conflicts were the generated app.js (rebuilt reproducibly) and side-by-side additions in the browser test (both imports and both tests kept); source delta otherwise identical to reviewed 515b4e6c1
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · merge origin/main at 40b5a1ba5262e087bf25643b886b2f9815df4f67 · iter -
- Decision: exempt-style catch-up; budget 3 of 3 used
- Why: after #11355 landed; only conflict was the generated app.js, rebuilt reproducibly (repo tooling)
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · merge origin/main at 116cfcbab0090fb542491369c8931e2c07ee6da3 · iter -
- Decision: catch-up merge; budget 3 of 3 used
- Why: after #11360/#11313 landed; only conflict was the generated app.js, rebuilt reproducibly
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · merge origin/main at aee5fc9a9f20114de4e9e930cef5bc7fb3fc1b17 · iter -
- Decision: catch-up merge; budget 3 of 3 used
- Why: merge queue churn: another web PR landed a bundle; only conflict was the generated app.js, rebuilt reproducibly
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · merge origin/main at f3c92b3c728bb6265a99a9ab005516286d072c38 · iter -
- Decision: catch-up merge; budget 3 of 3 used
- Why: merge queue churn: another web PR landed a bundle; only conflict was the generated app.js, rebuilt reproducibly
- Source: https://github.com/pydantic/pydantic-ai/pull/11352
2026-10-26 · CI Review advisories at 40b5a1ba5 · iter -
- Decision: dropped queued prompts from web recall instead of testing them; renamed step to recallPrompt; reworded settle comment
- Why: Enter on a recalled queued prompt queued a duplicate (no in-place rewrite as in the terminal), the issue asks only for sent prompts, and testing it needed a new blocking fixture session
- Source: https://github.com/pydantic/pydantic-ai/pull/11352#pullrequestreview
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.