Skip to content

feat: add Muse coding-plan provider - #128

Open
yesme wants to merge 1 commit into
onllm-dev:mainfrom
yesme:muse-provider-upstream
Open

feat: add Muse coding-plan provider#128
yesme wants to merge 1 commit into
onllm-dev:mainfrom
yesme:muse-provider-upstream

Conversation

@yesme

@yesme yesme commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Track Meta Muse coding-plan quotas (5h prompts + weekly) from the same subscription snapshot muse /usage shows.

Why this shape

Meta publishes no aggregate usage endpoint for the coding plan (probed /v1/usage, /v1/billing, org usage/costs - all 404). Each poll sends one minimal streamed probe (POST /v1/responses with stream: true, input ping, max_output_tokens: 16) and extracts the inline subscription object. Verified against the live API:

{"subscription": {"tier": "pro",
  "weekly": {"resets_at": "1789344000", "used_percent": "12.5"},
  "window": {"resets_at": "1789078632", "used_percent": "34", "window_duration_mins": "300"}}}

Auth

Resolves as META_API_KEY -> providers.meta.api_key in the muse login file -> macOS Keychain / Linux keyring entry written by muse login. The Keychain lookup is deadline-bounded (15s + regression test) so an unanswered approval dialog can never block daemon startup.

Includes

  • API client + types (string-or-number scalars, epoch s/ms, last-snapshot-wins SSE scan)
  • Credential auto-detect (unix keychain/keyring, windows file) + probe-model resolution
  • SQLite store (snapshots, quota values, reset cycles) + reset-cycle tracker + polling agent + daemon wiring
  • 7 web endpoints, dashboard cards, menubar card, settings form, setup wizard, install.sh/ps1, docs/MUSE_SETUP.md, landing card

Verified

  • ./app.sh --smoke green on this branch; tests/test_install.sh 27/27 (incl. 2 new Muse cases)
  • End-to-end against the live API (daemon poll, store, cycles, all endpoints, dashboard tab, menubar)
  • One pre-existing failure, unrelated: tools/perf-monitor TestMain_RestartFailureExitsWithError hangs in this dev environment because the test helper starts a real onwatch (found via PATH) and blocks forever on its output pipe. It fails identically with and without a repo-local binary, and involves no code touched by this PR.

Track Meta Muse coding-plan quotas (5h prompts + weekly) from the same
subscription snapshot 'muse /usage' shows. Meta publishes no aggregate
usage endpoint, so each poll sends one minimal streamed probe to
POST /v1/responses (input ping, max 16 output tokens) and extracts the
inline subscription object.

Auth resolves as META_API_KEY, then the muse login file, then the
macOS Keychain / Linux keyring entry written by 'muse login'. The
Keychain lookup is deadline-bounded (15s) so an unanswered approval
dialog can never block daemon startup.

Includes: API client + types, credential auto-detect (unix/windows),
SQLite store + reset-cycle tracker, polling agent, daemon wiring,
7 web endpoints, dashboard cards + menubar + settings, setup wizard,
install.sh/ps1, docs/MUSE_SETUP.md, landing card.
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