Skip to content

Linux gap report: credential discovery misses + provider behavior (12 triage items, live daemon evidence) #1

Description

@iceteaSA

insula on a Linux box: live gap report (icebox, 2026-08-08)

From: IceTea/Legion · For: QTA seat triage (Alfonso)
Tested: subconscious 87a1e6513882 + insula e1230e8dc876; release build on Arch Linux (icebox); daemon trial-run with insula registered; probed via usage.get (35-entry ProviderUsage[] captured); shut down cleanly.

Context: our quota layer is an opencode custom tool (tok_usage, 8 sources) feeding a pre-dispatch budget gate. Plan: re-point it at insula's usage.get and upstream what we have that insula lacks. Every observation below is from the live daemon on this box, not from docs. Artifact bundle is listed at the end.

Items are numbered for task creation: GAP-n = credential/source discovery on Linux; FEAT-n = provider/feature work; WIRE-n = wire-contract. Each carries repro, expected/actual, and our contribution.

0. Live diff summary — insula vs our fetchers, same box, same minute

provider insula our fetchers item
claude 1 of 2 accounts; main = 5h 4% / 7d 51% / Fable 33% — matches ours to 0% 2 accounts GAP-1
codex 1 account, unauthorized: HTTP 401 3 accounts (8% / 100% / 99%) GAP-2
synthetic no session 78% weekly credits GAP-3, FEAT-1
qwen-cloud no session: browser-cookie extraction live (weekly %, plan status) GAP-4, FEAT-2
antigravity local source unavailable: no Antigravity 4 accounts GAP-5
minimax 16% / 14% — live (our mmx-CLI read hit a transient 401 the same minute) FEAT-3
deepseek no adapter $13.62 API balance FEAT-4

Window math agrees exactly wherever both sides see the same account. The entire disagreement surface is credential discovery.

1. GAP items — Linux credential paths

GAP-1 · claude: second account not discovered

  • Actual: insula serves 1 claude account. Expected: 2 (the second is live at 7d 84% — a router that can't see it will misroute).
  • Discovery point on this box: the opencode anthropic-auth plugin (cortexkit/anthropic-auth) maintains a multi-account cache — per-account OAuth + tier/prime/extra-usage snapshots — under ~/.local/share/opencode/ (sidebar-state.json + prime + cachekeep-sessions). insula's claude slot found only the primary credential.
  • Repro: box with two anthropic-auth accounts configured; usage.get → one claude entry.
  • Contribution: we can document the plugin cache schema, or PR a slot source reading it (slots key on credential handle per multi-account-fetch-design.md, so this should be additive).

GAP-2 · codex: multi-account rotation state not read; found token stale

  • Actual: one codex entry, unauthorized: HTTP 401. Expected: 3 accounts (main/client-alt/work-alt).
  • Discovery point: openai-auth plugin sidebar state at /tmp/opencode-openai-auth/sidebar-state.json. Shape (values redacted):
{ "main":      { "quota": { "primary": { "usedPercent": 0, "resetsAt": 0, "windowMinutes": 0 },
                 "resetCreditsAvailable": 0, "checkedAt": 0 },
                 "mainAccountId": "", "killed": false },
  "fallbacks": [ { "id": "", "label": "", "accountId": "", "quota": { "…": "" },
                   "killed": false, "enabled": true } ],
  "activeId": "", "route": "",
  "activeRouting": { "<session-id>": { "activeId": "", "route": "", "updatedAt": 0 } } }
  • Per-account enabled/killed + resetCreditsAvailable here also feed FEAT-5.
  • Repro: box with 3 codex accounts via openai-auth; usage.get → one entry, 401.
  • Contribution: schema doc + sample (redacted) file; PR available.

GAP-3 · synthetic: key in opencode auth store not probed

  • Actual: no session. Expected: weekly-credit + request windows (we read 78% used at test time).
  • Discovery point: ~/.local/share/opencode/auth.jsonsynthetic.key (plain API key). One JSON read; no browser, no env var needed.
  • Repro: key present at that path, no SYNTHETIC_API_KEY env → no session.

GAP-4 · qwen-cloud: no Linux path when browser-cookie extraction is unavailable

  • Actual: no session: browser-cookie extraction is… (macOS-oriented). Expected: live weekly window.
  • Discovery point: we keep { "cookie": "…", "sec_token": "…" } as a plain JSON file (~/.config/opencode/secrets/alibaba-token-plan-auth.json). Suggest: configurable credentials-file fallback for the qwen-cloud slot when cookie extraction is unsupported on the platform.
  • Repro: Linux box, creds file present → no session.

GAP-5 · antigravity: requires a running agy process

  • Actual: local source unavailable: no Antigravity. Expected: 4 accounts (1 paid + 3 free), Gemini + non-Gemini windows.
  • Discovery point: the antigravity-auth opencode plugin persists account/quota state to disk; no live process needed to read it. We can document the file layout.

2. FEAT items — provider behavior we'd upstream

FEAT-1 · synthetic: continuous regeneration, not fixed windows

  • Weekly credits regen +2% per 202 min; the 5h request window +5% per 15 min; no reset boundaries exist (https://synthetic.new/rate-limits). Requests are additionally price-scaled (GLM-5.2 = 1.0 request baseline; cheaper models fractional).
  • The API's resetTimeIso is an opaque server value — verified live: deltas ~3.1h (credit) / ~5h (request), i.e. neither a regen tick nor a weekly reset. insula's scanner passes resetsAt through when upstream reports one (quota-core/src/synthetic.rs). For synthetic, that value is not a reset; consumers WILL build pacing on it. We shipped exactly that bug this week: pacing-vs-reset math made a 100%-depleted lane read healthy for the last ~1.7h of each cycle, and our budget gate offered it as a healthy fallback target.
  • Ask: per-window semantics on the wire — fixed_reset vs continuous_regen {fraction, interval_ms} (WIRE-1) — or minimally suppress resetsAt for synthetic.
  • Contribution: our regen constants + timeToFull/timeToPct helpers + tests (TypeScript, trivially portable).

FEAT-2 · qwen-cloud payload drift (live since ~2026-08-07)

  • Envelope code now arrives as string "200" (was number). Usage payload dropped per5HourPercentage; only per1WeekPercentage remains.
  • Invariant candidates (both bit us): (a) delivered-but-unrecognizable usage payload ⇒ explicit error entry, never silent null; (b) a null sub-window must never render as healthy 0% (Number.isFinite(null)-class bugs pass thresholds silently in loosely-typed consumers).
  • Contribution: captured live fixture (in bundle: qwen-cloud-drift-fixture.json, request ids scrubbed) + our parser diff.

FEAT-3 · minimax: prepaid credit pool as secondary signal

  • Plan windows alone misclassify MiniMax health: a depleted 5h/7d window with non-expired prepaid credits ≥ threshold is still usable (credits are the real headroom; MiniMax debits them when plan windows exhaust). We carry this as a verdict-side "credit backstop"; the balance fetch would fit insula as an extra window (balance semantics) on the minimax entry.
  • Contribution: working fetcher (TS) + the threshold logic.

FEAT-4 · deepseek: balance adapter (new provider)

  • API-key balance endpoint; serves naturally as a single balance-semantics window. We have a working fetcher; no windows exist for deepseek, balance IS the signal.

FEAT-5 · per-account operator flags in accountInfo

  • enabled / killed per account (see GAP-2 shape) lets a consumer distinguish "operator disabled this account" from "account degraded". Today that distinction only exists inside our plugins.

3. WIRE items — consumer-contract notes

WIRE-1 · per-window semantics tag

See FEAT-1. fixed_reset / continuous_regen {fraction, interval_ms} / balance. Backward-compatible as an optional field; absence ⇒ fixed_reset (current behavior).

WIRE-2 · fresh: bool on the wire

Freshness is computed at read (120s horizon) but not serialized. As a dispatch-gate consumer we'd rely on it: a stale-but-present window and a fresh one are different routing inputs. +1 for shipping it.

4. Explicit non-asks

  • Verdict/pacing logic — stays consumer-side (our budget-gate ladder).
  • History/time-series persistence — we'll propose separately to ASTRO: astrocyte's refresher already polls usage.get; persisting window samples there gives the fleet a usage time series with no insula change.
  • PAYG cost analytics — astrocyte's ledger owns pricing.

5. Artifacts

  • usage-get.json — full 35-entry live capture from this box (account UUIDs present, no secrets).
  • qwen-cloud-drift-fixture.json — captured drifted payload, request ids scrubbed.
  • daemon.log — 19-line trial-run log.
  • On request: our synthetic regen implementation + tests, qwen-cloud parser diff, minimax credit fetcher, deepseek balance fetcher, plugin state-file schema docs (GAP-1/2/5).
qwen-cloud-drift-fixture.json (captured live, request ids scrubbed)
{
  "code": "200",
  "data": {
    "DataV2": {
      "ret": [
        "SUCCESS::接口调用成功"
      ],
      "data": {
        "msg": "Success.",
        "code": "SUCCESS",
        "data": {
          "per1WeekPercentage": 0.3
        },
        "requestId": "test-fixture-request-id",
        "success": true
      }
    },
    "success": true,
    "httpStatus": 200,
    "errorCode": "",
    "api": "zeldaHttp.apikeyMgr./tokenplan/personal/api/v2/usage",
    "errorMsg": ""
  },
  "httpStatusCode": "200",
  "requestId": "test-fixture-request-id",
  "successResponse": true
}
usage-get.json — full 35-entry live capture
{
  "completeProviders": [
    "codex"
  ],
  "result": [
    {
      "account": "5259f285-37ea-4aac-87e1-0ed67307d6c2",
      "apiProvider": "openai",
      "error": "unauthorized: HTTP 401",
      "errorClass": "credential_rejected",
      "provider": "codex"
    },
    {
      "apiProvider": "anthropic",
      "fetchedAt": "2026-08-08T10:43:01.596729693+00:00",
      "provider": "claude",
      "source": "oauth",
      "usage": {
        "extraRateWindows": [
          {
            "id": "Fable",
            "title": "7 Day (Fable)",
            "window": {
              "resetsAt": "2026-08-09T23:00:00.484933+00:00",
              "usedPercent": 33.0,
              "windowMinutes": 10080
            }
          }
        ],
        "primary": {
          "resetsAt": "2026-08-08T13:40:00.484681+00:00",
          "usedPercent": 4.0,
          "windowMinutes": 300
        },
        "secondary": {
          "resetsAt": "2026-08-09T23:00:00.484717+00:00",
          "usedPercent": 51.0,
          "windowMinutes": 10080
        }
      }
    },
    {
      "error": "local source unavailable: no Antigravity language server or agy CLI process running",
      "errorClass": "local_source_unavailable",
      "provider": "antigravity"
    },
    {
      "error": "no session: no CODEBUFF_API_KEY or ~/.config/manicode/credentials.json",
      "errorClass": "credential_absent",
      "provider": "codebuff"
    },
    {
      "apiProvider": "github-copilot",
      "error": "no session: none of [\"COPILOT_API_TOKEN\", \"GITHUB_TOKEN\", \"GH_TOKEN\"] is set",
      "errorClass": "credential_absent",
      "provider": "copilot"
    },
    {
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "cursor"
    },
    {
      "error": "no session: no complete Volcengine signing credentials or Doubao Ark API key found",
      "errorClass": "credential_absent",
      "provider": "doubao"
    },
    {
      "error": "no session: none of [\"ELEVENLABS_API_KEY\", \"XI_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "elevenlabs"
    },
    {
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "factory"
    },
    {
      "apiProvider": "google",
      "fetchedAt": "2026-08-08T10:43:05.457131886+00:00",
      "provider": "gemini",
      "source": "oauth",
      "usage": {
        "extraRateWindows": [
          {
            "id": "gemini-2.5-flash",
            "title": "gemini-2.5-flash",
            "window": {
              "resetsAt": "2026-08-09T10:43:05Z",
              "usedPercent": 0.0,
              "windowMinutes": 1440
            }
          },
          {
            "id": "gemini-2.5-flash-lite",
            "title": "gemini-2.5-flash-lite",
            "window": {
              "resetsAt": "2026-08-09T10:43:05Z",
              "usedPercent": 0.0,
              "windowMinutes": 1440
            }
          },
          {
            "id": "gemini-2.5-pro",
            "title": "gemini-2.5-pro",
            "window": {
              "resetsAt": "2026-08-09T10:43:05Z",
              "usedPercent": 0.0,
              "windowMinutes": 1440
            }
          },
          {
            "id": "gemini-3.1-flash-lite",
            "title": "gemini-3.1-flash-lite",
            "window": {
              "resetsAt": "2026-08-09T10:43:05Z",
              "usedPercent": 0.0,
              "windowMinutes": 1440
            }
          }
        ],
        "primary": {
          "resetsAt": "2026-08-09T10:43:05Z",
          "usedPercent": 0.0,
          "windowMinutes": 1440
        }
      }
    },
    {
      "apiProvider": "xai",
      "error": "no session: no xai entry in opencode auth.json",
      "errorClass": "credential_absent",
      "provider": "grok"
    },
    {
      "fetchedAt": "2026-08-08T10:43:01.599946682+00:00",
      "provider": "jetbrains",
      "source": "api",
      "usage": {
        "primary": {
          "resetsAt": "2026-07-11T06:01:01.929Z",
          "usedPercent": 0.6737972920187019
        }
      }
    },
    {
      "error": "no session: none of [\"KIMI_AUTH_TOKEN\", \"kimi_auth_token\"] is set",
      "errorClass": "credential_absent",
      "provider": "kimi"
    },
    {
      "apiProvider": "kimi-for-coding",
      "error": "no session: KIMI_CODE_API_KEY is not set",
      "errorClass": "credential_absent",
      "provider": "kimi-for-coding"
    },
    {
      "error": "no session: none of [\"CLINE_API_KEY\", \"CLINEPASS_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "clinepass"
    },
    {
      "error": "no session: none of [\"LLM_PROXY_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "llmproxy"
    },
    {
      "error": "no session: none of [\"MANUS_SESSION_TOKEN\", \"MANUS_SESSION_ID\", \"MANUS_COOKIE\"] is set",
      "errorClass": "credential_absent",
      "provider": "manus"
    },
    {
      "apiProvider": "xiaomi",
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "mimo"
    },
    {
      "apiProvider": "minimax",
      "fetchedAt": "2026-08-08T10:43:06.212853571+00:00",
      "provider": "minimax",
      "source": "api",
      "usage": {
        "primary": {
          "resetsAt": "2026-08-08T15:00:00Z",
          "usedPercent": 16.0,
          "windowMinutes": 300
        },
        "secondary": {
          "resetsAt": "2026-08-10T00:00:00Z",
          "usedPercent": 14.0,
          "windowMinutes": 10080
        },
        "tertiary": {
          "resetsAt": "2026-08-09T00:00:00Z",
          "usedPercent": 0.0,
          "windowMinutes": 1440
        }
      }
    },
    {
      "apiProvider": "neuralwatt",
      "error": "no session: none of [\"NEURALWATT_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "neuralwatt"
    },
    {
      "apiProvider": "ollama-cloud",
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "ollama"
    },
    {
      "apiProvider": "opencode",
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "opencode"
    },
    {
      "apiProvider": "opencode-go",
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "opencodego"
    },
    {
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "qoder"
    },
    {
      "apiProvider": "alibaba-token-plan",
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "qwen-cloud"
    },
    {
      "apiProvider": "sakana",
      "error": "no session: SAKANA_COOKIE is not set or empty",
      "errorClass": "credential_absent",
      "provider": "sakana"
    },
    {
      "apiProvider": "stepfun",
      "error": "no session: none of [\"STEPFUN_TOKEN\"] is set",
      "errorClass": "credential_absent",
      "provider": "stepfun"
    },
    {
      "error": "no session: none of [\"SUB2API_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "sub2api"
    },
    {
      "error": "no session: none of [\"WARP_API_KEY\", \"WARP_TOKEN\"] is set",
      "errorClass": "credential_absent",
      "provider": "warp"
    },
    {
      "apiProvider": "synthetic",
      "error": "no session: none of [\"SYNTHETIC_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "synthetic"
    },
    {
      "apiProvider": "zai",
      "error": "no session: none of [\"Z_AI_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "zai"
    },
    {
      "apiProvider": "zenmux",
      "error": "no session: none of [\"ZENMUX_MANAGEMENT_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "zenmux"
    },
    {
      "apiProvider": "kilo",
      "error": "no session: none of [\"KILO_API_KEY\"] is set and no ~/.local/share/kilo/auth.json token",
      "errorClass": "credential_absent",
      "provider": "kilo"
    },
    {
      "apiProvider": "alibaba-coding-plan",
      "error": "no session: none of [\"ALIBABA_CODING_PLAN_API_KEY\", \"ALIBABA_QWEN_API_KEY\", \"DASHSCOPE_API_KEY\"] is set",
      "errorClass": "credential_absent",
      "provider": "alibaba"
    },
    {
      "error": "no session: browser-cookie extraction is macOS+Chrome only",
      "errorClass": "credential_absent",
      "provider": "amp"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions