⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Description

OAuth authentication metadata discovery code was tightly coupled to MCP implementation in extHostMcp.ts. This refactoring extracts it to a reusable platform module.

Changes

  • Created vs/platform/oauth/common/oauthMetadata.ts

    • Moved IAuthMetadata, AuthMetadata, createAuthMetadata()
    • Moved IAuthResourceMetadataSource, IAuthServerMetadataSource, IAuthMetadataSource enums
    • Moved parseWWWAuthenticateHeaderForChallenges() helper
  • Updated extHostMcp.ts

    • Removed ~240 lines of OAuth metadata code
    • Imports from new platform module
  • Updated extHost.protocol.ts

    • Re-exports enums from new location for backward compatibility
  • Updated test imports to use new location

Rationale

Platform-level OAuth metadata discovery is now accessible without MCP dependencies, enabling reuse across authentication scenarios beyond MCP servers.

Original prompt

Start implementation

[Chronological Review: The conversation began with the user requesting to move code from the `extHostMcp.ts` file to a new `oauthMetadata.ts` file. The user emphasized the need for good test coverage. The user then refined their request to create the new file in `vs/platform/oauth/common/oauthMetadata.ts`, move enums from `extHost.protocol.ts` to this new file, and mimic types for later adjustments. The user also requested to directly import from the new location.]

[Intent Mapping:

  1. "Now that all of this is not MCP Specific can we move it into an oauthMetadata.ts file next to #file:oauth.ts" - User wants to refactor code for better organization.
  2. "this is a good point. Instead, lets create a file in vs/platform/oauth/common/oauthMetadata.ts" - User specifies the new file location.
  3. "those enums in extHost.protocol.ts should be moved to this new file" - User requests specific code to be relocated.
  4. "mimick those types and I'll deal with those later" - User indicates a temporary solution for type handling.
  5. "directly import from the new location" - User wants to ensure the new file is correctly integrated.]

[Technical Inventory:

  • File: extHostMcp.ts - Contains MCP specific code that needs refactoring.
  • New File: oauthMetadata.ts - Intended to hold OAuth-related metadata.
  • File: extHost.protocol.ts - Contains enums that need to be moved to the new file.]

[Code Archaeology:

  • extHostMcp.ts: The current file being modified.
  • oauthMetadata.ts: New file to be created.
  • extHost.protocol.ts: Source of enums to be relocated.]

[Progress Assessment:

  • Completed: User has outlined the structure and purpose of the new file and specified the relocation of enums.
  • Pending: Actual code movement and integration into the new file, ensuring test coverage.]

[Context Validation: All necessary context for continuing the refactoring process is captured, including file locations and user intentions.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested to create a new file and move specific enums.
  • Tool Results Summary: No tool results were generated as the conversation focused on user requests and intentions.
  • Pre-Summary State: The agent was actively discussing the refactoring of code from extHostMcp.ts to oauthMetadata.ts when the token budget was exceeded.
  • Operation Context: The commands were executed to align the code structure with user goals of better organization and maintainability.]
1. Conversation Overview: - Primary Objectives: - "Now that all of this is not MCP Specific can we move it into an oauthMetadata.ts file next to #file:oauth.ts" - "this is a good point. Instead, lets create a file in vs/platform/oauth/common/oauthMetadata.ts" - "those enums in extHost.protocol.ts should be moved to this new file" - "mimick those types and I'll deal with those later" - "directly import from the new location" - Session Context: The conversation focused on refactoring code from `extHostMcp.ts` to a new file `oauthMetadata.ts`, with specific instructions on moving enums and ensuring proper imports. - User Intent Evolution: The user initially wanted to move code but refined their request to specify the new file's location and the need for type handling.
  1. Technical Foundation:
  • File: extHostMcp.ts: Contains MCP specific code that needs to be refactored.
  • New File: oauthMetadata.ts: Intended to hold OAuth-related metadata.
  • File: extHost.protocol.ts: Contains enums that need to be moved to the new file.
  1. Codebase Status:
  • File Name: extHostMcp.ts
    • Purpose: Contains MCP specific code.
    • Current State: User is in the process of refactoring this file.
    • Key Code Segments: Specific code to be moved to oauthMetadata.ts.
    • Dependencies: Relies on enums from extHost.protocol.ts.
  • File Name: oauthMetadata.ts
    • Purpose: To hold OAuth-related metadata.
    • Current State: To be created based on user requests.
    • Key Code Segments: Will include enums from extHost.protocol.ts.
  1. Problem Resolution:
  • Issues Encountered: Need for better organization of OAuth-related code.
  • Solutions Implemented: User has outlined a plan for refactoring.
  • Debugging Context: No specific debugging issues were mentioned.
  • Lessons Learned: Importance of organizing code for maintainability.
  1. Progress Tracking:
  • Completed Tasks: User has specified the new file structure and relocation of enums.
  • Partially Complete Work: Actual code movement and integration into the new file is pending.
  • Validated Outcomes: None yet, as the refactoring process is still in progress.
  1. Active Work State:
  • Current Focus: Refactoring code from extHostMcp.ts to oauthMetadata.ts.
  • Recent Context: User has been outlining the steps for moving code and ensuring proper imports.
  • Working Code: Discussion focused on the structure and content of oauthMetadata.ts.
  • Immediate Context: User was detailing the relocat...

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Move code to oauthMetadata file and ensure test coverage Refactor OAuth metadata from MCP to platform layer Jan 10, 2026
Copilot AI requested a review from TylerLeonhardt January 10, 2026 00:51
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