Repository navigation
Conversation
- Read each account's plan and organization from OMP's cached usage reports and show them as badges. - Show an Anthropic organization named after the account's email as Personal. - Show reset countdowns a day or more away as days and hours.
- Move plan and organization badges into the account heading row and its accessibility label.
- Accounts cards show the plan and organization badges the quota popover shows, from OMP's cached usage report, and drop OMP's parenthesized organization from the label once a badge shows it. - One tag rule in shared/account-tags.ts serves both views; `tags` defaults to an empty list.
…ve session - Paseo shows an OMP Plugin agent's model as an opaque id, so the quota pill and popover could not tell its provider and summarized every provider. - New RPC paseo-omp.session-model-provider asks the agent's live session, which maps the id back to OMP's model; a closed or unknown agent answers null and keeps the old summary. - The pill asks only for agents that are not closed and reuses the answer until the agent's model or status changes; the open popover asks again on the same changes.
- The quota popover lists the session's OMP logins (get_logout_accounts, or the stored session pin for a bundled omp agent), marks the one in use IN USE, a provider's only stored credential ONLY LOGIN, and offers Switch, which sends `/session pin OAuth credential #<id>`. - Logins link to recorded usage server-side by OMP's identity rule within the agent's own store. - The composer pill shows the in-use account's usage; dividers separate accounts and redundant notices are gone.
…ion account review gaps - Switch is disabled while the agent is running or initializing: Paseo interrupts a running turn on send, and OMP does not pin while it streams. Its accessible name uses the login label and its hit area grows by 8px. - Two logins sharing a usage account keep IN USE on the one in use. - The pill falls back to the provider peak when the account in use has no usage value, and its tooltip then says all accounts. - Tests cover Paseo's agent lookup through the registered RPC; a comment names the two parts of OMP's identity rules the matcher leaves out. - README lists what reaches the client and the limit of the Copilot single-login link.
…an unlinked login in use - Drop the rule that linked a provider's single identity-less login to its single usage account: one login and one usage key do not prove ownership, so a replaced Copilot login no longer inherits its predecessor's usage. - A login OMP names in use, or the provider's only one, that no usage row matches is named at the top of its provider with IN USE or ONLY LOGIN and no limits, for every provider alike. - Switch's hit slop brings its touch target to 44px; test fixtures drop token- and host-shaped values.
…s login in use - OMP's get_logout_accounts decides `active` by identity, so a pinned Copilot login reads as not in use in a live OMP Plugin session; the popover keeps OMP's answer.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
| Topic | Details | |||
|---|---|---|---|---|
| Metadata and contracts | Read cached usage metadata to attach plan and organization information to quota and account records, normalize personal and business labels, and document profile scoping, identity matching, security boundaries, and user-visible quota behavior.Modified files (1)
Latest Contributors(0)
| |||
| Account-aware quota UI | Display the active account first, distinguish IN USE and ONLY LOGIN, provide guarded Switch actions, and update quota pills, tooltips, reset countdowns, dividers, provider badges, and opaque-model fallback behavior.Modified files (6)
Latest Contributors(0)
| |||
| Session account resolution | Resolve active session logins through live OMP runtime data or persisted session pins, match them to hashed usage accounts using OMP identity rules, scope reads to the agent’s store, and expose safe RPCs for provider detection and account switching.Modified files (8)
Latest Contributors(0)
| |||
| Comprehensive verification | Verify runtime protocol support, identity matching, profile isolation, provider lookup, quota fallback, account ordering, switching behavior, accessibility states, and UI rendering across unit, integration, and harness tests.Modified files (10)
Latest Contributors(0)
|
| /** A fresh HOME, so the daemon default store is `<home>/.omp/agent` and profiles sit beside it. */ | ||
| async function home(): Promise<string> { | ||
| const root = await mkdtemp(join(tmpdir(), "paseo-omp-session-accounts-")); | ||
| quotaRoots.push(root); | ||
| for (const name of LOCATION_ENV) vi.stubEnv(name, undefined); |
There was a problem hiding this comment.
Env isolation placed in helper, not beforeEach
A future test can use the runner’s inherited ambient location settings if it skips home(), since cleanup happens only there; add a beforeEach that stubs PASEO_OMP_AGENT_DIR, OMP_AGENT_DIR, PI_CODING_AGENT_DIR, OMP_PROFILE, PI_PROFILE, PI_CONFIG_DIR, and XDG_DATA_HOME to undefined.
Want Baz to fix this for you? Activate Fixer You can also update your AI coding guidelines based on this comment by apply pr to [branch name]
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
paseo-omp/tests/quota-state.test.ts around lines 833-837, the `session account` tests
clear OMP/Paseo location environment variables only inside the `home()` helper, leaving
tests that do not call it exposed to the runner environment. Add a `beforeEach` for the
describe block that stubs every variable in `LOCATION_ENV` to `undefined`, and remove
the duplicated cleanup loop from `home()` while retaining its temporary HOME setup.
| const inUse = await accountInUse(agentId, entry.quotaProvider); | ||
| const current = pills.get(agentId); | ||
| if (disposed || current !== entry || current.quota !== handle) return; |
There was a problem hiding this comment.
Stale account lookup overwrites quota pill
After /session pin switches to another login for the same provider, an in-flight quota lookup for the old login can still update the unchanged pill, showing stale percentage and severity until the next 30-second refresh; include the pinned login or a request generation in the completion check before applying the result.
Want Baz to fix this for you? Activate Fixer
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
paseo-omp/index.client.tsx around lines 535-537, update the `refreshQuotaStatus` account
lookup and pill update logic so a `/session pin` change cannot apply a stale
`accountInUse` result. Capture a session/request generation or account identity before
awaiting `accountInUse`, then re-check it after the await along with the existing
`PillEntry` and quota-handle checks, discarding the result if the agent’s active login
has changed. Keep the change scoped to the quota refresh flow and ensure the generation
is advanced whenever the session pin state changes.
| const matches = reports | ||
| .filter((report) => report.provider === provider && report.key.endsWith(`:${accountKey}`)) |
There was a problem hiding this comment.
Quota accounts inherit tags from collisions
A quota can inherit the wrong plan or organization because endsWith lets composite account keys collide; extract the full account_key from the cache key and compare it for exact equality instead.
Want Baz to fix this for you? Activate Fixer
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`paseo-omp/server/quota.ts` around lines 109-115, the `accountTags` function incorrectly
uses `report.key.endsWith(...)`, allowing composite account keys to collide and inherit
another account’s tags. Refactor the cache-key matching to extract the encoded
account_key according to the cache-key format and compare it exactly to `accountKey`,
while still checking the provider. Add or update coverage for overlapping keys such as
`|email:x` versus `x`.
| const oauth = logins.filter((login) => login.type === "oauth"); | ||
| const keys = quotaAccountKeysFor( | ||
| databasePath, | ||
| input.provider, | ||
| oauth.map((login) => login.credentialId), |
There was a problem hiding this comment.
Drops sole API-key login from session accounts
Providers whose only stored credential is an API key never show the ONLY LOGIN row because resolveListOmpSessionAccounts keeps only OAuth rows and onlyLogin requires oauth.length === 1; include API-key credentials so this matches the stored-credential query, schema, and PR description.
Want Baz to fix this for you? Activate Fixer
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`paseo-omp/server/quota.ts` around lines 394-410, update `resolveListOmpSessionAccounts`
so API-key rows from `sessionLogins` are not filtered out of the returned `accounts`.
Keep `quotaAccountKeysFor` limited to OAuth credentials, but compute `onlyLogin` from
all stored credentials and map API-key rows with an empty quota-account list, preserving
their label, type, and active state so a sole API key is shown as ONLY LOGIN.
| return sessionId ? storedSessionLogins(databasePath, input.provider, sessionId) : []; | ||
| } | ||
| try { | ||
| return await controls.listProviderAccounts(input.provider); |
There was a problem hiding this comment.
Session-accounts RPC accepts unrelated provider input
resolveListOmpSessionAccounts can expose another provider’s OAuth login identifiers, organization, credential IDs, and active status because it accepts any schema-valid provider; validate the provider against controls.modelProvider() on the live path and the verified stored provider before forwarding or querying.
Want Baz to fix this for you? Activate Fixer
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`paseo-omp/server/quota.ts` around lines 430-430, the `sessionLogins` logic trusts
`input.provider` when calling `listProviderAccounts` or querying stored credentials,
even though the output must describe the session's current model provider. Refactor
`resolveListOmpSessionAccounts`/`sessionLogins` to verify the provider first—use the
live controls' `modelProvider()` on the live path and the agent's verified provider on
the stored path—and reject or return no accounts when they differ. Ensure the
unverified caller-supplied provider is never forwarded to OMP or used in database
queries.
omercnet
left a comment
There was a problem hiding this comment.
thanks @taemire, the Switch gate and the identity-only linking look right. i had the own commits (4bee23f, a2c9427, 0060ea5, 837aa01) reviewed against the SDK and the OMP source. the Paseo SDK has five statuses (initializing, idle, running, error, closed) and a permission wait stays running, so the gate at client/quota-popover.tsx:251-258 covers it. send() has no queue or reject option (only steer and interrupt, and interrupt is the default), so leave activeTurnBehavior out. the linking matches OMP's own rule and i found no wrong IN USE or wrong Switch target. nothing blocks this once 632 and 633 are in.
one small ask: the status can go stale between render and click, so in switchTo (quota-popover.tsx:82-94) re-read it right before sending, for example const live = paseo.agents.ref(agentId).current()?.status and return when it is running or initializing, and assert in the test that send gets no second argument.
smaller, none block: add get_logout_accounts to OMP_RPC_DIAGNOSTIC_COMMANDS (server/provider/omp-rpc-protocol.ts:636-658) so a failure carries its command. README.md:38 should say that live IN USE needs OMP 18.7.0 or newer (older OMP lacks get_logout_accounts and the popover then says it could not read the account) and that the label can also carry a project id or enterprise url. server/quota.ts:223 checks the usage side for the org-only shortcut where OMP's limitMatchesActiveAccount checks the login side, so an org-only login may not link, a comment or a fix would do. the pill now makes one list-session-accounts call per pilled OMP agent every 30 s (index.client.tsx:531-551), each reloading OMP's credential store, so consider caching per store. the provider regex at shared/quota.ts:71 rejects ids with an underscore, which only costs the IN USE mark. baz's thread at tests/quota-state.test.ts:837 is valid but hygiene, the other four are not defects, please resolve all five with a line each since main needs them resolved.
once 632 and 633 are squash-merged, git rebase --onto origin/main 12c773a should drop their commits cleanly. i can push the status re-read on top if you prefer.
Second part of the split of #631: the session account. Stacked on #632 (tags) and #633 (OMP Plugin provider); until they merge, this diff also shows theirs.
Problem
With several logins per provider, the quota UI could not say which account the session uses or move it to another one, and the pill showed the provider's busiest account even when the session no longer used it.
Changes
get_logout_accounts, now marked implemented); any other OMP session, including bundledomp, is matched through the session id Paseo stores to the pin OMP records (session:sticky:<provider>:<session id>). Both read the agent's own store, chosen on the server from the provider Paseo reports; an agent Paseo cannot look up gets no marks./session pin OAuth credential #<id>. It is disabled while the agent is running or initializing, since Paseo would interrupt the turn and OMP does not pin while it streams. Its accessible name is the login label, and its hit slop gives a 44px target.13%, with the provider and account in its tooltip. It falls back to the provider's highest usage, tooltipall accounts, when the account in use is unknown or has no usage value.What reaches the client
As listed in the README: a SHA-256 hash of each usage account key (the raw key stays on the server), and for the session's logins OMP's credential id, OMP's login label (email or raw account id, plus organization name), whether the login is in use or the only stored credential, and the hashes of the usage accounts it links to. Credential data and tokens are never read.
Known limit
OMP's
get_logout_accountsdecidesactiveby identity, so in a live OMP Plugin session a login without one (Copilot) never shows IN USE, even when pinned. The popover keeps OMP's answer; bundledompsessions read the recorded pin and do show it.Verification
npm run check,npm run typecheck: passed.npm test: 100 files passed, 1 skipped; 1515 tests passed, 8 skipped.omp-pluginagent seeded with fictional logins onexample.invalid: after/session pin OAuth credential #3the popover showed IN USE on that login and Switch on the others; pressing Switch sent/session pin OAuth credential #2, OMP confirmed the pin, and the pill followed to that account. An identity-less Copilot login rendered as the unlinked line.The session pinned to
lee@example.invalid(credential #2):The pill tooltip reads
Anthropic · lee@example.invalid (Example Team) · 12% (last recorded usage, not live).