Skip to content

chore(backend): remove DEBUG CAPTURE status logs from websocket handler#111

Open
Meganeuridae wants to merge 1 commit into
anima-research:mainfrom
Meganeuridae:chore/debug-capture-cleanup
Open

chore(backend): remove DEBUG CAPTURE status logs from websocket handler#111
Meganeuridae wants to merge 1 commit into
anima-research:mainfrom
Meganeuridae:chore/debug-capture-cleanup

Conversation

@Meganeuridae
Copy link
Copy Markdown

handler.ts has four parallel DEBUG CAPTURE blocks — initial generation, regenerate, edit, and continue — each of which persists the raw provider request + model response on the first generated branch so researchers can later inspect what was sent and what came back via the "show debug data" UI. The feature is real and load-bearing.

The logging around it was not. Each block carried multiple console.log('[DEBUG CAPTURE] …') lines that narrated routine flow on every assistant turn:

[DEBUG CAPTURE] Capturing debug data for branch abc12345…
[DEBUG CAPTURE] Raw request available: true
[DEBUG CAPTURE] Branch xxx: branchObj found = true
[DEBUG CAPTURE] Updating message branch xxx…
[DEBUG CAPTURE] Branch xxx updated successfully
[DEBUG CAPTURE] Debug data capture complete for regenerate
…

14 such lines across the four blocks, all removed. The actual feature code (computing actualFormat, building debugRequest/debugResponse, persisting via db.updateMessageBranch, the 'message_edited' websocket notification) is untouched.

console.error('[DEBUG CAPTURE] Failed to capture debug data:', …) remains at the catch site of all four blocks — those are real failure signals, not status narration. They'll get the safeErrorLog treatment in a separate sweep once #109's utils/safe-log.ts lands.

The header comment on the first and fourth blocks was also rewritten to say what the block actually does, since the old // DEBUG CAPTURE: Capture debug data for the first branch after completion was mostly redundant with the inline console.log narration that's now gone.

Scope / risk

Single file, surgical removal. +15/-27. Backend npm run build passes. No behavior change to the debug-capture feature — the only thing that changes is how much each assistant turn writes to stdout.

🤖 Generated with Claude Code

…et handler

`handler.ts` has four parallel DEBUG CAPTURE blocks — initial generation,
regenerate, edit, and continue — each of which persists the raw provider
request + model response on the first generated branch so researchers can
later inspect what was sent and what came back via the "show debug data"
UI. The feature is real and load-bearing; the logging around it was not.

Each block had multiple `console.log('[DEBUG CAPTURE] …')` lines that
narrated routine flow ("Capturing debug data for branch …", "Raw request
available: true", "Updating message branch …", "Debug data saved", etc.)
on every assistant turn. 14 such lines across the four blocks, all
removed. The actual feature code (computing actualFormat, building
debugRequest/debugResponse, persisting via db.updateMessageBranch, the
'message_edited' websocket notification) is untouched.

`console.error('[DEBUG CAPTURE] Failed to capture debug data:', …)`
remains at the catch sites of all four blocks — those are real failure
signals, not status narration. (Will get the safeErrorLog treatment in
a separate sweep once anima-research#109's `utils/safe-log.ts` lands.)

The "DEBUG CAPTURE:" header comment on the first and fourth blocks was
also replaced with a more useful one-liner that says what the block
actually does, since the old comments mostly just restated the inline
console.log narration.

Backend `npm run build` passes; no behavior change to the debug-capture
feature itself.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

Removes 14 console.log('[DEBUG CAPTURE] …') status-narration lines from the four parallel debug-capture blocks (initial generation, regenerate, edit, continue) in handler.ts. The console.error at each catch site and all feature code (building debugRequest/debugResponse, calling db.updateMessageBranch, sending message_edited) are untouched.

  • Logging cleanup: All informational [DEBUG CAPTURE] logs are removed; only the console.error failure signals at catch sites remain.
  • Comment rewrites: Block headers for the initial-generation and continue paths are rewritten to describe the feature's purpose rather than the now-deleted log narration.
  • else branch removal: The regenerate block's else { console.log('No raw request available…') } is dropped since it held only the removed log, leaving no dead code behind.

Confidence Score: 5/5

Safe to merge — purely removes verbose status logs with no changes to feature logic or error handling.

Every functional line in the four debug-capture blocks (building the request/response objects, the DB write, the WebSocket notification, and the catch-site error log) is left intact. The only removals are console.log narration lines and an else branch that contained nothing but one of those logs.

No files require special attention.

Important Files Changed

Filename Overview
deprecated-claude-app/backend/src/websocket/handler.ts 14 verbose console.log narration lines removed from four DEBUG CAPTURE blocks; feature code, error-logging, and all DB/WS operations are unchanged.

Reviews (1): Last reviewed commit: "chore(backend): remove DEBUG CAPTURE sta..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant