Repository navigation
Conversation
|
Coordinator verification: GPT-6 Astra reviewed the credential fallback and secret-handling boundary, then ran the changed collector against the real Pi OAuth login. It returned ready=true with fresh 5-hour, monthly-total and monthly-code windows. Runtime deployment has not been changed. Pi remains responsible for credential refresh and locking. |
[Medium impact] The PR appears safe to merge, with the previous non-blocking cleanup issue still open. Findings
SummaryAdds Pi credentials as a fallback for Kimi usage collection.
Reviews (2) · Last reviewed commit: "Only borrow an existing Pi Kimi sign-in" · Reviewed by Greptile |
| os.killpg(process.pid, signal.SIGKILL) | ||
| except ProcessLookupError: | ||
| pass | ||
| process.communicate() |
There was a problem hiding this comment.
The second process.communicate() has no timeout. If a Pi API-key command starts a child in a separate process group while leaving stdout open, killpg cannot close that child's pipe. The collector and the usage update can then wait forever after the 15-second deadline. Bound the cleanup wait too, and close the captured pipe if it does not finish.
Problem
A Kimi subscription signed in through Pi's
/login kimi-codinghas working credentials, but Omarchy's Kimi collector only looks for an environment key or Kimi CLI login. The result is missing quotas in the existing agents panel.This PR only adds the missing credential source. Kimi's five-hour and monthly quota parsing already exists; no panel redesign, plan-label override, window IDs, duration fields, or percentage-formatting changes are needed.
Change
KIMI_API_KEYand the selected Kimi CLI token ahead of Pi. A rejected or expired higher-priority credential does not silently switch accounts. An explicitKIMI_CODE_HOMEnever borrows Pi's account.kimi-codingentry inauth.jsonunderPI_CODING_AGENT_DIR(default~/.pi/agent). Missing, unrelated or malformed stores do not invoke Omarchy's lazy Pi launcher, so an unused provider's background refresh does not install Pi.pi auth check --provider kimi-coding --json --credentialsto resolve the OAuth/API-key credential. Pi still owns refresh, locking and persistence; Omarchy does not copy or rewrite its credentials.Requires a Pi version supporting
auth check(verified with Pi 1.4.0).Relation to other work
quattro, without importing the overhaul. A separate local port onto8d957f37was verified: include Pi inhas_credential(), use the new missing/refused status contract, and carry Pi-specific help through the quota request. Its shared scanning, records and cache remain intact. The branches require adaptation, not a blind merge.config.toml. The interaction with Find Kimi credentials for global (kimi.ai) sign-ins #15646 was reviewed; a combined branch has not been live-tested here.Verification
On this PR, via
herd-test:agent-usage-kimi-test.shagent-usage-kimi-regression-test.shagent-usage-update-test.shagents-panel-test.shgit diff --checkSafety coverage exercises the real collector/process/HTTP boundary: unsigned refresh with a lazy-launcher stand-in, explicit account isolation, default and overridden Pi directories, credential precedence and rejection, redaction, malformed CLI output, and timeout cleanup. The unsigned-refresh assertion fails against the previous PR head (
e66a5d66), which starts Pi.Live Pi OAuth collection returned fresh five-hour, monthly-total and monthly-code readings with the existing record shape. The stock panel was inspected in a disposable Omarchy VM using only the credential-free reading: Session and Monthly meters render, and the Monthly tooltip includes the code allowance. Its
Panel.qmlis byte-identical to this branch. The existing local Pi footer parser/formatter also accepts all three windows and suppresses stale data; no footer change was needed.For the separate #14040 port, its Kimi regression/limits-contract and local-stats suites passed, including Pi-only sign-in before any local history and the shared stale/refused behavior. A live Pi-only run returned fresh quota alongside local usage. These are checks of an adapted port, not claims about unmodified #14040. The initial test invocation hit the host's untrusted mise configuration; the suites ran successfully with system tools on an isolated PATH, without changing that configuration.
No full shell-suite pass is claimed; this is confined to one collector. No runtime deployment was changed.
AI provenance
Initial implementation: OpenAI GPT-6.1 Sol. Current revision, upstream compatibility work and live/visual verification: OpenAI GPT-6 Astra. Independently reviewed by GPT-6.1 Sol for credential precedence/isolation, lazy-launcher behavior, secret handling, process cleanup, Pi's CLI contract and #14040/#15646 interactions. Its default-home precedence coverage gap was addressed. No blocking issue was found in the current fix; the cross-PR adaptation requirements above remain explicit.