Skip to content

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

Closed
hobostay wants to merge 5 commits intoanomalyco:devfrom
hobostay:feat/agent-title-field
Closed

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

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 (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

hobostay and others added 4 commits February 16, 2026 19:18
This commit fixes multiple translation issues in the Russian zen.mdx file:

**Critical fixes:**
- Change "Открытый код" to "OpenCode" (product name should not be translated)
- Change "opencode" to "OpenCode" throughout the document for consistency
- Fix broken sentence structure on line 24-25
- Fix "обслуживаются. правильно." to "обслуживаются правильно."
- Fix broken instruction text in "How it works" section

**Terminology improvements:**
- Change "агентов кодирования" to "кодинг-агентов" (more natural Russian)
- Change "курировать модели" to "выбирать модели" (correct word choice)
- Change "автоматическая перезагрузка" to "автопополнение" (correct meaning)
- Change "Принесите свой ключ" to "Использование собственных API-ключей" (more professional)
- Change "Дзен" to "Zen" (product name consistency)

**Content updates:**
- Add missing GLM 5 model to endpoint table
- Add missing MiniMax M2.5 models to endpoint table
- Update pricing table with new GLM 5 and MiniMax M2.5 entries
- Update free models list to match current offering
- Update privacy section to remove deprecated models
- Fix grammar error "Мы будем скоро поделимся" to "Мы вскоре поделимся"

These changes improve readability, consistency, and accuracy of the Russian
translation while aligning it with the English source document.

Fixes anomalyco#13808

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit adds a comprehensive keybinds reference section to the
keybinds documentation, making it easier for users to understand what
each keybind does.

**Changes:**
- Added "Keybinds reference" section after the config example
- Organized keybinds into logical categories:
  - Application & UI (13 keybinds)
  - Session management (17 keybinds)
  - Messages & navigation (17 keybinds)
  - Model & agent management (12 keybinds)
  - Input editing (6 keybinds)
  - Cursor movement (12 keybinds)
  - Text selection (11 keybinds)
  - Text deletion (7 keybinds)
  - History (2 keybinds)
- Each entry includes the keybind name, default value, and description
- Descriptions are sourced directly from the config schema definitions

This addresses issue anomalyco#13792 where users requested better documentation
of keybind actions alongside their default values.

Fixes anomalyco#13792

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The `description` parameter was marked as required in the schema but was
not properly exposed to the AI model, causing ALL bash commands to fail
with a Zod validation error.

**Changes:**
- Made `description` parameter optional by adding `.optional()`
- Added fallback to `params.command` when description is not provided
- This affects 4 locations where description was used:
  - Initial metadata setup (line 184)
  - Metadata updates during command execution (line 194)
  - Return value title (line 259)
  - Return value metadata (line 263)

**Impact:**
- Bash commands now work without requiring the description parameter
- When description is not provided, it defaults to the command string
- Backward compatible: existing calls with description still work

**Root cause:**
The bash tool defined `description` as a required `z.string()` but the
tool schema exposed to the AI did not include this parameter. This meant
the AI had no way to know it needed to pass this field, resulting in
validation errors for every bash call.

Fixes anomalyco#13146

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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>
hobostay added a commit to hobostay/opencode that referenced this pull request Feb 16, 2026
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>
hobostay added a commit to hobostay/opencode that referenced this pull request Feb 16, 2026
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 `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>
@hobostay hobostay force-pushed the feat/agent-title-field branch from 1300aef to 7502137 Compare February 16, 2026 11:52
hobostay added a commit to hobostay/opencode that referenced this pull request Feb 16, 2026
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>
@hobostay
Copy link
Contributor Author

Closing this PR as it contains unrelated commits. Replaced with #13837 which has only agent title changes.

@hobostay hobostay closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent description used in /agent command are cutoff

1 participant

Comments