Skip to content

Commit b9295e1

Browse files
committed
Reduce cli log spam a lot
1 parent 5be370f commit b9295e1

File tree

2 files changed

+8
-117
lines changed

2 files changed

+8
-117
lines changed

cli/src/hooks/use-auth-query.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ export async function validateApiKey({
4545
}: ValidateAuthParams): Promise<ValidatedUserInfo> {
4646
const requestedFields = ['id', 'email'] as const
4747

48-
logger.info(
49-
{
50-
apiKeyPrefix: apiKey.substring(0, 10) + '...',
51-
fields: requestedFields,
52-
},
53-
'🔐 Validating API key via getUserInfoFromApiKey',
54-
)
55-
5648
const authResult = await getUserInfoFromApiKey({
5749
apiKey,
5850
fields: requestedFields,
@@ -64,14 +56,6 @@ export async function validateApiKey({
6456
throw new Error('Invalid API key')
6557
}
6658

67-
logger.info(
68-
{
69-
userId: authResult.id,
70-
email: authResult.email,
71-
},
72-
'✅ API key validated successfully',
73-
)
74-
7559
return authResult
7660
}
7761

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

Lines changed: 8 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ export const useSendMessage = ({
423423
return
424424
}
425425

426-
logger.info({ prompt: content }, 'Starting real API request')
427-
428426
const aiMessageId = `ai-${Date.now()}-${Math.random().toString(16).slice(2)}`
429427
const aiMessage: ChatMessage = {
430428
id: aiMessageId,
@@ -449,14 +447,6 @@ export const useSendMessage = ({
449447
update.type === 'text'
450448
? update.content.slice(0, 120)
451449
: JSON.stringify({ toolName: update.toolName }).slice(0, 120)
452-
logger.info(
453-
{
454-
agentId,
455-
updateType: update.type,
456-
preview,
457-
},
458-
'updateAgentContent invoked',
459-
)
460450
queueMessageUpdate((prev) =>
461451
prev.map((msg) => {
462452
if (msg.id === aiMessageId && msg.blocks) {
@@ -505,13 +495,6 @@ export const useSendMessage = ({
505495
updatedBlocks.push({ type: 'text', content: text })
506496
}
507497

508-
logger.info(
509-
{
510-
agentId,
511-
length: text.length,
512-
},
513-
'Agent block text replaced',
514-
)
515498
return {
516499
...block,
517500
content: text,
@@ -537,29 +520,13 @@ export const useSendMessage = ({
537520
content: lastBlock.content + text,
538521
}
539522
const updatedContent = (block.content ?? '') + text
540-
logger.info(
541-
{
542-
agentId,
543-
appendedLength: text.length,
544-
totalLength: updatedContent.length,
545-
},
546-
'Agent block text appended',
547-
)
548523
return {
549524
...block,
550525
content: updatedContent,
551526
blocks: [...agentBlocks.slice(0, -1), updatedLastBlock],
552527
}
553528
} else {
554529
const updatedContent = (block.content ?? '') + text
555-
logger.info(
556-
{
557-
agentId,
558-
appendedLength: text.length,
559-
totalLength: updatedContent.length,
560-
},
561-
'Agent block text started',
562-
)
563530
return {
564531
...block,
565532
content: updatedContent,
@@ -594,16 +561,6 @@ export const useSendMessage = ({
594561
return
595562
}
596563

597-
const fullText = rootStreamBufferRef.current ?? ''
598-
logger.info(
599-
{
600-
chunkLength: delta.length,
601-
fullLength: fullText.length,
602-
preview: delta.slice(0, 100),
603-
},
604-
'appendRootTextChunk invoked',
605-
)
606-
607564
queueMessageUpdate((prev) =>
608565
prev.map((msg) => {
609566
if (msg.id !== aiMessageId) {
@@ -745,13 +702,14 @@ export const useSendMessage = ({
745702
})
746703
} else {
747704
if (rootStreamSeenRef.current) {
748-
logger.info(
749-
{
750-
textPreview: text.slice(0, 100),
751-
textLength: text.length,
752-
},
753-
'Skipping root text event (stream already handled)',
754-
)
705+
// Disabled noisy log
706+
// logger.info(
707+
// {
708+
// textPreview: text.slice(0, 100),
709+
// textLength: text.length,
710+
// },
711+
// 'Skipping root text event (stream already handled)',
712+
// )
755713
return
756714
}
757715
const previous = rootStreamBufferRef.current ?? ''
@@ -1074,15 +1032,6 @@ export const useSendMessage = ({
10741032

10751033
if (event.type === 'tool_call' && event.toolCallId) {
10761034
const { toolCallId, toolName, input, agentId } = event
1077-
logger.info(
1078-
{
1079-
toolCallId,
1080-
toolName,
1081-
agentId: agentId || 'ROOT',
1082-
hasAgentId: !!agentId,
1083-
},
1084-
'tool_call event received',
1085-
)
10861035

10871036
if (toolName === 'spawn_agents' && input?.agents) {
10881037
const agents = Array.isArray(input.agents) ? input.agents : []
@@ -1095,15 +1044,6 @@ export const useSendMessage = ({
10951044
})
10961045
})
10971046

1098-
logger.info(
1099-
{
1100-
toolCallId,
1101-
agentCount: agents.length,
1102-
agentTypes: agents.map((a: any) => a.agent_type),
1103-
},
1104-
'setMessages: spawn_agents tool call',
1105-
)
1106-
11071047
applyMessageUpdate((prev) =>
11081048
prev.map((msg) => {
11091049
if (msg.id !== aiMessageId) {
@@ -1147,26 +1087,8 @@ export const useSendMessage = ({
11471087
return
11481088
}
11491089

1150-
logger.info(
1151-
{
1152-
toolName,
1153-
toolCallId,
1154-
agentId: agentId || 'none',
1155-
},
1156-
'setMessages: tool_call event',
1157-
)
1158-
11591090
// If this tool call belongs to a subagent, add it to that agent's blocks
11601091
if (agentId) {
1161-
logger.info(
1162-
{
1163-
agentId,
1164-
toolName,
1165-
toolCallId,
1166-
},
1167-
'setMessages: tool_call for subagent',
1168-
)
1169-
11701092
applyMessageUpdate((prev) =>
11711093
prev.map((msg) => {
11721094
if (msg.id !== aiMessageId || !msg.blocks) {
@@ -1241,15 +1163,6 @@ export const useSendMessage = ({
12411163
Array.isArray(firstOutputValue) &&
12421164
firstOutputValue.some((v: any) => v?.agentName || v?.agentType)
12431165

1244-
logger.info(
1245-
{
1246-
toolCallId,
1247-
isSpawnAgentsResult,
1248-
firstOutputValue: firstOutputValue ? 'array' : 'not array',
1249-
},
1250-
'setMessages: tool_result event',
1251-
)
1252-
12531166
if (isSpawnAgentsResult && Array.isArray(firstOutputValue)) {
12541167
applyMessageUpdate((prev) =>
12551168
prev.map((msg) => {
@@ -1367,12 +1280,6 @@ export const useSendMessage = ({
13671280
},
13681281
})
13691282

1370-
logger.info(
1371-
{
1372-
credits: actualCredits,
1373-
},
1374-
'SDK client.run() completed successfully',
1375-
)
13761283
setIsStreaming(false)
13771284
setCanProcessQueue(true)
13781285
updateChainInProgress(false)

0 commit comments

Comments
 (0)