Skip to content

[Bug]: MS Teams delegated OAuth launcher uses xdg-open on win32 instead of explorer.exe #67659

@shaun0927

Description

@shaun0927

Summary

MS Teams delegated OAuth setup currently launches the browser with xdg-open on win32, so the native Windows path does not use the repository's normal Windows browser-open behavior.

Steps to reproduce

  1. Stub process.platform to "win32".
  2. Call openDelegatedOAuthUrl("https://example.com/oauth") from extensions/msteams/src/setup-surface.ts.
  3. Observe the spawned command.

Expected behavior

On Windows, delegated OAuth setup should use the same browser-open command family as the shared helper in src/infra/browser-open.ts, which resolves to explorer.exe on win32.

Actual behavior

openDelegatedOAuthUrl() currently selects:

  • open on macOS
  • xdg-open on every other platform

That means win32 still tries xdg-open.

OpenClaw version

Observed on main at fbccc18e745e (2026-04-16) before the local fix.

Operating system

Windows 11 (repro validated with a local win32-targeted unit test in a source checkout).

Install method

Source checkout / local test workspace.

Model

N/A (setup-surface issue before model selection).

Provider / routing chain

N/A (delegated OAuth launcher path only).

Logs, screenshots, and evidence

Relevant code paths:

  • extensions/msteams/src/setup-surface.ts:32-35
  • src/infra/browser-open.ts:36-39

Local repro evidence:

  • A targeted local repro test passed while asserting that openDelegatedOAuthUrl() calls xdg-open when process.platform === "win32".
  • The same repro confirmed the shared browser-open helper still resolves to explorer.exe on win32.

Impact and severity

  • Affected users/systems/channels: native Windows users configuring MS Teams delegated OAuth
  • Severity: medium (can block or break browser launch during setup)
  • Frequency: deterministic in the validated win32 repro path
  • Consequence: delegated OAuth setup uses the wrong launcher on Windows and diverges from the repo's shared browser-open behavior

Additional information

This looks like a narrow cross-platform regression rather than a broader auth or token-handling issue. The smallest fix appears to be adding an explicit win32 -> explorer.exe branch (or reusing a platform-safe shared launcher through an allowed seam).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions