Skip to content

feat(aid): pick the agent, model and effort, and paste a whole prompt, and release 0.59.0 - #662

Merged
blooop merged 13 commits into
mainfrom
interactive
Sep 30, 2026
Merged

blooop merged 13 commits into
mainfrom
interactive

Conversation

@blooop

@blooop blooop commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

aid with no prompt now asks for the agent, the model and the effort before the prompt, and the prompt editor takes a paste whole.

What changes

  • --model and --effort. Each agent gets them in its own spelling: claude --model/--effort, codex --model and -c model_reasoning_effort=, gemini --model. The values are passed on as typed. --effort with --gemini is refused, because gemini has no such setting. Both work on an aid resume line too, ahead of the resume words.
  • Pickers ahead of the prompt. On a terminal, aid asks for each setting the line left open: the agent (one row per Claude login that dl --claude-profiles lists, then codex and gemini), the model, and the effort. Each picker lists the recent choices first (<cache>/aid-recent.tsv), so one Enter repeats the last launch. A name that is not listed can be typed. A flag on the line skips its picker. Esc stops the background boot and exits 130.
  • A bare aid picks a workspace, with dl::pick_workspace from feat: aid resume, and release 0.57.0 #646. So does a line of flags with no workspace, such as aid --codex.
  • A new prompt editor (dl/src/prompt_editor.rs). The old read used the terminal's line mode, which cut a paste off at 4096 bytes, submitted at the first pasted line break, and left lines that arrived late for the agent to read as keystrokes. The editor runs in raw mode with bracketed paste. A paste keeps its line breaks. Enter submits. Alt-Enter or Ctrl-J adds a line. Ctrl-C stops the boot. An Enter with more input right behind it counts as a pasted line break, for a terminal with no bracketed paste. The editor reads one byte at a time and stops at the Enter, so keys typed after it still reach the agent.
  • The choosers use main's TERM plan from 0.57.2: a TERM skim cannot draw with is swapped for xterm-256color while the chooser is up. A 0x0 pty skips the choosers, because skim panics on it.

Merged with 0.58.0

