Skip to content

fix: allow Windows Firefox profile extraction fallback instead of throwing - #183

Open
w21180239 wants to merge 2 commits into
stablyai:mainfrom
w21180239:fix-windows-firefox-error
Open

w21180239 wants to merge 2 commits into
stablyai:mainfrom
w21180239:fix-windows-firefox-error

Conversation

@w21180239

Copy link
Copy Markdown

Pull Request: Fix Windows Firefox profile extraction error

Problem

On Windows, agent-slack CLI commands throw Firefox extraction is not supported on win32. when:

  1. Using a --workspace selector that doesn't match any configured workspace in credentials.json.
  2. Or when the auto-refresh fallback triggers browser credential extraction.

This happens because src/auth/firefox-profile.ts's getFirefoxBaseDir() unconditionally throws on win32 instead of gracefully returning a Windows-compatible path or skipping.

Root cause

When a workspace selector isn't resolved from credentials.json, the CLI falls back to browser/desktop credential extraction pipelines (extractFromSlackDesktop, extractFromChrome, extractFromBrave, extractFromFirefox). The extractFromFirefox call invokes listProfileCandidates(), which calls getFirefoxBaseDir(). On Windows, this function currently throws an error, crashing the entire CLI before it can fall through to the other browsers (or return null/empty credentials as expected).

Fix

Replace the unconditional throw with a Windows-compatible path return in getFirefoxBaseDir(). This allows Firefox profile detection to either find a valid Firefox installation on Windows (if present) or return null from listProfileCandidates() when no profiles exist, enabling the fallback chain to continue gracefully to other auth sources.

Testing

  • Verified the exact crash scenario on Windows with mismatched workspace selector.
  • Confirmed the fix resolves the crash and allows fallback to other auth methods.
  • All existing tests continue to pass.

Reproduction

# With no matching workspace in credentials.json:
agent-slack user list --workspace https://nonexistent.slack.com
# Result (before fix): Error: Firefox extraction is not supported on win32.
# Result (after fix): Falls through to other browsers / returns appropriate error.

@w21180239
w21180239 force-pushed the fix-windows-firefox-error branch from 9ec69dc to 318b4f7 Compare November 4, 2026 12:01
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.

1 participant