Skip to content

Commit a3a41c6

Browse files
committed
Merge origin/main into branch; keep upstream visual tweaks and our Button wrapper behavior in BuildModeButtons
2 parents c770d3f + 2dc6a12 commit a3a41c6

File tree

7 files changed

+201
-142
lines changed

7 files changed

+201
-142
lines changed

.agents/base2/base2.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,23 @@ It should not include:
289289
290290
This is more like an extremely short PRD which describes the end result of what the user wants. Think of it like fleshing out the user's prompt to make it more precise, although it should be as short as possible.
291291
292-
## Questions
292+
## Follow-up questions
293293
294-
After closing the <PLAN> tags, the last optional section is Questions, which is a Questions header with a numbered list of questions and alternate choices demarcated by letters.
294+
After closing the <PLAN> tags, the last optional section is Follow-up questions, which has a numbered list of questions and alternate choices demarcated by letters to clarify and improve upon the spec. These questions are optional for to complete for the user.
295295
296-
For example, here is a nice short question, where the options are helpfully written out for the user:
296+
For example, here is a nice short follow-up question, where the options are helpfully written out for the user, with the answers a) and b) indented with two spaces for readability:
297297
298-
Questions:
298+
<example>
299+
## Optional follow-up questions:
299300
300301
1. Do you want to:
301-
a) (DEFAULT) Keep Express and integrate Bun WebSockets
302+
a) (CURRENT) Keep Express and integrate Bun WebSockets
302303
b) Migrate the entire HTTP server to Bun.serve()
304+
</example>
303305
304306
Try to have as few questions as possible (even none), and focus on the most important decisions or assumptions that it would be helpful to clarify with the user.
305-
You should also let them know what you plan to do by default, and let them know that they can choose a different option if they want to.
307+
308+
You should also let them know what the plan currently does by default by labeling that option with "(CURRENT)", and let them know that they can choose a different option if they want to.
306309
307310
The questions section should be last and there should be no summary or further elaboration. Just end your turn.
308311

cli/src/components/build-mode-buttons.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { ChatTheme } from '../types/theme-system'
33
import { BORDER_CHARS } from '../utils/ui-constants'
44
import { useTerminalDimensions } from '../hooks/use-terminal-dimensions'
55
import { Button } from './button'
6+
67
export const BuildModeButtons = ({
78
theme,
89
onBuildFast,
@@ -17,21 +18,20 @@ export const BuildModeButtons = ({
1718
)
1819
const { terminalWidth } = useTerminalDimensions()
1920
const isNarrow = terminalWidth < 55
21+
2022
return (
2123
<box
2224
style={{
23-
flexDirection: 'row',
24-
gap: 1,
25+
flexDirection: 'column',
26+
gap: 0,
2527
paddingTop: 0,
2628
paddingBottom: 0,
2729
paddingLeft: 1,
28-
alignItems: 'center',
29-
justifyContent: 'space-between',
3030
}}
3131
>
3232
{isNarrow ? null : (
33-
<text style={{ wrapMode: 'none' }} selectable={false}>
34-
<span fg={theme.secondary}>Ready to build?</span>
33+
<text style={{ wrapMode: 'none' }}>
34+
<span fg={theme.secondary}>Choose an option to build this plan:</span>
3535
</text>
3636
)}
3737
<box

cli/src/hooks/use-send-message.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { has, isEqual } from 'lodash'
22
import { useCallback, useEffect, useRef } from 'react'
33

44
import { getCodebuffClient, formatToolOutput } from '../utils/codebuff-client'
5-
import { MAIN_AGENT_ID, shouldHideAgent } from '../utils/constants'
5+
import {
6+
MAIN_AGENT_ID,
7+
shouldHideAgent,
8+
shouldCollapseByDefault,
9+
} from '../utils/constants'
610
import { createValidationErrorBlocks } from '../utils/create-validation-error-blocks'
711
import { getErrorObject } from '../utils/error'
812
import { formatTimestamp } from '../utils/helpers'
@@ -1130,10 +1134,13 @@ export const useSendMessage = ({
11301134
setCollapsedAgents((prev) => {
11311135
const next = new Set(prev)
11321136
next.delete(tempId)
1133-
// Only collapse if parent is NOT main agent (i.e., it's a nested agent)
1137+
// Collapse if:
1138+
// 1. Parent is NOT main agent (nested agent), OR
1139+
// 2. Agent type is in the collapsed-by-default list
11341140
if (
1135-
event.parentAgentId &&
1136-
event.parentAgentId !== MAIN_AGENT_ID
1141+
(event.parentAgentId &&
1142+
event.parentAgentId !== MAIN_AGENT_ID) ||
1143+
shouldCollapseByDefault(event.agentType)
11371144
) {
11381145
next.add(event.agentId)
11391146
}
@@ -1233,10 +1240,13 @@ export const useSendMessage = ({
12331240
)
12341241

12351242
setStreamingAgents((prev) => new Set(prev).add(event.agentId))
1236-
// Only collapse if parent is NOT main agent (i.e., it's a nested agent)
1243+
// Collapse if:
1244+
// 1. Parent is NOT main agent (nested agent), OR
1245+
// 2. Agent type is in the collapsed-by-default list
12371246
if (
1238-
event.parentAgentId &&
1239-
event.parentAgentId !== MAIN_AGENT_ID
1247+
(event.parentAgentId &&
1248+
event.parentAgentId !== MAIN_AGENT_ID) ||
1249+
shouldCollapseByDefault(event.agentType)
12401250
) {
12411251
setCollapsedAgents((prev) =>
12421252
new Set(prev).add(event.agentId),

cli/src/hooks/use-suggestion-menu-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const useSuggestionMenuHandlers = ({
179179
selectAgentItem(agentSelectedIndex) || selectAgentItem(0)
180180

181181
if (key.name === 'down' && !hasModifier(key)) {
182-
if (agentSelectedIndex === totalMatches - 1) return false
182+
if (agentSelectedIndex === totalMatches - 1) return true
183183
setAgentSelectedIndex((prev) => prev + 1)
184184
return true
185185
}

cli/src/utils/constants.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ export const shouldHideAgent = (agentId: string): boolean => {
88
return HIDDEN_AGENT_IDS.some((hiddenId) => agentId.includes(hiddenId))
99
}
1010

11+
// Agent IDs that should be collapsed by default when they start
12+
export const COLLAPSED_BY_DEFAULT_AGENT_IDS = ['file-picker'] as const
13+
14+
/**
15+
* Check if an agent should be collapsed by default
16+
*/
17+
export const shouldCollapseByDefault = (agentType: string): boolean => {
18+
return COLLAPSED_BY_DEFAULT_AGENT_IDS.some((collapsedId) =>
19+
agentType.includes(collapsedId),
20+
)
21+
}
22+
1123
/**
1224
* The parent agent ID for all root-level agents
1325
*/

npm-app/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.509",
3+
"version": "1.0.510",
44
"description": "AI coding agent",
55
"license": "MIT",
66
"bin": {

0 commit comments

Comments
 (0)