feat: surface model information in the UI#182
feat: surface model information in the UI#182MCBoarder289 wants to merge 4 commits intowesm:mainfrom
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
|
That is a good review and caught a case I don't see often locally (subagent sessions). I went ahead and added that scenario to the frontend and added some tests for that. |
roborev: Combined Review (
|
- Parse model from three sources in priority order:
1. session.shutdown modelMetrics: accumulate request counts across
all shutdown events (Copilot appends one per reconnect) and pick
the majority — stored as main_model on the session
2. tool.execution_complete model field: backfills the preceding
assistant message and keeps currentModel current for subsequent
messages
3. session.model_change: sets currentModel for future messages
- Add ComputeMainModel helper as a fallback when no shutdown metrics
are available (counts model assignments across assistant messages)
- Add main_model column to sessions table with idempotent migration;
bump dataVersion to 5 to trigger full resync
- Add MainModel to db.Session, ParsedSession, and plumb through
UpsertSession, all column scan sites, and toDBSession in sync
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add main_model field to frontend Session interface (core.ts) - Add shortModelName() utility to format.ts: strips claude-/gpt-/gemini- vendor prefixes for compact display; full name preserved as tooltip title - SessionBreadcrumb: show model-badge next to agent/token badges when session.main_model is set (e.g. "sonnet-4.6" for claude-sonnet-4.6) - SubagentInline: show toggle-model label alongside token info in the subagent header row - MessageContent: derive offMainModel — when an assistant message's model differs from the owning session's main_model, show a small muted label next to the timestamp (non-invasive; hidden when all messages use the same model) - Tests: add shortModelName unit tests; add model-badge show/hide tests to SessionBreadcrumb.test.ts; update all session mock objects with main_model field (736 tests pass) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When session.shutdown has currentModel but empty modelMetrics (and no session.model_change or tool.execution_complete set the model before any assistant message), shutdownModelCounts is empty and ComputeMainModel returns ''. b.currentModel holds the correct value from the shutdown event but was never used for MainModel. Add it as a final fallback: shutdownModelCounts > ComputeMainModel > b.currentModel. Update TestParseCopilotSession_ModelFromShutdownCurrentModel to assert the expected model instead of documenting the broken behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…text MessageContent resolved owningSession from sessions.sessions, which only holds top-level sessions. When rendered inside SubagentInline, the child session lives in sessions.childSessions, so the model comparison fell back to the parent's main_model and showed incorrect off-main-model badges for subagent messages. Fix: add optional owningSession prop to MessageContent. SubagentInline already has the child session in subagentSession (from sessions.childSessions) and now passes it explicitly. The fallback lookup in sessions.sessions is preserved for all other call sites. Adds MessageContent.test.ts with 7 cases covering: - badge hidden when message.model matches session main_model - badge shown when model differs from session main_model - no badge when message has no model - no badge for user-role messages - explicit owningSession prop used for child session comparison (subagent case) - badge shown when subagent message differs from child session main_model - fallback to sessions.sessions lookup when no prop provided Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
93470d4 to
86d4eaf
Compare
roborev: Combined Review (
|
|
^ I think that latest roborev review is a false positive... I added the ? in the VALUES list for the new column I added. There were 17 args previously, now there are 18. Not sure where it got 19? This was after I rebased and cleaned up some super small merge conflicts |
This is an initial draft to address #123 , and surfaces model information that is available from the agent sessions.
Copilot parsing is the first that I built in here. It establishes a common pattern for a "main" model at the session level near the breadcrumb, and then surfacing specific models on messages when it differs from the main model. Took a minimal approach that we could iterate on.
My main concern would be the scalability of computing the main model on an active session (currently would grow with the number of messages). Could refactor that but didn't want to prematurely optimize just yet.
Let me know what you think, and happy to iterate on the approach.