Add short_description field for agents and agent details dialog#5117
Closed
dibenkobit wants to merge 9 commits intoanomalyco:devfrom
Closed
Add short_description field for agents and agent details dialog#5117dibenkobit wants to merge 9 commits intoanomalyco:devfrom
short_description field for agents and agent details dialog#5117dibenkobit wants to merge 9 commits intoanomalyco:devfrom
Conversation
…tion (anomalyco#4825) - Rename initialAgent prop to focusedAgent for clarity - Add dynamic description truncation based on terminal width - Fix focus restoration when navigating between dialogs
Author
|
I'm also thinking about showing |
Author
|
my bad, ran the format script |
d9bc0c6 to
ad11b9d
Compare
Author
Hm, when running local prettier also adds EOL to 2 |
Collaborator
|
Yeah idk why it does that new line shit it's so annoying disregard it haha |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
Contributor
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
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.
Closes #4825
Summary
Previously, when you created an agent via
opencode agent create, thedescriptionfield was populated with a long prompt intended for the model. In/agents, this made the list view almost unreadable.This PR introduces three changes:
short_descriptionfield/agents.short_descriptionis not set, the UI falls back to a truncated version ofdescription.Agent details dialog (
Ctrl+E)whenToUse(description) text, so the list can stay compact while the full content is still accessible when needed.Dynamic description truncation
/agentsare now truncated based on the current terminal width, so they fit neatly into the dialog without overflowing.Why this approach
short_descriptiongives us a dedicated, human‑readable summary for the UI instead of trying to reuse the fullwhenToUsetext./agentsreadable across different environments and terminal sizes.Focus bug fix
While implementing the details dialog, a focus bug surfaced: switching between dialogs (e.g.,
/agents↔ agent details) caused the main input to lose focus.Root cause:
replace()could overwrite an existing valid saved focus reference.refocus()was being called even when a new dialog was about to open immediately after.Fix:
replace()from clobbering a valid saved focus reference.refocus()when a new dialog is opened right after closing the previous one.How to test
Have an agent that was created before the update (to verify backward compatibility).
Create a new agent with
short_descriptionset.Open
/agents.Confirm both agents show a visible description:
short_description.description.Verify that text is truncated correctly according to the dialog/terminal width.
Focus a native agent and verify the footer is not shown.
Focus a custom agent and check that the
Ctrl+Ehotkey is shown in the footer.Press
Ctrl+Eon a custom agent and confirm the agent details dialog opens.In the details dialog, verify that the scrollbar works with both keyboard and mouse.
Close the details dialog and confirm the
/agentsdialog reappears with the same selection preserved.Open other dialogs (e.g.,
/models,/sessions) and confirm their behavior and focus handling are unchanged.Demo