feat: display model information in session UI#203
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `session.model_change` event handling to the Copilot JSONL parser. The current model is stamped onto each assistant message via `ParsedMessage.Model`, matching behaviour of the Claude, Codex, and Gemini parsers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Compute the most frequently used model across assistant messages - Returns empty string if no model data is present - Tie-break alphabetically Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Import computeMainModel utility - Add subagentModel derived value from lazily-loaded messages - Display model badge in toggle header after token counts - Style with muted text color and fixed font size Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Gate session header and per-message model badges on full message history being loaded (hasOlder === false) and matching session ID - Allow Copilot model_change with empty newModel to clear active model - Add test for model reset edge case
roborev: Combined Review (
|
roborev: Combined Review (
|
Move computeMainModel into a $derived property on MessagesStore so it computes once per store update. Components now read messagesStore.mainModel instead of each computing independently.
roborev: Combined Review (
|
roborev: Combined Review (
|
Remove the hasOlder guard from mainModel derivation so that sessions loaded progressively (>20k messages) still compute and display model badges from the loaded messages rather than suppressing them entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
|
Accepted risk, this is a tradeoff that there will be esoteric cases that arise with very large sessions. |
Summary
session.model_changeevents, stampingParsedMessage.Modelon assistant messagescomputeMainModel()frontend utility that derives the session's primary model client-side from loaded messages (no DB schema changes)Design decisions
main_modelcolumn on the sessions table and associated SQLite/Postgres migrations. Can be promoted to a DB column later if needed.isSubagentContextguard prevents incorrect comparisons against the parent session's main model. Subagents show their model in the toggle header instead.Test plan
computeMainModel()unit tests (empty, single, majority, tie-break, user messages ignored)