Skip to content

Fix duplicate VS session guards and handle MessagePack files in all views#480

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/implement-normal-views
Closed

Fix duplicate VS session guards and handle MessagePack files in all views#480
Copilot wants to merge 2 commits intomainfrom
copilot/implement-normal-views

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

The Visual Studio session support added in #477 introduced duplicate condition checks and left the "📄 View" action in Diagnostics broken for VS sessions — clicking it attempted to parse binary MessagePack as JSONL, producing an error popup.

Fixes

  • Duplicate guards removedstatSessionFile and estimateTokensFromSession in extension.ts each had an unreachable second isVSSessionFile check; getEditorBadgeClass and getEditorIcon in diagnostics/main.ts had the same.

  • showFormattedJsonlFile VS support — VS session files are binary MessagePack, not JSONL. Added early-exit path that decodes the file via VisualStudioDataAccess and presents it as readable JSON, consistent with the existing openRawFile handler in the log viewer:

if (this.visualStudio.isVSSessionFile(sessionFilePath)) {
    const objects = this.visualStudio.decodeSessionFile(sessionFilePath);
    // Object 0 is the session header; subsequent objects are [version, innerData] tuples
    const decodedMessages = objects.map((obj, i) => i === 0 ? obj : obj?.[1] ?? obj);
    // … open as untitled JSON document
}
  • Test coverage — added assertion for getEditorIcon('Visual Studio') === '🪟' in webview-utils.test.ts.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • teststorage.blob.core.windows.net
    • Triggering command: /opt/hostedtoolcache/node/20.20.1/x64/bin/node /opt/hostedtoolcache/node/20.20.1/x64/bin/node --require ./out/test/unit/vscode-shim-register.js --test-force-exit /home/REDACTED/work/github-copilot-token-usage/github-copilot-token-usage/out/test/unit/backend-blobUploadService.test.js (dns block)
    • Triggering command: /opt/hostedtoolcache/node/20.20.1/x64/bin/node /opt/hostedtoolcache/node/20.20.1/x64/bin/node --require ./out/test/unit/vscode-shim-register.js --test-force-exit /home/REDACTED/work/github-copilot-token-usage/github-copilot-token-usage/out/test/unit/backend-blobUploadService.test.js --noprofile (dns block)
    • Triggering command: /opt/hostedtoolcache/node/20.20.1/x64/bin/node /opt/hostedtoolcache/node/20.20.1/x64/bin/node --require ./out/test/unit/vscode-shim-register.js --test-force-exit /home/REDACTED/work/github-copilot-token-usage/github-copilot-token-usage/out/test/unit/backend-blobUploadService.test.js 3635,3690p /home/REDACTED/work/github-copilot-token-usage/github-copilot-token-usage/src/extension.ts /home/REDACTED/.cargo/bin/bash ; fs.cpSync('pacnode (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

now implement all the other views (only the normal views, not the teams dahsboard or the wizard to install that). from vs code into the visual studio views

Summary of Conversation History

User Goals

The user is working on a Visual Studio extension called "Copilot Token Tracker." They are focused on implementing features that allow users to interact with the extension through a toolbar, specifically by clicking on numbers to show an overview and addressing issues related to error popups and functionality.

Recent Agent Commands and Tool Results

  1. User Request: The user expressed a desire to implement a click action on numbers that would display an overview similar to a previous VS Code view.

  2. User Feedback: The user reported that clicking does nothing and that there is no output in the log indicating a click event was received.

  3. User Observation: The user noted that the status bar switches to "ready," suggesting that the extension is not properly transitioning to their custom panel.

  4. User Request: The user asked for functionality to be baked in for rebuilding when hitting F5.

  5. User Feedback: The user indicated that they still do not see a toolbar with an icon for the feature they are trying to implement.

  6. User Update: The user confirmed that clicking on the toolbar now works but reported receiving a popup with errors when doing so.

Recent Tool Calls and Results

  • No specific tool calls were executed in the recent interactions, but the user provided feedback on the functionality of the toolbar and the click events, indicating that the extension is partially operational but still encountering issues.

Active Work and Connection to User Goals

The agent was actively working on addressing the user's requests regarding the functionality of the toolbar and click events when the conversation shifted to error popups. The user's goal is to enhance the usability of their extension, and the recent operations connect to this goal by focusing on making the extension interactive and responsive to user actions. The user is seeking to resolve issues that prevent the extension from functioning as intended, which is critical for achieving their overall objectives with the Copilot Token Tracker.

Created from VS Code.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Implement normal views in Visual Studio extension Fix duplicate VS session guards and handle MessagePack files in all views Mar 25, 2026
Copilot AI requested a review from rajbos March 25, 2026 00:43
@rajbos
Copy link
Copy Markdown
Owner

rajbos commented Mar 25, 2026

Messed up the source branch, should have done after #482 , so closing this one.

@rajbos rajbos closed this Mar 25, 2026
@rajbos rajbos deleted the copilot/implement-normal-views branch March 25, 2026 15:34
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