Skip to content

Commit d4dee36

Browse files
committed
cleanup
1 parent 7dd97ee commit d4dee36

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

cli/src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ function parseArgs(): ParsedArgs {
149149
}
150150

151151
async function main(): Promise<void> {
152-
console.log()
153152
// Run OSC theme detection BEFORE anything else.
154153
// This MUST happen before OpenTUI starts because OSC responses come through stdin,
155154
// and OpenTUI also listens to stdin. Running detection here ensures stdin is clean.

common/src/actions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { z } from 'zod/v4'
22

3-
import type { CostMode } from './old-constants'
43
import type { GrantType } from './types/grant'
54
import type { MCPConfig } from './types/mcp'
65
import type { ToolMessage } from './types/messages/codebuff-message'
@@ -30,7 +29,7 @@ type ClientActionPrompt = {
3029
promptParams?: Record<string, any> // Additional json params.
3130
fingerprintId: string
3231
authToken?: string
33-
costMode?: CostMode
32+
costMode?: string
3433
sessionState: SessionState
3534
toolResults: ToolMessage[]
3635
model?: string
@@ -70,7 +69,7 @@ type ClientActionMcpToolData = {
7069
tools: {
7170
name: string
7271
description?: string
73-
inputSchema: { type: 'object'; [k: string]: unknown }
72+
inputSchema: { type: 'object';[k: string]: unknown }
7473
}[]
7574
}
7675

packages/agent-runtime/src/llm-api/gemini-with-fallbacks.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import type { Message } from '@codebuff/common/types/messages/codebuff-message'
3737
export async function promptFlashWithFallbacks(
3838
params: {
3939
messages: Message[]
40-
costMode?: CostMode
40+
costMode?: string
4141
useGPT4oInsteadOfClaude?: boolean
4242
thinkingBudget?: number
4343
useFinetunedModel?: FinetunedVertexModel | undefined
@@ -83,13 +83,7 @@ export async function promptFlashWithFallbacks(
8383
messages,
8484
model: useGPT4oInsteadOfClaude
8585
? openaiModels.gpt4o
86-
: {
87-
free: openrouterModels.openrouter_claude_3_5_haiku,
88-
normal: openrouterModels.openrouter_claude_3_5_haiku,
89-
max: openrouterModels.openrouter_claude_sonnet_4,
90-
experimental: openrouterModels.openrouter_claude_3_5_haiku,
91-
ask: openrouterModels.openrouter_claude_3_5_haiku,
92-
}[costMode ?? 'normal'],
86+
: openrouterModels.openrouter_claude_3_5_haiku,
9387
})
9488
}
9589
}

sdk/src/run.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@ export type CodebuffClientOptions = {
8282
chunk:
8383
| string
8484
| {
85-
type: 'subagent_chunk'
86-
agentId: string
87-
agentType: string
88-
chunk: string
89-
}
85+
type: 'subagent_chunk'
86+
agentId: string
87+
agentType: string
88+
chunk: string
89+
}
9090
| {
91-
type: 'reasoning_chunk'
92-
agentId: string
93-
ancestorRunIds: string[]
94-
chunk: string
95-
},
91+
type: 'reasoning_chunk'
92+
agentId: string
93+
ancestorRunIds: string[]
94+
chunk: string
95+
},
9696
) => void | Promise<void>
9797

9898
/** Optional filter to classify files before reading (runs before gitignore check) */
@@ -139,8 +139,7 @@ export type RunOptions = {
139139
previousRun?: RunState
140140
extraToolResults?: ToolMessage[]
141141
signal?: AbortSignal
142-
/** Cost mode - 'free' mode makes all agents cost 0 credits */
143-
costMode?: 'free' | 'normal' | 'max' | 'experimental' | 'ask'
142+
costMode?: string
144143
}
145144

146145
const createAbortError = (signal?: AbortSignal) => {
@@ -255,8 +254,8 @@ async function runOnce({
255254
})
256255
}
257256

258-
let resolve: (value: RunReturnType) => any = () => {}
259-
let reject: (error: any) => any = () => {}
257+
let resolve: (value: RunReturnType) => any = () => { }
258+
let reject: (error: any) => any = () => { }
260259
const promise = new Promise<RunReturnType>((res, rej) => {
261260
resolve = res
262261
reject = rej
@@ -369,8 +368,8 @@ async function runOnce({
369368
overrides: overrideTools ?? {},
370369
customToolDefinitions: customToolDefinitions
371370
? Object.fromEntries(
372-
customToolDefinitions.map((def) => [def.toolName, def]),
373-
)
371+
customToolDefinitions.map((def) => [def.toolName, def]),
372+
)
374373
: {},
375374
cwd,
376375
fs,
@@ -674,9 +673,9 @@ async function handleToolCall({
674673
value: {
675674
errorMessage:
676675
error &&
677-
typeof error === 'object' &&
678-
'message' in error &&
679-
typeof error.message === 'string'
676+
typeof error === 'object' &&
677+
'message' in error &&
678+
typeof error.message === 'string'
680679
? error.message
681680
: typeof error === 'string'
682681
? error

0 commit comments

Comments
 (0)