Skip to content

Allow --source auto on Linux#307

Open
Viou wants to merge 2 commits intosteipete:mainfrom
Viou:fix/linux-auto-source
Open

Allow --source auto on Linux#307
Viou wants to merge 2 commits intosteipete:mainfrom
Viou:fix/linux-auto-source

Conversation

@Viou
Copy link

@Viou Viou commented Feb 4, 2026

What

  • Treat --source auto as non-web so Linux doesn’t error out by default.
  • Keep --source web macOS-only behavior unchanged.
  • Add a small non-macOS test for ProviderSourceMode.usesWeb.
  • Document Kimi CLI usage with KIMI_AUTH_TOKEN (auto mode).

Why

On Linux, the CLI defaults to --source auto, but it was gated as a web-only mode and aborted before providers could use env/api/cli strategies (e.g., Kimi via KIMI_AUTH_TOKEN).

Testing

  • swift test

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1af82883a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 15 to 16
public var usesWeb: Bool {
self == .auto || self == .web
self == .web

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore auto web eligibility on macOS CLI

On macOS CLI, CodexProviderDescriptor.resolveStrategies still returns [web, cli] for .auto, and CodexWebDashboardStrategy.isAvailable gates on context.sourceMode.usesWeb. With usesWeb now false for .auto, the web dashboard strategy becomes unavailable even though it’s first in the auto pipeline. This means the default codexbar usage on macOS can no longer fall back to the web dashboard when there are no local CLI sessions, and will fail after the CLI strategy errors instead of fetching web usage. If the intent is to relax Linux-only gating, consider keeping .auto as web-capable on macOS (or moving the check to OS-specific logic) so the existing auto workflow on macOS doesn’t regress.

Useful? React with 👍 / 👎.

@Viou
Copy link
Author

Viou commented Feb 4, 2026

Follow-up: reverted ProviderSourceMode.usesWeb to include auto again (avoids potential macOS regressions where auto should consider web strategies), and changed the Linux guard to block only explicit --source web (both at argument-parse time and after provider source resolution).\n\nTested: swift test.

@Viou
Copy link
Author

Viou commented Feb 5, 2026

@codex

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65a3613754

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if parsedSourceMode == .web {
Self.exit(
code: .failure,
message: "Error: --source web/auto is only supported on macOS.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Correct Linux source error text for auto mode

After this change, --source auto is intentionally supported on non-macOS, but the emitted runtime error still says --source web/auto is only supported on macOS. When a Linux user passes --source web, this message now gives incorrect guidance and implies that auto is also invalid, which conflicts with the new behavior and can mislead CLI automation/users troubleshooting source selection.

Useful? React with 👍 / 👎.

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