TUI View fix - model names align with current agent#2
Merged
Conversation
awrobel-gd
force-pushed
the
tui-fix-model-names
branch
from
June 30, 2026 11:02
6c798e2 to
40283db
Compare
akozak-gd
approved these changes
Jun 30, 2026
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.
Summary
The TUI workspace drill-in was showing stale model names — Haiku from the plan converter during KB init, or the full history of models once coding started. This PR scopes the displayed model to the active workflow step while keeping usage tokens on the full lifetime aggregate.
Entrypoint
_ws_usage_and_modelsinbackend/app/api/v1/generation_sessions.pyis the divergence point: usage goes toaggregate_model_usage_by_workspace(unchanged, lifetime), models go to the new_ws_models_for_viewwhich scopes by_active_workflow_prefix.Diagram
Converter (Haiku) → KB init (Opus) → Phase 1..N (Sonnet, round-robin per workspace)
Model display always shows only the rightmost active step; usage accumulates across all.
Details
When the active step has no completed
agent_queryyet (usage tree is empty for that prefix),_configured_model_for_active_stepfalls back to the tier config stored on the session'sparametersfield plus any per-workspace routing override fromworkspace_model_overrides— so the display shows the actual assigned model even before the first query lands. Tests were previously hardcoded to defaultsettings.LLM_*values; they now supply explicit overrides viaparametersin the mock doc so they are not sensitive to config changes.