Skip to content

feat(models): preserve exact Bot pins and show recorded usage - #462

Merged
chayapats merged 4 commits into
mainfrom
jit/421-s16-model-choice
Nov 17, 2026
Merged

chayapats merged 4 commits into
mainfrom
jit/421-s16-model-choice

Conversation

@chayapats

@chayapats chayapats commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #421. Refs #392.

Behavior

A saved Bot route/model/effort is now an exact pin. Removing it from policy holds new work with selection_pinned instead of using the default. The profile form preserves an unavailable choice, refuses an unrelated edit that would clear it, and stores the exact selection rather than a mutable catalog index. Choosing another approved route or the installation default is explicit. Active work keeps its original POLICY pin; later work retains Bot/conversation/memory continuity in a fresh native context.

Adds s16-client-models/v1 over existing MODEL15 services: configured route/account/billing/recipient metadata and budget facts beside Bot controls, plus recorded work usage in conversation snapshots. Physical sends, requested/sent/reported effort, tokens, charged calls and measured/unknown spend stay distinct. Partial measurements are labelled as subtotals. Read-only routes never discover a provider, renew credentials or start inference. Protected sign-in reuses /settings/provider.

Queries at most 128 recent steps for the authorized snapshot's at most 32 works using an additive SQL index; output and native-session handles are excluded before parsing. No new store, provider SDK, dependency, runtime loop or policy/default-runtime migration. ADR 0093 supersedes only ADR 0088's silent fallback; existing account/billing/private-recipient gates remain.

Validation

Head: 72b21b1e8f69f6cd30554972f2fd1fcd0cdb023c, updated with merged #461. Both browser-card and model projections remain composed.

  • Ten-file composed model/Bot/client/dispatch/renewal/disclosure/restart/packed regression: 118 pass, 0 fail. Latest client/projection validation: 27 pass, 0 fail.
  • Restoring the previous resolver makes the withdrawn-pin regression fail.
  • Actual React bundle: English 1440 px and Thai 390 px model controls/usage pass, including keyboard access, unavailable pin preservation, explicit default choice, protected sign-in entry and no overflow. Existing Bot browser regressions also pass (4 combined cases).
  • Packed public Schway consumer: a fresh instrumented headless import/host loads no unselected provider implementation or TUI; existing protocol cases verify exact dispatch, pins, caps and renewal.
  • Local typecheck, provenance and diff checks pass. Full CI and review are pending.
  • Main integration: 479 pass / 0 fail across 15 affected suites, including browser cards, screen, native input history, client/composition and MODEL regressions. The host-date correction is now already on main.

Live subscription/account/device evidence is not claimed here and remains #431. Imported source/provenance is unchanged.

Copy link
Copy Markdown
Owner Author

@greptileai please review exact head c3083fd3c12c82e6ad4e42414749a0d7e46cee50, focusing on exact pin preservation, unchanged active-work selection, private/unknown usage projection, bounded SQL reads and native/client continuity. Implementation and validation are concrete in ADR 0093 and the PR body. All local affected checks pass; full CI/review remain required before merge.

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Preserves exact Bot model choices and adds protected views of configured routes, budgets and recorded usage.

  • Bot model choices stay pinned until the owner changes them.
  • The owner can see configured model routes and budget facts.
  • Conversation snapshots show bounded recorded model usage.

Both previous threads were rechecked. The missing-route fallback is fixed. The Thai spend label already contains the correct text, supporting chayapats’s reply that no text change was needed. Neither supplied thread has a Comment number.

Review used source inspection; no tests or browser checks were run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[New Bot request] --> B{Saved model choice?}
  B -- No --> C[Installation default]
  B -- Yes --> D{In policy and configured?}
  D -- No --> E[Hold: selection_pinned]
  D -- Yes --> F[Admit exact choice]
  C --> G[Existing dispatch checks]
  F --> G
  H[Authorized conversation snapshot] --> I[At most 32 work IDs]
  I --> J[Read at most 128 recorded steps]
  J --> K[Show usage without output or native handles]
Loading

Reviews (2) · Last reviewed commit: "fix(models): hold explicit pins when con..." · Reviewed by Greptile

Comment thread src/s16/bots/service.ts Resolved
Comment thread src/i18n/th.ts Resolved

Copy link
Copy Markdown
Owner Author

@greptileai please re-review exact head 5f51fbfc after the missing-configured-route fix. Both inline findings have evidence-backed replies. The new composed regression was verified to fail before the fix and pass afterward; 22 Model/Bot tests and typecheck pass. The main integration remains included.

@chayapats
chayapats merged commit bc414ef into main Nov 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontier] [MODEL16-01] Switch approved routes with actual usage and continuity

1 participant