Skip to content

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

Open
hobostay wants to merge 3 commits intoanomalyco:devfrom
hobostay:feat/agent-title-v2
Open

feat(agent): add optional title field for better display in agent lists#13839
hobostay wants to merge 3 commits intoanomalyco:devfrom
hobostay:feat/agent-title-v2

Conversation

@hobostay
Copy link
Contributor

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

hobostay and others added 2 commits February 16, 2026 20:11
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent description used in /agent command are cutoff

1 participant