Skip to content

tui: pick the agent of the guide, with its logo - #13

Merged
frinfo702 merged 2 commits into
mainfrom
guide-agents
Nov 26, 2026
Merged

frinfo702 merged 2 commits into
mainfrom
guide-agents

Conversation

@frinfo702

@frinfo702 frinfo702 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

The Guide tab can now run opencode, cursor-agent, and agy, after claude, pi, and codex. The three take the prompt only as an argument, so their
commands pass the standard input as one with "$(cat)". cursor-agent runs in ask mode, which does not edit, and with --trust, so it does not stop at the question of the workspace.
a in the Guide tab lists the agents, and a pick writes the guide again with that agent. guide_agent takes the name of an agent as well as a command. An agent that the PATH does not have shows as not installed, and the guide says "agent "x" not found in PATH" for it, or "no agent found" when there is none. A command of the setting is left to the shell, since it can start with a variable.
In a terminal with the kitty graphics protocol (Rex, Ghostty, kitty), the list and the line of a run show the logo of each agent. The logos are sent once and drawn with Unicode placeholders, so the renderer
moves and clips them as text. They are masks in the colour of the text, and go again when the theme changes it. renderer = "kitty" covers the placeholders with its pictures, so it paints the logos in them itself.
The rows of the overlays now give each part the background of the selection: the reset at the end of a styled part ended the background of the row, so a name after a logo, or a tag, showed off the highlight.

A prompt too big for an argument (1 MiB of arguments and environment on macOS, 128 KiB in one argument on Linux) turns off opencode, cursor-agent, and agy: the picker marks them "diff too big", and a run says how big the diff is. claude, pi, and codex still run, with a warning. opencode runs as its plan agent, which does not edit. The logos go again after the editor, and with the first frame of a run; zellij and screen get no logos, as tmux.

Tested: go test ./... and golangci-lint run. agy ran end to end in Rex with a 200 KB prompt; opencode and cursor-agent were not run, for want of a login.

The Guide tab can now run opencode, cursor-agent, and agy, after claude,
pi, and codex. The three take the prompt only as an argument, so their
commands pass the standard input as one with "$(cat)". cursor-agent runs
in ask mode, which does not edit, and with --trust, so it does not stop
at the question of the workspace.

a in the Guide tab lists the agents, and a pick writes the guide again
with that agent. guide_agent takes the name of an agent as well as a
command. An agent that the PATH does not have shows as not installed,
and the guide says "agent "x" not found in PATH" for it, or "no agent
found" when there is none. A command of the setting is left to the
shell, since it can start with a variable.

In a terminal with the kitty graphics protocol (Rex, Ghostty, kitty),
the list and the line of a run show the logo of each agent. The logos
are sent once and drawn with Unicode placeholders, so the renderer
moves and clips them as text. They are masks in the colour of the text,
and go again when the theme changes it. renderer = "kitty" covers the
placeholders with its pictures, so it paints the logos in them itself.

The rows of the overlays now give each part the background of the
selection: the reset at the end of a styled part ended the background
of the row, so a name after a logo, or a tag, showed off the highlight.

On Linux one argument holds at most 128 KiB, under the 200 KB of diff
that the prompt can have, so a big change can fail with the three new
agents.
opencode, cursor-agent, and agy take the prompt as one argument. macOS
holds at most 1 MiB of arguments and environment, and Linux 128 KiB in
one argument, while the prompt can pass 1 MiB with one big file. The
guide now measures the prompt first. A prompt that does not fit turns
these agents off: the picker marks them "diff too big", and a run with
one of them says how big the diff is and the most that fits. claude,
pi, and codex read their standard input and still run, with a warning
that a big diff takes long. With no agent set, the first agent that is
installed and takes the prompt writes the guide.

The terminal drops its images when the editor takes it off the
alternate screen, so the logos go again after the editor. They go with
the first frame of a run, not at its start: a run that starts with the
program could send them before Bubble Tea is on the alternate screen.

opencode runs as its plan agent, which does not edit, since the diff can
hold instructions. zellij and screen keep the variables of the outer
terminal but drop the images, as tmux does, so they get no logos.
@frinfo702
frinfo702 merged commit da07c8b into main Nov 26, 2026
4 checks passed
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