Skip to content

Commit 7581495

Browse files
author
shihzu
committed
feat(agent): add short description for better UI display (anomalyco#4825)
- Added shortDescription field to Agent schema - Updated dialog-agent to display short description or auto-truncate long descriptions - Maintains backward compatibility with existing agent configurations - Auto-truncates descriptions longer than 100 characters Fixes anomalyco#4825
1 parent 48412f7 commit 7581495

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/opencode/src/agent/agent.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export namespace Agent {
2525
.object({
2626
name: z.string(),
2727
description: z.string().optional(),
28+
shortDescription: z.string().optional(),
2829
mode: z.enum(["subagent", "primary", "all"]),
2930
native: z.boolean().optional(),
3031
hidden: z.boolean().optional(),

‎packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ export function DialogAgent() {
99

1010
const options = createMemo(() =>
1111
local.agent.list().map((item) => {
12+
const displayDesc = item.shortDescription
13+
|| (item.description && item.description.length > 100
14+
? item.description.substring(0, 100) + "..."
15+
: item.description)
16+
|| ""
1217
return {
1318
value: item.name,
1419
title: item.name,
15-
description: item.native ? "native" : item.description,
20+
description: item.native ? "native" : displayDesc,
1621
}
1722
}),
1823
)

0 commit comments

Comments
 (0)