Skip to content

[codex] feat(vscode): persist prompt logs#12019

Open
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-11669-vscode-prompt-logging
Open

[codex] feat(vscode): persist prompt logs#12019
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-11669-vscode-prompt-logging

Conversation

@yzlu0917
Copy link
Copy Markdown

@yzlu0917 yzlu0917 commented Apr 3, 2026

Summary

  • add a VS Code prompt logging helper that writes core.llmLogger output to ~/.continue/logs/prompt.log
  • register the helper during VsCodeExtension activation and dispose the write stream when the extension unloads
  • add a regression test covering prompt log stream creation and cleanup

Why

The binary entrypoint already persists prompt logs to disk, but the VS Code extension runs core in-process and never wired LLMLogFormatter to a file stream. That meant users running Continue only through the VS Code extension had no file-based prompt.log output for debugging model inputs and outputs.

Validation

  • ran npm test -- src/extension/setupPromptLogging.vitest.ts in extensions/vscode
  • ran git diff --check
  • attempted npm run tsc:check in extensions/vscode, but it still fails on existing unrelated repo issues (core/llm/llms/OpenRouter.ts export mismatch and missing generated src/.buildTimestamp)

Closes #11669


Summary by cubic

Persist prompt logs in the VS Code extension by writing core.llmLogger output to ~/.continue/logs/prompt.log. Matches Linear 11669 to give extension users the same file-based prompt debugging as the binary.

  • New Features
    • Add setupPromptLogging to pipe llmLogger through LLMLogFormatter to ~/.continue/logs/prompt.log.
    • Register in VsCodeExtension activation and dispose the stream on unload; includes a test for stream creation and cleanup.

Written for commit bc461a1. Summary will update on new commits.

@yzlu0917 yzlu0917 requested a review from a team as a code owner April 3, 2026 06:57
@yzlu0917 yzlu0917 requested review from sestinj and removed request for a team April 3, 2026 06:57
@dosubot dosubot bot added the size:M This PR changes 30-99 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 3 files

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

if (options.workspaceDirectory) {
const target = options.workspaceDirectory.toLowerCase();
sessions = sessions.filter(
(session) =>
typeof session.workspaceDirectory === "string" &&

P2 Badge Filter remote sessions when workspaceDirectory is set

workspaceDirectory filtering is only applied in HistoryManager.list, which operates on local sessions, while core/core.ts still appends listRemoteSessions() results unconditionally and applies limit after merging. In signed-in environments with remote sessions enabled, a workspace-scoped history/list call can return unrelated remote sessions (their workspaceDirectory is empty) and the final slice can hide matching local sessions.


new LLMLogFormatter(llmLogger, output);
return {
dispose() {
output.end();

P2 Badge Unsubscribe prompt logger before closing its stream

setupPromptLogging ends the file stream on dispose but never detaches the LLMLogFormatter listener it registers on llmLogger. If log events arrive after disposal (for example, an in-flight request during extension reload/deactivation), the formatter can write to an ended stream (ERR_STREAM_WRITE_AFTER_END), and repeated activations can accumulate stale listeners because there is no unsubscribe path.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

VS Code extension has no file-based prompt logging

1 participant