Skip to content

Commit 11031ab

Browse files
committed
Reduce logging
1 parent c7a85aa commit 11031ab

File tree

7 files changed

+6
-31
lines changed

7 files changed

+6
-31
lines changed

cli/src/hooks/use-gravity-ad.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const useGravityAd = (): GravityAdState => {
167167
const ad = data.ad as AdResponse | null
168168

169169
logger.info(
170-
{ ad, request: { messages: adMessages } },
170+
{ ad },
171171
'[gravity] Received ad response',
172172
)
173173
return ad

cli/src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ async function main(): Promise<void> {
269269
projectRoot: root,
270270
fs: fs.promises,
271271
})
272-
logger.info({ tree }, 'Loaded file tree')
273272
setFileTree(tree)
274273
}
275274
} catch (error) {

cli/src/utils/run-state-storage.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ export function saveChatState(runState: RunState, messages: ChatMessage[]): void
7676

7777
fs.writeFileSync(runStatePath, JSON.stringify(runState, null, 2))
7878
fs.writeFileSync(messagesPath, JSON.stringify(messages, null, 2))
79-
80-
logger.debug(
81-
{ runStatePath, messagesPath, messageCount: messages.length },
82-
'Saved chat state to disk'
83-
)
8479
} catch (error) {
8580
logger.error(
8681
{

packages/agent-runtime/src/main-prompt.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ export async function mainPrompt(
103103
}
104104

105105
agentType = agentId
106-
logger.info(
107-
{
108-
agentId,
109-
promptParams,
110-
prompt: prompt?.slice(0, 50),
111-
},
112-
`Using CLI-specified agent: ${agentId}`,
113-
)
114106
} else {
115107
agentType = (
116108
{
@@ -146,7 +138,7 @@ export async function mainPrompt(
146138
fileContext,
147139
})
148140

149-
logger.debug({ agentState, output }, 'Main prompt finished')
141+
logger.debug({ output }, 'Main prompt finished')
150142

151143
return {
152144
sessionState: {

packages/agent-runtime/src/run-agent-step.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ export const runAgentStep = async (
260260
logger.debug(
261261
{
262262
iteration: iterationNum,
263-
agentId: agentState.agentId,
263+
runId: agentState.runId,
264264
model,
265265
duration: Date.now() - startTime,
266266
contextTokenCount: agentState.contextTokenCount,
267-
agentMessages: agentState.messageHistory,
267+
agentMessages: agentState.messageHistory.concat().reverse(),
268268
system,
269269
prompt,
270270
params: spawnParams,
@@ -432,7 +432,7 @@ export const runAgentStep = async (
432432
shouldEndTurn,
433433
duration: Date.now() - startTime,
434434
fullResponse,
435-
finalMessageHistoryWithToolResults: agentState.messageHistory,
435+
finalMessageHistoryWithToolResults: agentState.messageHistory.concat().reverse(),
436436
toolCalls,
437437
toolResults,
438438
agentContext,

packages/agent-runtime/src/tools/handlers/tool/suggest-followups.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,9 @@ export const handleSuggestFollowups = (async (params: {
1010
toolCall: CodebuffToolCall<'suggest_followups'>
1111
logger: Logger
1212
}): Promise<{ output: CodebuffToolOutput<'suggest_followups'> }> => {
13-
const { previousToolCallFinished, toolCall, logger } = params
13+
const { previousToolCallFinished, toolCall } = params
1414
const { followups } = toolCall.input
1515

16-
logger.debug(
17-
{
18-
followupCount: followups.length,
19-
},
20-
'Suggested followups',
21-
)
22-
2316
await previousToolCallFinished
2417
return { output: [{ type: 'json', value: { message: 'Followups suggested!' } }] }
2518
}) satisfies CodebuffToolHandlerFunction<'suggest_followups'>

packages/agent-runtime/src/tools/tool-executor.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ export function executeToolCall<T extends ToolName>(
232232
toolCallId: toolCall.toolCallId,
233233
content: output,
234234
}
235-
logger.debug(
236-
{ input, toolResult },
237-
`${toolName} tool call & result (${toolResult.toolCallId})`,
238-
)
239235

240236
onResponseChunk({
241237
type: 'tool_result',

0 commit comments

Comments
 (0)