[PR #13834] feat(agent): add optional title field for better display in agent lists #14831

Closed
opened 2026-02-16 18:19:35 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13834

State: closed
Merged: No


Summary

This PR adds an optional title field 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 (instructing the model when to use the agent). This description is then displayed in the /agents command list, making it impossible to read.

Example from issue:
unreadable agent list

The Solution

Added optional title field to Agent schema:

  • Recommended length: 2-5 words
  • Used for display in agent lists
  • Falls back to truncated description if not provided
  • Full description still used for AI context

Updated UI logic with fallback chain:

  1. Use title if provided
  2. Otherwise truncate description to 60 characters with "..." suffix
  3. Fall back to agent name if neither exists

Example Usage

{
  \"title\": \"Database Query Expert\",
  \"description\": \"This agent specializes in writing and optimizing SQL queries for PostgreSQL, MySQL, and SQLite databases. It can help with query optimization, indexing strategies, and complex joins...\"
}

In the agent list:

  • Before: Shows full description (unreadable)
  • After: Shows "Database Query Expert"

Backward Compatibility

Existing agents work without changes
If title is not provided, description is truncated to 60 chars
No breaking changes to existing agent configurations

Test plan

  • Added title field to Agent schema
  • Updated agent dialog UI to use title with fallback logic
  • Added truncate helper function
  • Backward compatible with existing agents

Fixes #4825

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13834 **State:** closed **Merged:** No --- ## Summary This PR adds an optional `title` field 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 (instructing the model when to use the agent). This description is then displayed in the `/agents` command list, making it impossible to read. Example from issue: ![unreadable agent list](https://github.com/user-attachments/assets/789f0c50-f291-4471-b6e0-1e915e5e0723) ## The Solution **Added optional `title` field** to Agent schema: - Recommended length: 2-5 words - Used for display in agent lists - Falls back to truncated description if not provided - Full description still used for AI context **Updated UI logic** with fallback chain: 1. Use `title` if provided 2. Otherwise truncate `description` to 60 characters with "..." suffix 3. Fall back to agent name if neither exists ## Example Usage ```json { \"title\": \"Database Query Expert\", \"description\": \"This agent specializes in writing and optimizing SQL queries for PostgreSQL, MySQL, and SQLite databases. It can help with query optimization, indexing strategies, and complex joins...\" } ``` In the agent list: - **Before**: Shows full description (unreadable) - **After**: Shows "Database Query Expert" ## Backward Compatibility ✅ Existing agents work without changes ✅ If `title` is not provided, description is truncated to 60 chars ✅ No breaking changes to existing agent configurations ## Test plan - [x] Added `title` field to Agent schema - [x] Updated agent dialog UI to use title with fallback logic - [x] Added truncate helper function - [x] Backward compatible with existing agents Fixes #4825 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:19:35 -05:00
yindo closed this issue 2026-02-16 18:19:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14831