CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Linux CLI: Command Code and OpenCode Go usage providers are web-source/macOS-only

Open derekszen opened this issue 5 months ago • 3 comments

Summary

On Linux, the CodexBar CLI exposes commandcode and opencodego as providers in codexbar config providers, but codexbar usage cannot fetch either provider because the only available source is the macOS-only web source.

Reproduction

On Linux with CodexBar CLI 0.36.1:

codexbar usage --provider commandcode --source auto --format json
codexbar usage --provider commandcode --source web --format json
codexbar usage --provider opencodego --source auto --format json
codexbar usage --provider opencodego --source web --format json

All four return an error equivalent to:

selected source requires web support and is only supported on macOS

Explicit non-web sources are also unavailable:

codexbar usage --provider commandcode --source cli --format json
codexbar usage --provider commandcode --source api --format json
codexbar usage --provider opencodego --source cli --format json
codexbar usage --provider opencodego --source api --format json

Those return Source '<source>' is not supported for <provider>.

Why this matters

Linux wrappers such as codexbar-waybar can show these providers in Settings, but cannot safely enable them until the CLI has a Linux-compatible source. grok is different: it reaches a Linux path and reports an actionable grok login/signed-in-session error when not authenticated.

Request

Please add a Linux-compatible source for commandcode and opencodego, or expose enough provider metadata for Linux clients to know these are web-only/macOS-only at runtime.

derekszen avatar Jun 19 '26 15:06 derekszen

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 19, 2026, 11:57 AM ET / 15:57 UTC.

Summary Keep open: current main only partially addresses OpenCode Go on Linux with manual cookies, while Command Code remains effectively macOS/web-only and config providers still does not expose runtime source/platform capability metadata for Linux wrappers.

Reproducibility: yes. by source inspection rather than live Linux execution: Command Code is web-only and non-macOS unavailable, the CLI web gate returns the reported macOS-only error, and config providers lacks capability fields.

Next step A maintainer should choose the intended Linux contract before a fix PR: metadata-only, Linux manual-cookie support, or both.

Review details

Best possible solution:

Expose provider source/platform capability metadata for CLI clients and, if maintainers approve, add Linux-safe manual-cookie fetch paths using existing provider descriptor/strategy patterns without enabling browser-cookie import on Linux.

Do we have a high-confidence way to reproduce the issue?

Yes, by source inspection rather than live Linux execution: Command Code is web-only and non-macOS unavailable, the CLI web gate returns the reported macOS-only error, and config providers lacks capability fields.

Is this the best way to solve the issue?

Unclear: the issue offers two viable directions, and maintainers need to choose whether runtime metadata alone is enough or whether Linux manual-cookie fetch support should be added for these providers.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • The desired product shape is still a maintainer decision: add Linux-compatible manual-cookie/web fetch support, add source/platform metadata, or do both.
  • Command Code Linux support may change provider auth behavior because the current fetch path is explicitly macOS-gated even when manual cookies exist.

Codex review notes: model internal, reasoning high; reviewed against 3e8e12315ccc.

Label changes

Label changes:

  • add P2: This is a normal-priority Linux CLI provider capability and metadata improvement with limited blast radius.
  • add impact:auth-provider: The issue is about provider source/auth routing and whether Linux clients can discover or select usable authentication paths.
  • add issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.
  • add clawsweeper:needs-live-repro: Current issue advisory state selects this label.
  • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
  • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
  • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

Label justifications:

  • P2: This is a normal-priority Linux CLI provider capability and metadata improvement with limited blast radius.
  • impact:auth-provider: The issue is about provider source/auth routing and whether Linux clients can discover or select usable authentication paths.
Evidence reviewed

