Repository navigation
feat(cli): repeatable --env KEY=VALUE overlay for orient and usage probes - #657
Closed
creativebastard wants to merge 1 commit into
Closed
creativebastard wants to merge 1 commit into
creativebastard wants to merge 1 commit into
Conversation
…obes
orient({ env }) already threads a session-style environment overlay into
the usage/auth/models readers, but the CLI exposed no way to pass one, so
oar usage and oar orient always probed the default credential slot. On a
host where several agents run one runtime under different accounts (one
KIMI_CODE_HOME each), a cap on the default-home account surfaced as
rate_limited for the whole runtime and stalled every agent, however much
quota their own accounts had.
--env KEY=VALUE (repeatable) on oar orient and oar usage parses into the
same overlay shape sessions take and is passed through to orient() and
runtime.accountUsage(), so a supervisor can probe each account's own home.
Closes botiverse#655
Author
stamp-build Bot
added a commit
that referenced
this pull request
Nov 6, 2026
…658) <!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_a4567485b0e7894036f51db66c7a17e4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> The existing CLI already selects another Kimi account through its inherited process environment. Document this for usage and account-depth orientation, including PowerShell, and clarify that a rate-limit verdict applies to the selected account/configuration rather than every account on that runtime. No environment flag or product behavior changes. A real Kimi 2.4.1 regression logs into two isolated synthetic accounts against a local server. Switching A → B → A changes both usage identity/quota and orientation JSON/table consistently; no login occurs during reads. The test joins the existing native login CI suite. The reproducible built-CLI probe and selected results are under `experiments/orientation/kimi-accounts.md`. Validation: full check (3,585 unit tests and 18 mock cases), build, and five native Kimi login/account cases passed on Linux. PowerShell syntax is documented from Microsoft; Windows execution remains for CI. No real account or inference was used. Related: #655, #656, #657. Co-authored-by: Otter <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #655.
What
Adds a repeatable
--env KEY=VALUEoption tooar orientandoar usage, parsed into the same overlay shapeSessionOptions["env"]takes (strings override) and passed through toorient()/runtime.accountUsage().Why
orient(registry, { env })already threads an environment overlay into the usage/auth/models readers, but the CLI exposed no way to pass one — both commands always probed the default credential slot. On a host where several agents run one runtime under different accounts (oneKIMI_CODE_HOMEeach), a cap on the default-home account surfaced asrate_limitedfor the whole runtime and stalled every agent, however much quota their own accounts still had. With--env KIMI_CODE_HOME=/path/to/homea supervisor can now probe each account's own home and key its stall decision per account instead of per runtime.Evidence
oar usage kimi --env KIMI_CODE_HOME=/tmp/oar-empty-home→unsupported / auth_configuration_unavailable(the empty home resolves no managed provider), while the same probe without--envreturns the default home's live account snapshot — the overlay demonstrably redirects credential resolution.oar usage kimi --env BROKEN→--env expects KEY=VALUE with a non-empty KEY, got "BROKEN", exit 1.tests/cli-orient.test.ts:--envpairs are threaded into the account-usage probe, and malformed pairs (no-equals,=value) are rejected before any probing.vitest runover the CLI and environment test files: 118 tests pass;pnpm run lintandpnpm --filter @botiverse/oar-cli typecheckclean.