You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(omp): preserve native service tiers and durable chat throughput - #41577
OMP chats gain a speed picker that keeps the choices OMP actually offers, plus a reliable tokens-per-second number after a turn finishes. Turning off inline visuals or reopening a chat keeps these capabilities working.
What Changed
Add a bundled OMP telemetry extension and load it for fresh/resumed ACP sessions and model discovery, independently of visuals and scratch setup.
Preserve native provider-family tier choices, descriptions and reported current values. The OMP 18.19 regression fixture covers seven choices (None, Auto, Default, Flex, Scale, Priority, Ultrafast); the implementation discovers them rather than installing a provider-tier table.
Default to None when no override is configured. None clears the override; literal Default remains selectable. Reasoning effort stays independent, and saved/live choices use the existing ACP option path. Provider adapters decide whether a selected value reaches a request.
Carry actual assistant usage.output and measured provider-request durations through ACP translation and the durable journal to desktop/mobile settled-turn status. Cumulative snapshots replace prior snapshots instead of double-counting.
Prefer native request duration; otherwise use the actual provider-request/message-end interval. The rate includes first-token wait and excludes tool gaps. Synthetic zero-token notices preserve valid prior measurements. Running turns, unmeasured history, incomplete timing/counters and intervals below 100 ms show no rate. Text length never estimates tokens.
Update the existing development documentation and regression tests. No package-version change, fork-maintenance configuration or private environment data is included.
Why
A boolean Fast control discards valid native OMP choices, and conflating None with Default changes the request's meaning. Provider-native usage and request timing provide a meaningful, reload-safe rate without counting time spent running tools.
After screenshots from the prior isolated Linux packaged validation of the accepted feature tree, using real OMP 18.19 and a deterministic loopback provider in a synthetic profile. These demonstrate the native picker and rendered settled/reloaded request metrics; the displayed rates are regression measurements, not hosted-provider performance claims. This was not a new package build of the PR head. The feature UI is preserved through the subsequent upstream integration and test-only correction.
Native seven-choice picker
Settled rates after restoring and resuming the existing conversation
A before screenshot was not retained. The PNG-only orphan evidence ref in the contributor fork contains no application/source files or private chat/profile data. This provides Linux after-state evidence; macOS/Windows/SSH rendered validation remains unverified.
Testing
Owner-reported home acceptance test passed for the accepted feature snapshot.
Seven focused native/shared test files: 43 passed.
Mobile picker regression file: 2 passed.
Linux source Node 24.22.1, pnpm 12.14.0 and Bun 1.4.4 used for the final focused regression batch.
Node/web/mobile typechecks passed; mobile generated prerequisites were produced by the repository's actual postinstall scripts.
Complete pnpm check:changed --base=upstream/main --maxWorkers=2 --timeout=1 gate: 38/39 checks passed; broad related-unit selection timed out after 60 seconds.
Full lint/test/build suite and macOS/Windows/remote rendered validation.
Every added test's fail-on-revert property individually demonstrated. Existing focused assertions pass; no revert experiment was run.
The main boundary is ACP extension events entering durable session journals and shared option state. Regressions could hide a settled rate, misreport a tier, or affect restored chats/paired mobile clients. Missing measurements intentionally leave the existing turn status intact. The extension is OMP-specific; the shared usage fields are optional. A plain revert restores prior behavior; historical measured entries remain optional journal data.
AI Disclosure
Implemented and integrated with AI coding assistance, including OpenAI GPT-6.1-sol for this contribution preparation.
Review
Agent summary: OMP-only extension discovery reuses the existing launch/ACP flow and applies on restore as well as initial launch. Shared optional usage metadata serves desktop and mobile. Paths remain in the existing host launch/resource machinery; no new local-only provider installation or process spawning convention is introduced. Throughput uses provider counters and request intervals rather than tokenizer estimates or wall-clock turn duration. Linux source regressions/types and prior isolated packaged after screenshots are provided; macOS/Windows/SSH rendered validation and a retained before image are outside the current evidence. No secrets, production state or fork deployment workflow are included.
Agent skill upstream boundary
Not applicable: this change copies no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments or documentation.
Notes
Submitted for upstream CI and review with the local broad-unit gate explicitly incomplete. The final mandatory changed gate ran against the frozen upstream/main base after the last source edit: 51 feature files selected; formatting, oxlint, changed-code quality, node/web/CLI types and all selected non-unit checks passed (38/39 checks). Its broad related-unit lane exceeded the explicit 60-second limit. An earlier attempt also reported an Electron auto-download fetch failure. The previously observed /bin/zsh-dependent lane remains unavailable locally; no dedicated retry was run. Focused feature tests above are the completed unit evidence. No new heavy packaging build or activation was performed.
The PR is ready for review. One ready-state gh pr checks --watch reported no surfaced checks; the triggered PR Checks, Mobile Checks, and Headless Node server runs report action_required. PR Checks has zero jobs, so this is an upstream workflow-admission gate rather than a completed test failure. Maintainer action is needed before those checks execute; merge remains subject to required CI and review. No workflow approval, CLA or contributor agreement was signed on the owner's behalf.
Checklist
One cohesive OMP native-chat metrics and service-tier feature
User-facing before/after, mechanism and rationale explained
Risk and revert behavior described
Linux after screenshots attached with provenance and coverage limits; before screenshot not retained
Cross-platform, SSH/remote and mobile boundaries considered
Full required gates green; pending external CI/review
The changes add an OMP ACP extension that reports native service-tier choices and generation measurements. ACP sessions handle service-tier commands and carry generation usage through the timeline and journal. Shared option logic distinguishes none from literal default. Settled desktop and mobile turn-status displays show a formatted token rate when valid usage data is available.
Severity of issue fixed: Medium
Merge Risk: Moderate · up to a7c4b
The new tier picker and tok/s display may not work at all on the minimum supported OMP version. An opening-message tier can also be silently ignored, and the tok/s display can be lost in some cases. Resolve the version-support gap and the opening-turn tier race before merging; the other issues are small follow-ups.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes: preserving OMP native service tiers and adding durable throughput (tokens per second) for chats. The changeset covers both: the service-tier picker and option han…
Description check
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #41574), Visual Proof with before/after context, Testing, Risk with level Medium, AI Disclo…
Linked Issues check
Issue #41574 is the only active direct link, so its coding requirements apply. The PR addresses each requirement group:
1. Service tiers: serviceTierOption and effectiveServiceTier keep tiers as …
Out of Scope Changes check
Every changed area maps to issue #41574's objectives. These areas are: OMP extension and launch wiring; ACP option read, write, and report paths for service tiers; durable journal and timeline fields …
Full details: Title check
Explanation
The title names the two main changes: preserving OMP native service tiers and adding durable throughput (tokens per second) for chats. The changeset covers both: the service-tier picker and option handling, and the generation-usage timing carried through ACP, the journal, and the settled-turn status. The title is specific and follows the conventional-commit style. It does not cover the telemetry extension or the docs, which is acceptable.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #41574), Visual Proof with before/after context, Testing, Risk with level Medium, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the mechanism and the revert path. Gaps: the Visual Proof section has no before screenshot, which the template requires for UI changes. Testing leaves several boxes unchecked, including the full gate and the fail-on-revert check, and the Testing section does not list macOS, Windows, or SSH validation. The Notes section reports a 38/39 changed-gate result and a timed-out broad lane. The 'Every added test fails without this change' item is explicitly unverified. These are disclosed, not hidden, but the PR is not merge-ready on the template's own terms.
Resolution
Consider adding a before screenshot or an explicit justification for its absence in Visual Proof. State which platforms were actually tested in Testing. Clarify the status of the unchecked gates in the checklist before review.
Full details: Linked Issues check
Explanation
Issue #41574 is the only active direct link, so its coding requirements apply. The PR addresses each requirement group:
Service tiers: serviceTierOption and effectiveServiceTier keep tiers as reported. none is the clear choice when listed. Literal default stays selectable (structured-agent-session-native-tier tests, native-chat-session-option-snapshot tests). omp-native-chat-options.ts validates and attaches reported tiers. Reasoning effort is handled by its existing option path.
Telemetry loading: acp-structured-launch-resolution.ts (read at head) passes --extension for omp using visuals?.skill ?? await resolveNativeChatVisualsSkillLocation(). The fallback resolves the bundled extension path without requiring inline visuals to be enabled, which matches the requirement for independence from visuals/scratch setup. Model discovery is covered by acp-model-catalog-probe.ts changes.
Throughput: omp-native-chat.mjs and omp-native-chat-extension.test.ts cover native duration preference, fallback to the before_provider_request interval (including first-token wait), skipping zero-token synthetic notices, and suppressing invalid measurements. agentSessionTokensPerSecond hides rates when output is 0 or duration is under 100 ms.
Durable journal: generationUsage is added to the journal schema and turn lifecycle, and reviseTurnBody replaces (does not add) the prior snapshot. omp-generation-usage.test.ts covers settlement and reload.
Desktop and mobile display: NativeChatWorkingStatus, MobileNativeChatTurnStatus, and formatNativeChatTurnRate display the settled rate. Hiding for running turns and unmeasured history is covered by native-chat-turn-status.test.ts.
Unverified in this review: the reported test pass counts and the screenshots were not re-executed. The broad changed-code gate is incomplete, as the PR description states. These gaps affect verification evidence, not the code-level requirement mapping.
Full details: Out of Scope Changes check
Explanation
Every changed area maps to issue #41574's objectives. These areas are: OMP extension and launch wiring; ACP option read, write, and report paths for service tiers; durable journal and timeline fields for generation usage; shared speed-tier and option-label logic; desktop and mobile turn-status display; the renderer fixture used to verify the speed menu; and the development documentation section describing the rate calculation. The tests cover these same changes. The PR makes no package-version change. The PR description reports no fork-maintenance or private-data files in the change set. Nothing in the summary falls outside the linked issue's scope.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Heavy lift
Support OMP 17.0.5 or raise the declared minimum.
The launch registry accepts OMP 17.0.5 as a minimum. On that release, extension contexts have no agent field, so root(ctx) returns false. reportOptions then returns early, and the extension sends no service-tier options. Generation metrics are also skipped because they use the same guard.
Either raise minimumVersions in src/main/acp/launch/acp-launch-registry.ts to a release whose extension context provides agent, or add a main-agent check that works on 17.0.5.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Use the measured interval when the native duration is not positive.
message.duration ?? elapsed keeps a native 0, because ?? falls back only for null or undefined. The later duration > 0 check then fails. measured becomes false for the rest of the turn, and later assistant messages return before any generation report. A valid elapsed value is discarded in this case.
The OMP AssistantMessage type declares duration?: number with no lower bound. A native duration of 0 can therefore reach this handler on a message with output tokens.
Treat a nonpositive native duration as unavailable and use the measured interval instead:
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Clear the cached service tier when the model changes.
invalidateInput('model') clears the cached model and effort entries, but not serviceTier. After a model switch that uses setModel, a stale serviceTier entry can make the loop skip a tier write that the new model needs. The message can then run with the new model's default tier instead of the selected one.
The tier is re-applied on the next send after a model change. For providers that set tiers through a prompt, this sends one additional hidden command.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Heavy lift
Gate the opening turn on the initial tier report.
Dispatch does not wait for OMP's tier report. The report reaches adoptServiceTiers only through a notification (acp-structured-acquire.ts:135). Startup awaits initialization, session start, the child-stop probe, and the permission-mode write, but not this notification. The first dispatch runs applyAcpMessageOptions (acp-structured-session-adapter.ts:124). If the report has not arrived, write('serviceTier') returns null (acp-structured-options.ts:225-232, omp-native-chat-options.ts:53-54). The guard at acp-message-execution-options.ts:37 then skips the requested tier silently, and the turn continues at the provider's existing tier.
Keep the skip for a tier that the reported model does not offer. Do not apply it before the report exists. Wait for the initial tier report before the opening turn dispatches, or fail that turn when a requested tier cannot be applied.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Reserve bytes for generationUsage in the turn-row reservation.
agentJournalTurnRowReservedBytes does not include generationUsage. reviseTurnBody writes that field into the body, and resolveAgentJournalTurnRowWrite checks the body against the reservation. When retained context is close to its size bound, the body can exceed the reservation. The write then falls back to lifecycle alone, which drops the retained usage, or a usage-only write returns null. The settled rate is lost for that turn.
Add a bound for the field to the reservation:
Suggested fix
/** Reserve lifecycle space even for rows created by other writers. */
const TURN_ROW_BYTES_WITHOUT_CONTEXT = 8 * 1024
++/** Worst-case JSON size of the two-number generation usage object. */+const GENERATION_USAGE_BYTES_BOUND = jsonBytes({+ generationUsage: { outputTokens: Number.MAX_VALUE, durationMs: Number.MAX_VALUE }+})
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
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.
ELI5
OMP chats gain a speed picker that keeps the choices OMP actually offers, plus a reliable tokens-per-second number after a turn finishes. Turning off inline visuals or reopening a chat keeps these capabilities working.
What Changed
None,Auto,Default,Flex,Scale,Priority,Ultrafast); the implementation discovers them rather than installing a provider-tier table.Nonewhen no override is configured.Noneclears the override; literalDefaultremains selectable. Reasoning effort stays independent, and saved/live choices use the existing ACP option path. Provider adapters decide whether a selected value reaches a request.usage.outputand measured provider-request durations through ACP translation and the durable journal to desktop/mobile settled-turn status. Cumulative snapshots replace prior snapshots instead of double-counting.Why
A boolean Fast control discards valid native OMP choices, and conflating
NonewithDefaultchanges the request's meaning. Provider-native usage and request timing provide a meaningful, reload-safe rate without counting time spent running tools.Linked Issue
Fixes #41574
Visual Proof
After screenshots from the prior isolated Linux packaged validation of the accepted feature tree, using real OMP 18.19 and a deterministic loopback provider in a synthetic profile. These demonstrate the native picker and rendered settled/reloaded request metrics; the displayed rates are regression measurements, not hosted-provider performance claims. This was not a new package build of the PR head. The feature UI is preserved through the subsequent upstream integration and test-only correction.
Native seven-choice picker
Settled rates after restoring and resuming the existing conversation
A before screenshot was not retained. The PNG-only orphan evidence ref in the contributor fork contains no application/source files or private chat/profile data. This provides Linux after-state evidence; macOS/Windows/SSH rendered validation remains unverified.
Testing
pnpm check:changed --base=upstream/main --maxWorkers=2 --timeout=1gate: 38/39 checks passed; broad related-unit selection timed out after 60 seconds.Focused native/shared files:
omp-native-extension-launch,omp-service-tier,omp-generation-usage,omp-native-chat-extension,structured-agent-session-native-tier,native-chat-session-option-snapshot,native-chat-turn-status; mobile:MobileNativeChatSessionOptionPickers.Risk
Level: Medium
The main boundary is ACP extension events entering durable session journals and shared option state. Regressions could hide a settled rate, misreport a tier, or affect restored chats/paired mobile clients. Missing measurements intentionally leave the existing turn status intact. The extension is OMP-specific; the shared usage fields are optional. A plain revert restores prior behavior; historical measured entries remain optional journal data.
AI Disclosure
Implemented and integrated with AI coding assistance, including OpenAI GPT-6.1-sol for this contribution preparation.
Review
Agent summary: OMP-only extension discovery reuses the existing launch/ACP flow and applies on restore as well as initial launch. Shared optional usage metadata serves desktop and mobile. Paths remain in the existing host launch/resource machinery; no new local-only provider installation or process spawning convention is introduced. Throughput uses provider counters and request intervals rather than tokenizer estimates or wall-clock turn duration. Linux source regressions/types and prior isolated packaged after screenshots are provided; macOS/Windows/SSH rendered validation and a retained before image are outside the current evidence. No secrets, production state or fork deployment workflow are included.
Agent skill upstream boundary
Notes
Submitted for upstream CI and review with the local broad-unit gate explicitly incomplete. The final mandatory changed gate ran against the frozen upstream/main base after the last source edit: 51 feature files selected; formatting, oxlint, changed-code quality, node/web/CLI types and all selected non-unit checks passed (38/39 checks). Its broad related-unit lane exceeded the explicit 60-second limit. An earlier attempt also reported an Electron auto-download fetch failure. The previously observed
/bin/zsh-dependent lane remains unavailable locally; no dedicated retry was run. Focused feature tests above are the completed unit evidence. No new heavy packaging build or activation was performed.The PR is ready for review. One ready-state
gh pr checks --watchreported no surfaced checks; the triggered PR Checks, Mobile Checks, and Headless Node server runs reportaction_required. PR Checks has zero jobs, so this is an upstream workflow-admission gate rather than a completed test failure. Maintainer action is needed before those checks execute; merge remains subject to required CI and review. No workflow approval, CLA or contributor agreement was signed on the owner's behalf.Checklist