What I checked:

  • Command Code remains web-only in current source: Command Code declares only .auto and .web source modes and resolves to a single web strategy; that strategy returns unavailable outside macOS. (Sources/CodexBarCore/Providers/CommandCode/CommandCodeProviderDescriptor.swift:36, 3e8e12315ccc)
  • Linux CLI blocks web-backed sources before fetch: On non-macOS, fetchUsageOutput returns the macOS-only web-source error whenever sourceModeRequiresWebSupport is true; .auto is treated as requiring web support for any provider whose descriptor contains .web unless provider-specific exceptions apply. (Sources/CodexBarCLI/CLIUsageCommand.swift:273, 3e8e12315ccc)
  • OpenCode Go is partially implemented but still ambiguous for Linux auto discovery: OpenCode Go has a local strategy behind .auto, but its descriptor still advertises only .auto/.web, and automatic cached cookie enrichment is macOS-only unless a manual cookie is configured. (Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:33, 3e8e12315ccc)
  • Provider listing lacks capability metadata: config providers emits only provider id, display name, enabled state, and defaultEnabled; it does not expose supported sources, platform support, or web-only status for wrappers. (Sources/CodexBarCLI/CLIConfigCommand.swift:204, 3e8e12315ccc)
  • Recent related fix is partial: Merged OpenCode Go work only added the manual-cookie Linux CLI gate exception; it does not cover Command Code or general provider capability metadata. (Sources/CodexBarCLI/CLIUsageCommand.swift:554, e3ae6f2890f7)
  • Canonical search found no replacement issue: GitHub issue/PR searches found this issue as the only open same-repo item for the combined Command Code/OpenCode Go Linux source metadata gap; related merged PRs are partial overlap only.

Likely related people:

  • Yuxin-Qiao: Authored the recent merged OpenCode Go Linux manual-cookie CLI gate fix that overlaps the reported Linux behavior. (role: recent area contributor; confidence: high; commits: e3ae6f2890f7; files: Sources/CodexBarCLI/CLIUsageCommand.swift, Tests/CodexBarTests/CLIEntryTests.swift)
  • sopenlaz0: Authored the merged OpenCode Go local usage reader PR that provides the local strategy now relevant to Linux auto behavior. (role: feature contributor; confidence: medium; commits: 751e680c6ead, ff8057a65ab8, 7c546e561f15; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift, Tests/CodexBarTests/OpenCodeGoLocalUsageReaderTests.swift)
  • LPFchan: Recently merged Command Code usage-fetcher changes and tests, making them a likely routing candidate for Command Code provider behavior. (role: recent area contributor; confidence: medium; commits: 3e8e12315ccc; files: Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift, Tests/CodexBarTests/CommandCodeUsageFetcherTests.swift, Tests/CodexBarTests/CommandCodeQuotaTransitionTests.swift)
  • Peter Steinberger: Authored nearby CLI source-routing changes and co-authored recent OpenCode Go Linux cookie-gate work. (role: adjacent source-routing contributor; confidence: medium; commits: 274f2cfdaf26, e3ae6f2890f7; files: Sources/CodexBarCLI/CLIUsageCommand.swift, Tests/CodexBarTests/CLIEntryTests.swift)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

clawsweeper[bot] avatar Jun 19 '26 15:06 clawsweeper[bot]

Update from the downstream codexbar-waybar work: the wrapper packages Linux provider enablement in https://github.com/Marouan-chak/codexbar-waybar/pull/4.

  • OpenCode Go can be read locally from ~/.local/share/opencode/opencode.db, following the same message/part cost semantics as CodexBar's local reader.
  • Command Code can be read with the CLI api key from ~/.commandcode/auth.json through the /alpha/billing/* endpoints; manual Cookie headers remain available as a fallback.

This upstream issue was fixed by #1660. The downstream PR now mainly keeps codexbar-waybar working against the currently installed/released Linux CLI behavior and provides Waybar-specific fallbacks/UX while upstream support rolls forward.

derekszen avatar Jun 19 '26 16:06 derekszen

Fixed by #1660 (7ad7bdad).

Linux now has supported usage paths for both reported providers:

  • OpenCode Go: automatic web-to-local fallback with a real SQLite reader through the Linux CSQLite3 system-library target.
  • Command Code: automatic or web mode accepts a configured manual cookie and reaches the billing API without macOS browser import.

Proof includes the Linux gate matrix and real SQLite fixture in TestsLinux/OpenCodeGoLinuxTests.swift, CLI/provider/config regressions, exact-head Crabbox behavior, and glibc + musl release builds across x64/arm64.

steipete avatar Jun 19 '26 21:06 steipete