feat(agent): add optional title field for better display in agent lists#13839
Open
hobostay wants to merge 3 commits intoanomalyco:devfrom
Open
feat(agent): add optional title field for better display in agent lists#13839hobostay wants to merge 3 commits intoanomalyco:devfrom
hobostay wants to merge 3 commits intoanomalyco:devfrom
Conversation
This PR addresses issue anomalyco#4825 where agent descriptions are too long and unreadable in the `/agents` command list. **Changes:** - Added optional `title` field to Agent config schema (recommended: 2-5 words) - Updated agent dialog UI to prioritize title over description - Added fallback logic: 1. Use `title` if provided 2. Otherwise truncate `description` to 60 characters 3. Fall back to agent name if neither exists **Benefits:** - Agent lists are now readable with concise titles - Long descriptions can still be used for AI context - Backward compatible - existing agents work without changes - Users can optionally add `title` to new or existing agents **Example:** ```json { "title": "Database Query Expert", "description": "This agent specializes in writing and optimizing SQL queries..." } ``` In the agent list, this will show as "Database Query Expert" instead of the full description. Fixes anomalyco#4825 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The `title` field was added to the Agent schema but wasn't included in the `knownKeys` set in the transform function. This caused TypeScript to fail when accessing `item.title` in the agent dialog component. **Changes:** - Added "title" to the knownKeys set in Agent transform function - This ensures title is properly recognized as a valid agent property Fixes typecheck error in PR anomalyco#13834 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The SDK's Agent type definition was missing the `title` field, causing TypeScript errors when accessing item.title in the agent dialog component. **Changes:** - Added optional `title?: string` field to Agent type in SDK This aligns the SDK type with the config schema definition where title was already added. Fixes typecheck failure in PR anomalyco#13839 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
This PR adds an optional
titlefield to agent configuration for better display in agent lists, addressing issue #4825 where agent descriptions are too long and unreadable.The Problem
When creating agents with
opencode agent create, the generated description is very extensive. This description is then displayed in the/agentscommand list, making it impossible to read.The Solution
Added optional
titlefield to Agent schema:Updated UI logic with fallback chain:
titleif provideddescriptionto 60 characters with "..." suffixExample Usage
{ "title": "Database Query Expert", "description": "This agent specializes in writing and optimizing SQL queries..." }In the agent list:
Backward Compatibility
✅ Existing agents work without changes
✅ If
titleis not provided, description is truncated to 60 chars✅ No breaking changes to existing agent configurations
Fixes #4825
🤖 Generated with Claude Code