Skip to content

Commit 59a0e48

Browse files
committed
Fix basher test
1 parent fdf60ae commit 59a0e48

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

agents/__tests__/basher.test.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,11 @@ describe('commander agent', () => {
5959
expect(schema?.params?.required).not.toContain('timeout_seconds')
6060
})
6161

62-
test('has optional rawOutput parameter', () => {
62+
test('has optional what_to_summarize parameter', () => {
6363
const schema = commander.inputSchema
64-
const rawOutputProp = schema?.params?.properties?.rawOutput
65-
expect(rawOutputProp && typeof rawOutputProp === 'object' && 'type' in rawOutputProp && rawOutputProp.type).toBe('boolean')
66-
expect(schema?.params?.required).not.toContain('rawOutput')
67-
})
68-
69-
test('has prompt parameter', () => {
70-
expect(commander.inputSchema?.prompt?.type).toBe('string')
64+
const summarizeProp = schema?.params?.properties?.what_to_summarize
65+
expect(summarizeProp && typeof summarizeProp === 'object' && 'type' in summarizeProp && summarizeProp.type).toBe('string')
66+
expect(schema?.params?.required).not.toContain('what_to_summarize')
7167
})
7268
})
7369

@@ -149,7 +145,7 @@ describe('commander agent', () => {
149145
})
150146
})
151147

152-
test('yields set_output with raw result when rawOutput is true', () => {
148+
test('yields set_output with raw result when what_to_summarize is not provided', () => {
153149
const mockAgentState = createMockAgentState()
154150
const mockLogger = {
155151
debug: () => {},
@@ -161,7 +157,7 @@ describe('commander agent', () => {
161157
const generator = commander.handleSteps!({
162158
agentState: mockAgentState,
163159
logger: mockLogger as any,
164-
params: { command: 'echo hello', rawOutput: true },
160+
params: { command: 'echo hello' },
165161
})
166162

167163
// First yield is the command
@@ -190,7 +186,7 @@ describe('commander agent', () => {
190186
expect(final.done).toBe(true)
191187
})
192188

193-
test('yields STEP for model analysis when rawOutput is false', () => {
189+
test('yields STEP for model analysis when what_to_summarize is provided', () => {
194190
const mockAgentState = createMockAgentState()
195191
const mockLogger = {
196192
debug: () => {},
@@ -202,7 +198,7 @@ describe('commander agent', () => {
202198
const generator = commander.handleSteps!({
203199
agentState: mockAgentState,
204200
logger: mockLogger as any,
205-
params: { command: 'ls -la', rawOutput: false },
201+
params: { command: 'ls -la', what_to_summarize: 'list of files' },
206202
})
207203

208204
// First yield is the command
@@ -233,7 +229,7 @@ describe('commander agent', () => {
233229
const generator = commander.handleSteps!({
234230
agentState: mockAgentState,
235231
logger: mockLogger as any,
236-
params: { command: 'echo test', rawOutput: true },
232+
params: { command: 'echo test' },
237233
})
238234

239235
// First yield is the command
@@ -266,7 +262,7 @@ describe('commander agent', () => {
266262
const generator = commander.handleSteps!({
267263
agentState: mockAgentState,
268264
logger: mockLogger as any,
269-
params: { command: 'echo test', rawOutput: true },
265+
params: { command: 'echo test' },
270266
})
271267

272268
// First yield is the command

0 commit comments

Comments
 (0)