Skip to content

Windsurf 1.9577+ uses --stdin_initial_metadata instead of --csrf_token (authentication fails) #8

@qiuxiaozhang

Description

@qiuxiaozhang

Problem Description

Plugin fails to detect Windsurf credentials because the --csrf_token argument is no longer present in the language server process.

Environment

  • Windsurf version: 1.9577.43
  • Plugin version: 0.1.0
  • Platform: macOS (Apple Silicon)

Steps to Reproduce

  1. Install opencode-windsurf-auth plugin
  2. Configure opencode.json with windsurf provider
  3. Launch Windsurf and login
  4. Run opencode chat --model=windsurf/claude-4.5-opus-thinking Hello

Expected Behavior

Plugin should detect running Windsurf and authenticate successfully.

Actual Behavior

Error message: Windsurf is not running. Please launch Windsurf first.

Root Cause Analysis

Process arguments for language_server_macos:
--parent_pipe_path /var/folders/... --windsurf_version 1.9577.43 --stdin_initial_metadata

The --csrf_token argument is missing. The authentication mechanism appears to have changed in recent Windsurf versions to use --stdin_initial_metadata instead.

Additional Context

  • Windsurf IS running and logged in
  • The API key is accessible in ~/.codeium/config.json
  • Port 49740 is listening (verified via lsof)

Suggested Fix

Update credential discovery to support the new --stdin_initial_metadata authentication mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions