Skip to content

Comments

Restore error handling in CopilotCLI LocalSessionManager initialization#3883

Draft
Copilot wants to merge 9 commits intomainfrom
copilot/sub-pr-3881
Draft

Restore error handling in CopilotCLI LocalSessionManager initialization#3883
Copilot wants to merge 9 commits intomainfrom
copilot/sub-pr-3881

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

A prior commit stripped the try-catch block and TelemetryService type alias from LocalSessionManager initialization, silently swallowing errors that previously surfaced in logs.

Changes

  • Restored TelemetryService type aliasConstructorParameters<typeof internal.LocalSessionManager>[0]['telemetryService'] used for safe typed cast
  • Restored try-catch with error logging — failures during LocalSessionManager init are now logged before rethrowing
type TelemetryService = ConstructorParameters<typeof internal.LocalSessionManager>[0]['telemetryService'];

// In constructor:
this._sessionManager = new Lazy<Promise<internal.LocalSessionManager>>(async () => {
    const { internal } = await this.copilotCLISDK.getPackage();
    try {
        const telemetryService = new internal.NoopTelemetryService() as unknown as TelemetryService;
        return new internal.LocalSessionManager({ telemetryService, flushDebounceMs: undefined, settings: undefined, version: undefined });
    } catch (error) {
        this.logService.error(`Failed to initialize Copilot CLI Session Manager: ${error}`);
        throw error;
    }
});

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…zation

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Plan Mode support for Copilot CLI background agents Restore error handling in CopilotCLI LocalSessionManager initialization Feb 20, 2026
Copilot AI requested a review from DonJayamanne February 20, 2026 03:15
Base automatically changed from don/copilot-worktree-2026-02-20T02-04-16 to main February 20, 2026 04:54
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.

2 participants