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

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

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

State: open
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. This description is then displayed in the /agents command list, making it impossible to read.

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..."
}

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

Fixes #4825

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13839 **State:** open **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. This description is then displayed in the `/agents` command list, making it impossible to read. ## 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..." } ``` 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 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14838