fix(chat): report the service tier a run resolved to - #164
Merged
Merged
Conversation
The app pins the model, the reasoning effort and the model chain per run and reports all three, but never named the service tier. A measured app session recorded `service_tier_change: "priority"` at startup while the string `serviceTier` appeared nowhere in server/, shared/ or src/ - so the app could not display, audit or explain the tier its own runs billed at. That is not cosmetic. The runtime's schema is explicit: `priority` is realized on Anthropic as `speed: "fast"` on supported Opus models, so the tier changes what a turn costs. `session.serviceTier` was already a public getter one call away, beside the reasoning level this file has read since it was written. This reads it into the same snapshot, validates it the same way on the client, and renders it in the Agent sidebar's Environment block - which already documents itself as reports rather than controls, and already omits a row whose fact is unknown. Absent stays absent. `undefined` is the runtime saying "omit service_tier", which is its own default, so no row is rendered rather than one claiming a tier the request never carried. Refs #160
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.
Refs #160.
The gap
The app pins the model, the reasoning effort and the model chain per run, and reports all three. It never named the service tier.
A measured app session recorded this at startup:
while:
The app could not display, audit or explain the tier its own runs billed at, and the user's
~/.gjc/agent/config.ymldoes not set one either — so nothing on either side of the boundary could account for it.Why it matters
The runtime's own schema is explicit about the cost meaning:
So the tier changes what a turn costs, on the same model, at the same effort. Reporting the effort but not the tier tells half the story.
What this does
session.serviceTierwas already a public getter, one call away, beside thethinkingLevelthatgjc-session-state.tshas read since it was written. This:server/gjc-session-state.ts),src/contexts/sessionStatusSnapshot.ts, including the equality check that decides whether to re-render),agentSidebar.environment.serviceTieradded to all 10 locales;scripts/check-locale-parity.test.mjspasses.Absent stays absent
undefinedis the runtime saying "omitservice_tier", which is its own default (theserviceTierschema default isnone). No row is rendered rather than one claiming a tier the request never carried. Same for a blank or wrongly typed value.Scope
This closes the visibility half of #160. Making the tier selectable needs a Settings surface and is deliberately not in this PR — #160 stays open for it.
Verification
New tests cover: the tier is read off the session; an omitted or blank tier stays absent; a throwing tier getter does not take the rest of the snapshot down (this runs inside the turn's event path); the client drops a wrongly typed tier; the tier participates in the snapshot equality check; and both render cases in the DOM.