Skip to content

Commit 22551e6

Browse files
committed
Merge branch 'main' into subscription-client
2 parents afa0869 + 78d8acf commit 22551e6

File tree

48 files changed

+2901
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2901
-1101
lines changed

.github/workflows/cli-release-prod.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,10 @@ jobs:
148148
- name: Set up Node.js for npm publishing
149149
uses: actions/setup-node@v4
150150
with:
151-
node-version: 20
151+
node-version: 24
152152
registry-url: https://registry.npmjs.org/
153153

154154
- name: Publish to npm
155155
run: |
156156
cd cli/release
157157
npm publish --access public
158-
env:
159-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

cli/release/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codebuff",
3-
"version": "1.0.603",
3+
"version": "1.0.606",
44
"description": "AI coding agent",
55
"license": "MIT",
66
"bin": {

cli/src/components/blocks/agent-branch-wrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,17 @@ export const AgentBranchWrapper = memo(
353353
(b): b is ToolContentBlock =>
354354
b.type === 'tool' && b.toolName === 'set_output',
355355
)
356-
const implementationId = setOutputBlock?.input?.implementationId as string | undefined
356+
// set_output wraps data in a 'data' property, so we need to access input.data
357+
const outputData = (setOutputBlock?.input as { data?: Record<string, unknown> })?.data
358+
const implementationId = outputData?.implementationId as string | undefined
357359
if (implementationId) {
358360
const letterIndex = implementationId.charCodeAt(0) - 65
359361
const implementors = siblingBlocks.filter(
360362
(b): b is AgentContentBlock =>
361363
b.type === 'agent' && isImplementorAgent(b),
362364
)
363365

364-
reason = setOutputBlock?.input?.reason as string | undefined
366+
reason = outputData?.reason as string | undefined
365367

366368
const selectedAgent = implementors[letterIndex]
367369
if (selectedAgent) {

cli/src/components/blocks/tool-branch.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,19 @@ export const ToolBranch = memo(
4545
}
4646

4747
const displayInfo = getToolDisplayInfo(toolBlock.toolName)
48-
const isCollapsed = toolBlock.isCollapsed ?? shouldCollapseToolByDefault(toolBlock.toolName)
48+
49+
// Check if there's a registered custom component for this tool
50+
const toolRenderConfig = renderToolComponent(toolBlock, theme, {
51+
availableWidth,
52+
indentationOffset: 0,
53+
previewPrefix: '',
54+
labelWidth: 0,
55+
})
56+
57+
// Tools without a registered component (fallback rendering) should be collapsed by default
58+
const hasRegisteredComponent = toolRenderConfig !== undefined
59+
const isCollapsed = toolBlock.isCollapsed ??
60+
(hasRegisteredComponent ? shouldCollapseToolByDefault(toolBlock.toolName) : true)
4961

5062
const inputContent = `\`\`\`json\n${JSON.stringify(toolBlock.input, null, 2)}\n\`\`\``
5163
const codeBlockLang =
@@ -67,13 +79,6 @@ export const ToolBranch = memo(
6779
? `$ ${toolBlock.input.command.trim()}`
6880
: null
6981

70-
let toolRenderConfig = renderToolComponent(toolBlock, theme, {
71-
availableWidth,
72-
indentationOffset: 0,
73-
previewPrefix: '',
74-
labelWidth: 0,
75-
})
76-
7782
const streamingPreview = isStreaming
7883
? commandPreview ?? `${sanitizePreview(firstLine)}...`
7984
: ''

cli/src/data/slash-commands.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ export const SLASHLESS_COMMAND_IDS = new Set(
160160
),
161161
)
162162

163+
/** Maximum description length for skill commands in the slash menu */
164+
const SKILL_MENU_DESCRIPTION_MAX_LENGTH = 50
165+
166+
function truncateDescription(description: string): string {
167+
if (description.length <= SKILL_MENU_DESCRIPTION_MAX_LENGTH) {
168+
return description
169+
}
170+
return description.slice(0, SKILL_MENU_DESCRIPTION_MAX_LENGTH - 1) + '…'
171+
}
172+
163173
/**
164174
* Returns SLASH_COMMANDS merged with skill commands.
165175
* Skills become slash commands that users can invoke directly.
@@ -168,7 +178,7 @@ export function getSlashCommandsWithSkills(skills: SkillsMap): SlashCommand[] {
168178
const skillCommands: SlashCommand[] = Object.values(skills).map((skill) => ({
169179
id: `skill:${skill.name}`,
170180
label: `skill:${skill.name}`,
171-
description: skill.description,
181+
description: truncateDescription(skill.description),
172182
}))
173183

174184
return [...SLASH_COMMANDS, ...skillCommands]

0 commit comments

Comments
 (0)