Repository navigation
tui: pick the agent of the guide, with its logo - #13
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ./...andgolangci-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.