Skip to content

Sidebar tooltip shows the thread model's text, not its repr - #1230

Merged
trissim merged 2 commits into
mainfrom
fix/sidebar-model-tooltip
Oct 25, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/sidebar-model-tooltip

Conversation

@trissim

@trissim trissim commented Oct 25, 2026 •

Copy link
Copy Markdown

Sidebar tooltip: model text, not its repr

Hovering a thread row showed DeclaredModel(text='openai-codex/gpt-6.1-sol'). ThreadStatusRow.show (comms_sidebar.py:260) joined str(value) over its parts, and row.model is a ThreadModel member. The family already owns its shown text: TextChoice.texts() gives (text,) when the model is given and () when it's absent. The tooltip now spreads that. BOUND-8: the family's own text was being flattened by a repr at the call site.

  • Net src: comms_sidebar.py +0 (2 lines changed).
  • Test: tests/textual/test_welcome_view.py::test_a_thread_row_tooltip_names_its_model_by_text, 1 passed locally.

Freeze profile, for the record (no code change here)

py-spy on Toad 59714 for 20 s; 172 main-thread samples:

  • 36.6%: observation.py:1497 results → connection.recv, unpickling observer results on the main thread. 24.4% of that is _dataclass_setstate.
  • 13.4%: deep dataclass __eq__. 8.1% is the ObservedThreadActivity.row var comparing whole ThreadStatusModels, each of which carries a full ThreadPresentation with its notification window. 5.2% is KeyedModel.flush comparing the same rows.
  • About 11%: compositor refresh and render.
  • strace of the observer socket: 8.7 MB read in 15 s, from about 128 KB/s up to about 2 MB/s in bursts.

The freeze is a flood, not a sync read on the switch. The fix belongs to the observer (Core): it sends unchanged sidebar snapshots and thread presentations whole. That's fork-cpu's surface, so it isn't fixed in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V

trissim and others added 2 commits October 25, 2026 02:29
ThreadStatusRow.show joined str(value) over the tooltip parts, and row.model is
a ThreadModel member, so the tooltip printed DeclaredModel(text='...'). The
model family already answers its shown text: TextChoice.texts() is (text,)
when given and () when absent, so the tooltip spreads that instead of
stringifying the object (BOUND-8: the family's own text flattened by repr at
the call site).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V
@trissim
trissim marked this pull request as ready for review October 25, 2026 06:31
@trissim
trissim enabled auto-merge October 25, 2026 06:31
Copilot AI balanced review requested due to automatic review settings October 25, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

@trissim
trissim merged commit efc81dd into main Oct 25, 2026
2 of 3 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.

2 participants