Skip to content

feat: show when the model changes between tasks - #2098

Merged
Douglasymlai merged 1 commit into
mainfrom
feat/model-change-divider
Oct 23, 2026
Merged

Douglasymlai merged 1 commit into
mainfrom
feat/model-change-divider

Conversation

@Douglasymlai

Copy link
Copy Markdown
Contributor

Pull Request

Related Issue

Split out of #1958 (chat timeline presentation and controls) so it can be reviewed on its own. Builds on #2061, which added each Task's resolved model to the Run list.

Description

Problem
If you switch models partway through a Session, nothing in the chat shows which Tasks ran on which model. Reading back through a Session, you can't tell where the switch happened.

Cause
The chat had no per-Task model information. #2061 added the model each Task actually ran on to the Run list, but the chat never read it.

Fix

  • A thin divider reading "Model changed to <model>" now appears above the first Task that ran on a different model from the Task before it.
  • It works in the default chat view and in the event timeline (Normal and Detailed).
  • The model comes from the Run list reads the Session already makes when it opens, so opening a Session costs no extra request. When a Task starts or finishes, one small read of the newest Task picks up its model, so the divider appears without reopening the Session.
  • No divider is shown above the first Task, or when either Task's model is unknown (for example, a Task that stopped before it began running). A Task with an unknown model is skipped, so the next Task is compared with the last known model.
  • Anything in the response that isn't a complete model identity is treated as unknown, never guessed.
  • The label is translated in all 11 languages. It uses the shared Separator and meta text styles, and a long model name is truncated with its full text in a tooltip.

Testing Evidence (REQUIRED)

Automated:

  • New tests cover reading models from the Run list (malformed values, Tasks from other Sessions, merging a newest-Task read), the divider rules (different model, same model, unknown on either side, first Task), placement in the default chat view including the read when a Task starts and finishes, and placement in the event timeline in both Normal and Detailed.
  • npx vitest run --config vitest.config.ts test/unit/components/ChatBox test/unit/service test/unit/hooks: 1369 tests passed. One file, useInstallationSetup.test.ts, fails to load the same way on a clean main checkout, so it is unrelated to this change.
  • npm run type-check, ESLint and Prettier on the changed files, npm run check:i18n, npm run check:design-tokens and git diff --check all pass.

Manual verification: not done yet. To check: open a Session, run a Task, switch the model, run another Task. The divider should appear above the second Task once it starts or finishes, in both the default chat view and the event timeline (VITE_CHATBOX_EVENT_BUS=true). Also check light and dark themes and a narrow window.

  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@Douglasymlai
Douglasymlai marked this pull request as ready for review October 22, 2026 23:41
@Douglasymlai
Douglasymlai merged commit c6787c5 into main Oct 23, 2026
10 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.

1 participant