Skip to content

fix: downgrade console.error to console.debug in DocumentHistoryTracker.push()#12017

Open
octo-patch wants to merge 1 commit intocontinuedev:mainfrom
octo-patch:fix/issue-11919-ast-tracker-console-error
Open

fix: downgrade console.error to console.debug in DocumentHistoryTracker.push()#12017
octo-patch wants to merge 1 commit intocontinuedev:mainfrom
octo-patch:fix/issue-11919-ast-tracker-console-error

Conversation

@octo-patch
Copy link
Copy Markdown
Contributor

@octo-patch octo-patch commented Apr 3, 2026

Fixes #11919

Problem

Every time a user switches between text editors, onDidChangeVisibleTextEditors fires, which calls deleteChain(), which calls DocumentHistoryTracker.push() for the previously active file.

Because onDidOpenTextDocument is currently disabled (pending merge of a related PR), documents are never pre-registered via addDocument(). So push() always hits its fallback branch and logs:

ERR [Extension Host] Document <path> not found in AST tracker

This error appears on every editor switch, flooding the Extension Host output with misleading noise.

Solution

The push() fallback already handles the missing-document case correctly by calling addDocument() — no data is lost and no functionality is broken. The console.error is therefore misleading. This PR downgrades it to console.debug (with a slightly more descriptive message) so the event remains visible for debugging without polluting the Extension Host console for normal users.

Testing

  • Open two files in VS Code with the Continue extension active
  • Switch back and forth between editors
  • Verify that the "Document not found in AST tracker" error no longer appears in the Extension Host output
  • Next-edit / autocomplete functionality is unaffected

Summary by cubic

Downgraded console.error to console.debug in DocumentHistoryTracker.push() to stop noisy “Document not found in AST tracker” messages on editor switches. Behavior is unchanged (missing documents are still auto-added), logs stay useful for debugging, and this resolves #11919.

Written for commit 38334b1. Summary will update on new commits.

…er.push()

When onDidChangeVisibleTextEditors fires, deleteChain() calls push() on the
DocumentHistoryTracker for the previous request filepath. Because
onDidOpenTextDocument is currently disabled (pending PR continuedev#8364 merge),
documents are never pre-added via addDocument(), so push() always takes the
fallback path and logs a console.error on every editor switch.

The fallback in push() already handles this gracefully by calling
addDocument(), making the error log misleading noise. Downgrade it to
console.debug so it remains accessible for debugging without polluting the
Extension Host output.

Fixes continuedev#11919
@octo-patch octo-patch requested a review from a team as a code owner April 3, 2026 06:45
@octo-patch octo-patch requested review from sestinj and removed request for a team April 3, 2026 06:45
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[Extension Host] Document not found in AST tracker

1 participant