Skip to content

TUI View fix - model names align with current agent#2

Merged
awrobel-gd merged 1 commit into
mainfrom
tui-fix-model-names
Jun 30, 2026
Merged

TUI View fix - model names align with current agent#2
awrobel-gd merged 1 commit into
mainfrom
tui-fix-model-names

Conversation

@awrobel-gd

@awrobel-gd awrobel-gd commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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_models in backend/app/api/v1/generation_sessions.py is the divergence point: usage goes to aggregate_model_usage_by_workspace (unchanged, lifetime), models go to the new _ws_models_for_view which 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_query yet (usage tree is empty for that prefix), _configured_model_for_active_step falls back to the tier config stored on the session's parameters field plus any per-workspace routing override from workspace_model_overrides — so the display shows the actual assigned model even before the first query lands. Tests were previously hardcoded to default settings.LLM_* values; they now supply explicit overrides via parameters in the mock doc so they are not sensitive to config changes.

@awrobel-gd awrobel-gd self-assigned this Jun 30, 2026
@awrobel-gd awrobel-gd added the bug Something isn't working label Jun 30, 2026
@awrobel-gd
awrobel-gd force-pushed the tui-fix-model-names branch from 6c798e2 to 40283db Compare June 30, 2026 11:02
@awrobel-gd
awrobel-gd merged commit 3175b35 into main Jun 30, 2026
3 checks passed
@mkonopelski-gd
mkonopelski-gd deleted the tui-fix-model-names branch July 1, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants