CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Kimi automatic refresh has no strategy with Chromium-only auth since v0.44.0; manual refresh works

Open yolopsx opened this issue 4 months ago • 2 comments

Summary

Since v0.44.0, Kimi users whose only usable authentication source is an automatically imported Chrome/Chromium session get this error after launch/background refresh:

No available fetch strategy for kimi.

Clicking the in-menu Refresh action immediately loads the Kimi quota successfully. Quitting/relaunching returns to the error until another manual refresh.

This appears to be a compatibility regression from #2225: the new background guard correctly prevents Keychain prompts, but it also makes automatic browser import unusable across process launches when the valid Kimi session is in Chromium. The same guard also affects an explicitly invoked codexbar usage CLI command.

Environment

  • CodexBar app: 0.44.0 (build 106), official notarized release
  • Also reproduced with the official v0.45.1 arm64 CLI release (asset SHA-256 matched the GitHub release digest)
  • macOS 26.5.2 (25F84), Apple Silicon
  • Chrome 150.0.7871.124
  • Kimi enabled, Automatic browser-cookie source; no usable/resolved Kimi API key or manual token

No credentials, cookie values, account identifiers, or usage amounts are included below.

Reproduction

  1. Sign in to Kimi in Chrome and use CodexBar's Automatic Kimi cookie source.
  2. Ensure no Kimi API key, Kimi Code CLI credential, manual token, or usable Safari Kimi session is configured.
  3. Launch CodexBar, or let a background provider refresh run after a fresh process start.
  4. Open the Kimi card.
  5. Observe No available fetch strategy for kimi.
  6. Click Refresh in the menu.
  7. Observe that Kimi rate-limit, weekly, monthly, and Code 7-day values load successfully.
  8. Quit and relaunch CodexBar; the error returns until the next manual refresh.

Deterministic CLI signal

The bundled 0.44.0 CLI returned the exact error 3/3 runs. The latest 0.45.1 CLI does the same:

CodexBarCLI usage --provider kimi --format json --log-level info --json-output

Sanitized result:

[
  {
    "error": {
      "message": "No available fetch strategy for kimi.",
      "kind": "provider",
      "code": 1
    },
    "provider": "kimi",
    "source": "auto"
  }
]

Relevant sanitized log line:

Skipping background Chromium cookie import to avoid a Keychain prompt browser=Chrome

The Kimi Safari importer is then attempted, but no usable Safari Kimi cookie exists, so the fetch plan has no available strategy.

Regression evidence

PR #2225 added this unconditional early return for every non-user-initiated Chromium cookie access:

guard ProviderInteractionContext.current == .userInitiated else {
    // Skipping background Chromium cookie import...
    return false
}

Before v0.44.0, a background refresh could continue when the Chrome Safe Storage preflight reported access as allowed. The new behavior skips Chromium before even checking whether access is already non-interactive/allowed. The guard remains unchanged in v0.45.1.

The review on #2225 anticipated this exact compatibility risk: existing Chromium-cookie users could receive stale/authentication failures until manual refresh, and the standalone CLI could lose Chromium imports if it retained the default background interaction context.

Expected behavior

Please keep the no-background-Keychain-prompt security invariant, while providing a usable upgrade path for existing Automatic browser-import users. Any of these would address the user-facing regression:

  • persist/reuse a safely cached last-good Kimi browser credential or snapshot across app launches without prompting;
  • allow already-authorized/no-interaction Chromium access without opening an interactive Keychain path;
  • classify an explicit foreground CLI invocation appropriately (or expose an explicit opt-in flag); and/or
  • replace the generic No available fetch strategy error with an actionable message explaining that automatic Chromium authentication is blocked in background refresh and recommending Kimi API key, Kimi Code CLI, or manual token setup.

At minimum, the advertised "Automatic Browser Import" + "Automatic refresh countdown" combination should not silently become manual-refresh-only after upgrading.

yolopsx avatar Jul 19 '26 12:07 yolopsx

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 24, 2026, 2:01 AM ET / 06:01 UTC.

Summary Current main implements the reported safe background Chromium path, but this repository’s generic onboarding policy requires maintainer confirmation before automated closure.

Reproducibility: no. high-confidence live reproduction was run: repository policy prohibits browser-cookie and Keychain validation without explicit request, although current source and focused tests cover the reported path.

Regression provenance Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Ways to help us reproduce this

  • Add a screenshot or short recording showing the behavior.
  • Add expected vs actual behavior.
  • Include redacted logs or terminal output.

Maintainer decision needed

Question Recommendation
Is the current-source and v0.47.0 review evidence sufficient to close this report under the repository’s conservative onboarding policy? Confirm closure: Confirm that the current released app restores automatic Kimi refresh for an already-authorized Chromium session and close the report.

Why: The reported unconditional block is absent and targeted coverage proves the intended safe path, but automated closure is disabled by the repository profile.

Next step No repair should be queued: a maintainer must only confirm that the available current-source and release evidence meets the repository’s closure policy.

Review details

Best possible solution:

Keep the no-prompt preflight gate: automatically refresh Kimi when Chromium access is already authorized, and skip safely when interaction would be required.

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

No high-confidence live reproduction was run: repository policy prohibits browser-cookie and Keychain validation without explicit request, although current source and focused tests cover the reported path.

Is this the best way to solve the issue?

Yes for the central issue: the current no-UI preflight allows already-authorized Chromium reads and rejects interaction-required ones before the cookie read.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • A real Chromium/Kimi account run on the latest release was not performed because repository policy forbids Keychain-touching validation without explicit request.
  • The exact historical repair commit could not be recovered from this promisor checkout, so the first-release provenance remains dependent on the supplied prior review.

Codex review notes: model internal, reasoning high; reviewed against a639fdf0398c; fix evidence: release v0.47.0.

Label changes

Label changes:

  • remove clawsweeper:not-repro-on-main: Current issue advisory state no longer selects this label.

Label justifications:

  • P2: This is a bounded provider-authentication regression report, while current source indicates the central behavior has been addressed.
  • impact:auth-provider: The reported failure concerns Kimi browser credential resolution and provider fetch availability.
Evidence reviewed

What I checked:

Likely related people:

  • Peter Steinberger: Available history attributes the current release snapshots and the v0.47.0 release tag to this contributor; the shared Chromium gate is the central current implementation. (role: recent core-gate contributor; confidence: medium; commits: 6a16c23313a7, d6d281e898a0; files: Sources/CodexBarCore/BrowserCookieAccessGate.swift, Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift)
  • Yuxin-Qiao: Authored the merged background Chromium Keychain policy change that the issue identifies as the regression origin. (role: related policy contributor; confidence: high; commits: bad4bebebc39; files: Sources/CodexBarCore/BrowserCookieAccessGate.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 Aug 07 '26 06:08 clawsweeper[bot]

Current releases already permit previously authorized Chromium and Kimi background access after a strictly noninteractive Keychain preflight; interaction-required, missing, and denied credentials still fail closed, with focused BrowserCookieAccessGate regression coverage. Please reopen with the exact app version and redacted logs if this still reproduces on v0.55.0 or newer.

steipete avatar Aug 25 '26 08:08 steipete