-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ghost: add logs to be able to track down behavior issues in ghost-text #3271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This change threads a structured logger through the ghost-text inline completions pipeline so that ghost-text behavior can be traced and correlated with GhostTextLogContext for easier diagnostics.
Changes:
- Injects
ILogService/ILoggerinto the inline completions stack (node chat lib, VS Code extension provider, and core lib) and passes it down toGhostTextandGhostTextComputer. - Extends
GhostTextComputerand related code paths to use sub-loggers and adds detailedtrace/debuglogging at key decision points (caching, async wait, network fetch, post-processing, speculative requests). - Updates tests and helper utilities to construct or retrieve
ILogService/ILoggerand call the newgetGhostText/getInlineCompletionssignatures.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/lib/node/chatLibMain.ts |
Wires ILogService into the node inline completions provider and passes it to GhostText.getInlineCompletions so lib calls participate in the new logging pipeline. |
src/extension/completions-core/vscode-node/lib/src/inlineCompletion.ts |
Extends GhostText.getInlineCompletions and its internal result helper to accept an ILogger and forward it into getGhostText, including speculative request callbacks. |
src/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.ts |
Adds a parent ILogger parameter to GhostTextComputer.getGhostText / getGhostTextWithoutAbortHandling, uses sub-loggers, and enriches logging throughout prompt building, cache usage, async waits, network calls, and result processing. |
src/extension/completions-core/vscode-node/lib/src/test/inlineCompletion.test.ts |
Adjusts tests to fetch an ILogService from the testing service collection and call GhostText.getInlineCompletions with the new logger argument. |
src/extension/completions-core/vscode-node/lib/src/prompt/test/prompt.ts |
Updates test helper to resolve ILogService and pass it into getGhostText so prompt/ghost text tests compile with the new signature. |
src/extension/completions-core/vscode-node/lib/src/ghostText/test/ghostText.test.ts |
Updates isolated ghost-text tests to obtain ILogService from the test accessor and supply it to getGhostText, including speculative call paths. |
src/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.ts (bottom getGhostText free function) |
Extends the exported getGhostText helper with an ILogger parameter and passes it to GhostTextComputer.getGhostText. |
src/extension/completions-core/vscode-node/extension/src/vscodeInlineCompletionItemProvider.ts |
Injects ILogService into the VS Code inline completion provider, introduces an ILogger field, creates a per-request sub-logger that also logs into GhostTextLogContext with timestamps, and threads the logger to GhostTextProvider. |
src/extension/completions-core/vscode-node/extension/src/ghostText/ghostTextProvider.ts |
Adds an ILogger parameter to provideInlineCompletionItems, creates a provider-specific sub-logger, and forwards it to GhostText.getInlineCompletions. |
| parentLogger: ILogger, | ||
| ): Promise<GhostTextResultWithTelemetry<[CompletionResult[], ResultType]>> { | ||
| const logger = parentLogger.createSubLogger(['GhostTextComputer', 'getGhostText']); | ||
| let start = preIssuedTelemetryDataWithExp.issuedTime; // Start before getting exp assignments |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getGhostText already creates a sub-logger with the ['GhostTextComputer', 'getGhostText'] topics and passes it as parentLogger, but getGhostTextWithoutAbortHandling calls createSubLogger with the same topics again, which will duplicate the prefix in log messages and create an extra unnecessary logger wrapper. Consider either passing the root logger into getGhostTextWithoutAbortHandling or reusing parentLogger directly here to avoid the redundant sub-logger creation.
No description provided.