0.58.0 (#657) rebuilt aid's line builder for the herdr auto-resume. The merge threads this branch's model and effort through it. The model and the effort come before Remote Control, then the session id, then the prompt or the resume words. The line that herdr gets to reopen a session also has the model and the effort, so a session that comes back after a restart keeps them (a_restored_session_keeps_the_model_and_effort). The pty tests that compare a whole claude line remove the random --session-id with main's without_session_id.

Release

This PR releases 0.59.0: rust/Cargo.toml, rust/Cargo.lock, the README conda badge and dl --version transcript, and the CHANGELOG section. It is a minor bump, because it adds flags and behaviour.

Tests

  • On the final head: cargo test --workspace: 2889 passed, 1 ignored. Clippy (--locked -D warnings) and fmt are clean. pytest: 839 passed. ruff check, ruff format --check and ty are clean.
  • The new pty tests (aid/tests/interactive.rs) cover each picker, recent choices, a typed name, Esc, a named Claude login, a bare aid, and four paste cases: a paste that ends in a line break, a 9000-byte paste sent in pieces, a paste whose second half comes 300 ms late, and Alt-Enter and Ctrl-J. With read_prompt switched back to the old read, the four paste tests fail.
  • The pty suite (33 tests) passed 3 runs of 3 at default parallelism after the merge of 0.58.0.

Limits

  • The editor only appends. There is no cursor movement.
  • A SIGTERM while the editor is open leaves the terminal in raw mode. Ctrl-C does not. The fix is for the signal handler in devlaunch-runner to restore the terminal settings.
  • aid resume opens none of the pickers, as feat: aid resume, and release 0.57.0 #646 designed. Only flags set its model and effort.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p

`aid --model <m>` and `aid --effort <e>` pass the model and effort to the
agent in its own spelling (claude --model/--effort, codex --model and
-c model_reasoning_effort=, gemini --model). The values are not checked.

With no prompt on a terminal, aid now asks for the agent (one row per
Claude login, then codex and gemini), the model and the effort before the
prompt, each in a skim picker that lists the recent choices first. A bare
`aid`, or leading flags with no workspace, opens dl's workspace picker.

The prompt editor is a raw-mode editor with bracketed paste: a paste keeps
its line breaks and can be any length, Alt-Enter or Ctrl-J adds a line,
and Ctrl-C stops the boot as Esc does in a picker.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
Takes resume1's `dl::pick_workspace` in place of this branch's copy of
the same function; a bare `aid` now calls theirs. `Task::Resume` and
`Unpicked` carry the model and effort, so `aid --model opus resume`
works, and the resume words stay last on the line. The Remote Control
name in this branch's tests is now the workspace id, as main has it.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
main's 0.57.1 and 0.57.2 swap a TERM skim cannot draw with for
xterm-256color in the workspace picker. The agent, model and effort
choosers now take the same plan in place of their own TERM check, which
only skipped the chooser, so every picker in a run treats TERM the same
way. The zero-size guard stays, as skim still panics on a 0x0 pty.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @blooop, your pull request is larger than the review limit of 150,000 diff characters

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.42720% with 346 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.42%. Comparing base (7012aae) to head (ab93822).

Files with missing lines Patch % Lines
rust/aid/src/interactive.rs 4.89% 136 Missing ⚠️
rust/dl/src/prompt_editor.rs 70.00% 120 Missing ⚠️
rust/dl/src/select.rs 60.50% 47 Missing ⚠️
rust/aid/src/main.rs 65.00% 14 Missing ⚠️
rust/aid/src/rewrite.rs 97.13% 12 Missing ⚠️
rust/dl/src/lib.rs 0.00% 9 Missing ⚠️
rust/aid/src/recent.rs 95.23% 8 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
python 42.98% <ø> (ø)
rust 94.64% <74.42%> (-0.50%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
shipped code (rust) 94.64% <74.42%> (-0.50%) ⬇️
harness and tooling (python) 42.98% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… launched an agent

A line that spells a retired flag and names no workspace is refused for the
missing workspace, as it was before the picker. The pick appended the spec
after the retired word, so the word was no longer peeled and the line became
an agent launch.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
An ESC with nothing behind it within the paste gap is now the Esc key on
its own and is dropped, so Esc then f types f and Esc then Enter submits.
Alt-Enter, arrows and bracketed paste markers arrive in one burst and
parse as before.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
…'s pickers

Typing `gpt-5.5` with a recent `gpt-5.5-codex` listed matched that row by
substring, and Enter took it: `gpt-5.5` could only be given with --model.
Alt-Enter in dl::choose now takes the query as typed, whatever row is under
the cursor, and the model and effort pickers say so in their header.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
The unbracketed paste test sent its line break as `\n`, which is Ctrl-J and
always a line, so it passed with the "Enter with more input behind it" rule
removed. It now sends `\r` line ends in one write, and fails without that
rule.

The bracketed paste test sent the whole paste in one write, so the timing
rule alone kept its `\r` a line break. It now ends a read on a `\r` inside
the paste, and fails when the open paste is not what keeps it a line.

The named-login test ignored aid's exit status; it now asserts 0.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
…g's value remembered

Four branches of the agent picker and settle shipped with no test: the
recent agent leading the next launch's rows, a typed name that is no
row being asked again, Esc at the agent picker cancelling the launch,
and a model given by flag being remembered for the next launch.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
…trl-C

The module doc said a terminal Ctrl-C at the editor reaches both aid and
the boot child as SIGINT, with no new machinery. The editor and the
pickers hold the terminal in raw mode, so Ctrl-C there is a byte aid
reads and answers with BootChild::cancel. The doc now says so, and
keeps the process-group point for a Ctrl-C outside raw mode.

collect_prompt's doc comment had drifted onto enum Collected, above
that enum's own summary line. It is back on collect_prompt.
Collected::Cancelled now names Ctrl-C at the prompt editor as well as
a cancelled picker.

Comment-only change (review core section 4), so there is no test.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
Setting put the agent/launcher row in the same enum as the per-agent
model and effort. That forced dead arms in takes and suggestions, and
wildcard arms in settle and ask_value that would send any new variant
to the model slot. recent.rs accepted record("claude", Agent, None).

Knob { Model, Effort } now names the per-agent values, with exhaustive
matches everywhere. recent.rs keys choices by a private Key { Launcher,
Knob(agent, Knob) }, with launchers/record_launcher for the launcher
row. The aid-recent.tsv columns are unchanged.

Claude-Session: https://claude.ai/code/session_01YCMnQumtYnUTaYbEbC4A5p
main brought #657's herdr auto-resume, which rebuilt aid's line builder
around build_launch, a minted --session-id and a typed AgentResume. This
branch's Tuning is threaded through that shape: agent_line takes both the
tuning and the session, so the model then the effort still land ahead of
Remote Control, the session id after it, and the prompt or resume words
last.

The restore lines herdr is handed carry the tuning too, so a session
brought back after a restart keeps the model and effort it was started
with, as aid resume does. a_restored_session_keeps_the_model_and_effort
pins it.

main now names every fresh claude session, so the pty tests that compare
a whole claude payload strip the id with main's without_session_id.
This branch's changelog entries stay under [Unreleased], above 0.58.0.
aid asks for the agent, the model and the effort before the prompt
(#662). aid --model and --effort pass each agent the setting in its own
spelling, on a fresh line and on aid resume, and gemini refuses an
effort. The pickers list recent choices first, and Alt-Enter takes a
name as typed. A bare aid picks a workspace as a bare dl does. The prompt
editor is now raw mode with bracketed paste, so a pasted prompt keeps its
line breaks and its length.

New command-line flags and new behaviour, so this is a minor bump.

All four copies of the version move together: Cargo.toml, Cargo.lock,
and the README conda badge and dl --version transcript.
@blooop blooop changed the title feat(aid): pick the agent, model and effort, and paste a whole prompt feat(aid): pick the agent, model and effort, and paste a whole prompt, and release 0.59.0 Sep 30, 2026

@blooop blooop left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review of this PR (review-self): this report was generated by AI during a Claude Code session.

Axes run: Defects, Types, Tests, Mutant (diff 3125 lines, five-subagent split). Spec: no spec available (no linked issue), so it did not run. Standards (/simplify) was not asked for and did not run.

Fixed, one commit each, each with a test seen failing first:

  • 85795b8 aid --stop with no workspace opened the pickers instead of the NoWorkspace refusal (Defects)
  • 16dcc29 the prompt's count line wrapped in a narrow terminal, so each redraw moved one row down (Defects)
  • 891c679 a lone Esc at the prompt editor swallowed the next key as Alt (Defects)
  • 57eb1ce a name that is a substring of a listed row could not be typed; Alt-Enter now takes the text as typed (Defects)
  • c6f35f9 Setting let the launcher row pose as a model or effort; split into Knob, exhaustive matches (Types, applied)
  • 8f8bea0 two paste tests passed without the rules they name; one now kills the bracketed-paste mutant (Tests + Mutant)
  • bd0775a new pty tests: agent picker order, typed agent re-asked, Esc at agent picker, flag value remembered (Tests)
  • b478e45 stale comments about a cooked-mode Ctrl-C (Defects, comments)

Mutant: dropping self.pasting || in Editor::ground survived the pty paste test; killed after 8f8bea0.

Left open: Types tighter shapes with no reachable bad state (agent_typed beside Task::Retired, with_tuning unchecked, Launcher.profile); no pty test for a pull-request spec kept after the agent pick; the named-login test cannot see the profile in the session payload with this fixture; render at height 1 with a multi-line prompt takes 2 rows; SIGTERM while the editor is open leaves the terminal raw; aid resume opens none of the pickers (by #646's design).

Scope: the review above covered the branch up to c6f35f9. The merge of 0.58.0 (106af01) and the release commit (ab93822) came after it and were not reviewed on these axes; they were gated with the full suite (cargo test 2889 passed, pty suite 3 of 3, pytest 839 passed, clippy, fmt, ruff, ty).

@blooop
blooop merged commit c8c12ce into main Sep 30, 2026
21 of 23 checks passed
@blooop
blooop deleted the interactive branch September 30, 2026 18:54
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