Skip to content

fix(paseo-omp): name an OMP Plugin agent's quota provider from its live session - #633

Open
taemire wants to merge 1 commit into
omercnet:mainfrom
taemire:fix/paseo-omp-plugin-quota-provider
Open

taemire wants to merge 1 commit into
omercnet:mainfrom
taemire:fix/paseo-omp-plugin-quota-provider

Conversation

@taemire

@taemire taemire commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Found while running the live check #631 asked for on an omp-plugin agent.

Problem

Paseo shows an OMP Plugin agent's model only as an opaque omp:model:<hash> id. quotaProviderFromSession reads the provider from a provider/model string, so for every OMP Plugin agent it returned null: the composer pill summarized every provider (Quotas · 100%) and the popover never marked a CURRENT PROVIDER. Bundled omp agents were not affected because their model string carries the provider.

Changes

  • New RPC paseo-omp.session-model-provider ({ agentId } to { provider }). The agent's live session maps its opaque model id back to OMP's model through the catalog it already holds (modelProvider() on the session controls). A closed, history-only or unknown agent answers null, which keeps today's all-provider summary.
  • The quota popover asks only when the model string cannot name the provider.
  • The pill asks only for OMP agents whose model is opaque and that are not closed, and reuses the answer until the agent's model or status changes, so a directory update does not fan out one RPC per agent.

Verification

  • npm run check, npm run typecheck: passed.
  • npm test: 100 files passed, 1 skipped; 1490 tests passed, 8 skipped.
  • New tests: the session names the provider behind its opaque model and answers null once its runtime exits or for an unknown agent; the pill summarizes a live plugin agent by that provider, leaves a closed one on the all-provider summary without asking, and asks again only when the model or status changes; an open popover asks again when the session ends or resumes with the same model (a real React Query client). Each was confirmed to fail with the fix, the cache, the closed-agent check or the status key reverted.
  • Live isolated daemon, omp-plugin agent on an Anthropic model, seeded with fictional logins on example.invalid:
Before After
Pill Before: Quotas · 100% across every provider After: the Anthropic summary
Popover Before: every provider RECORDED After: Anthropic marked CURRENT PROVIDER

The pill truncates to Anthropic · 10… in the current label format; the session account PR shortens the pill to the percentage.

…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.
@taemire
taemire requested a review from omercnet as a code owner November 16, 2026 14:47
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f2f48ba9-c0f6-4f37-88a8-fd3e9c02561e
Commits

Reviewing files that changed from the base of the PR and between 5e26f04 and 9b09d11.

Files selected for processing: 11

  • paseo-omp/README.md
  • paseo-omp/client/quota-popover.tsx
  • paseo-omp/client/quota-state.ts
  • paseo-omp/index.client.tsx
  • paseo-omp/index.server.ts
  • paseo-omp/server/provider/session.ts
  • paseo-omp/server/subagents.ts
  • paseo-omp/shared/quota.ts
  • paseo-omp/tests/profile-pills.test.ts
  • paseo-omp/tests/provider-subagent-control.test.ts
  • paseo-omp/tests/quota-popover-session-provider.test.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@baz-reviewer

baz-reviewer Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Add live OMP session provider resolution so Paseo can identify opaque plugin models and attribute quota pills and popovers to the correct provider. Update the quota UI, session controls, RPC handlers, and caching logic to refresh only when agent model or status changes.

Topics

TopicDetails
Flow Verification Verify live-session provider lookup, null responses after runtime exit, provider-specific pill rendering, and cache invalidation when model or status changes.
Modified files (3)
  • paseo-omp/tests/profile-pills.test.ts
  • paseo-omp/tests/provider-subagent-control.test.ts
  • paseo-omp/tests/quota-popover-session-provider.test.tsx
Latest Contributors(0)
UserCommitDate
Provider Quota Attribution Resolve an OMP Plugin agent’s opaque model through its live OmpProviderSession, expose it via paseo-omp.session-model-provider, and use the result to show provider-specific quota summaries and current-provider markers while preserving all-provider behavior for closed sessions.
Modified files (8)
  • paseo-omp/README.md
  • paseo-omp/client/quota-popover.tsx
  • paseo-omp/client/quota-state.ts
  • paseo-omp/index.client.tsx
  • paseo-omp/index.server.ts
  • paseo-omp/server/provider/session.ts
  • paseo-omp/server/subagents.ts
  • paseo-omp/shared/quota.ts
Latest Contributors(0)
UserCommitDate


Merger  Activate to get a short verdict whether this PR is good to go or not

Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

Comment on lines +458 to +460
const provider = (agentId: string) =>
resolveGetOmpSessionModelProvider({ agentId }, registry).provider;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPC provider lookup route escapes coverage

The regression test bypasses the registered RPC route, so it still passes if paseo-omp.session-model-provider is missing or wired to the wrong resolver; invoke it through the server and assert the provider result and unknown-operation error when the route is removed.

Severity

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/tests/provider-subagent-control.test.ts around lines 458-460, update the `get
OMP provider` regression test so it exercises `paseo-omp.session-model-provider` through
the registered server RPC route instead of calling `resolveGetOmpSessionModelProvider`
directly. Assert the transported response contains the expected provider, and add a
focused check that removing or bypassing the route causes the operation to be reported
as unknown.

@omercnet omercnet left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @taemire, this one is good to merge once the thread is resolved. i checked the root cause: the model id is a hash from ompModelId, so the provider could never be parsed from it, and it has been like that since the first plugin commit. the rpc returns only a provider id, only for a live session, and does no OMP call, so it cannot disturb a turn. an old server without the rpc falls back to today's summary.

one thing for the merge: the open baz thread at tests/provider-subagent-control.test.ts:460 asks for the new rpc name in the route list in tests/server-bundle.test.ts. please add it and resolve the thread, main needs all threads resolved.

small follow ups, none blocking: cache a failed lookup under the same key (provider null) so an old or reloading server is not asked once per OMP Plugin agent on every reconcile (index.client.tsx:393-402), skip closed agents in the popover query as the pill path already does, add a rejected-rpc test and a two-agent server test. i can push the route-list line if you prefer, just say so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants