Skip to content

Commit a4ee093

Browse files
committed
chore: remove debug logs before PR submission
1 parent 60bb2d4 commit a4ee093

4 files changed

Lines changed: 0 additions & 10 deletions

File tree

lib/hooks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export function createSystemPromptHandler(
6262
) => {
6363
if (input.model?.limit?.context) {
6464
state.modelContextLimit = input.model.limit.context
65-
try { require("fs").appendFileSync("/tmp/dcp-debug.log", `[systemPromptHandler] ses=${state.sessionId?.slice(-8)} modelContextLimit=${state.modelContextLimit} raw_limit=${JSON.stringify(input.model.limit)}\n`) } catch(_e){}
6665
}
6766

6867
if (state.isSubAgent && !config.experimental.allowSubAgents) {

lib/messages/inject/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ export function isContextOverLimits(
187187
}
188188
}
189189

190-
// [DEBUG] Log limit calculation for diagnosis
191-
try { require("fs").appendFileSync("/tmp/dcp-debug.log", `[isContextOverLimits] ses=${state.sessionId?.slice(-8)} currentTokens=${currentTokens} modelContextLimit=${state.modelContextLimit} minLimit=${minContextLimit} maxLimit=${maxContextLimit}(+${summaryTokenExtension}buf) overMin=${overMinLimit} overMax=${overMaxLimit}\n`) } catch(_e){}
192-
193190
return {
194191
overMaxLimit,
195192
overMinLimit,

lib/state/persistence.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export async function saveSessionState(
116116
}
117117

118118
await writePersistedSessionState(sessionState.sessionId, state, logger)
119-
try { require("fs").appendFileSync("/tmp/dcp-debug.log", `[saveSessionState] sessionId=${sessionState.sessionId} messageIds_byRawId=${Object.keys(state.messageIds.byRawId).length} messageIds_byRef=${Object.keys(state.messageIds.byRef).length} lastCompaction=${state.lastCompaction}\n`) } catch(_e){}
120119
}
121120

122121
export async function loadSessionState(

lib/token-utils.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ export function getCurrentTokenUsage(state: SessionState, messages: WithParts[])
4343
// Anthropic-style: input already includes the full context
4444
contextTokens = input + output + reasoning
4545
} else {
46-
// No input tokens reported, use cacheRead as fallback
4746
contextTokens = cacheRead || 0
4847
}
4948

50-
// [DEBUG] Log token breakdown for diagnosis
51-
try { require("fs").appendFileSync("/tmp/dcp-debug.log", `[getCurrentTokenUsage] ses=${state.sessionId?.slice(-8)} id=${msg.info.id.slice(-8)} tokens={input:${input}, output:${output}, reasoning:${reasoning}, cacheRead:${cacheRead}, cacheWrite:${cacheWrite}} contextTokens=${contextTokens} modelContextLimit=${state.modelContextLimit}\n`) } catch(_e){}
5249
return contextTokens
5350
}
5451

@@ -63,8 +60,6 @@ export function getCurrentTokenUsage(state: SessionState, messages: WithParts[])
6360
}
6461
}
6562
}
66-
// [DEBUG] Log fallback estimation
67-
try { require("fs").appendFileSync("/tmp/dcp-debug.log", `[getCurrentTokenUsage FALLBACK] ses=${state.sessionId?.slice(-8)} estimated=${estimated} modelContextLimit=${state.modelContextLimit} messages=${messages.length}\n`) } catch(_e){}
6863
return estimated
6964
}
7065

0 commit comments

Comments
 (0)