fix(fleet-data/scrape): generalize model-label sniff to claude / gemini / o-series#163
Merged
Merged
Conversation
extract_model_label previously only found `gpt-`, so claude, gemini, and claw panes rendered with no model label. Replace the single-prefix search with a small const slice (gpt-, claude-, gemini-, o1-, o3-, sonnet-, opus-, haiku-) and pick the prefix with the earliest occurrence. Rest of the trailing-word logic is unchanged. - Adds tests for claude/gemini/o3 families. - Adds extract_model_label_picks_earliest_prefix to lock in earliest-match tiebreak when multiple families show up in the same line. - All existing gpt- tests pass unchanged.
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
fleet-data::scrape::extract_model_labelpreviously calledline.find(\"gpt-\"), so it only surfaced a label for codex panes. fleet-launcher also spawnsclaude,gemini, andclawpanes — those rendered with no model label in the artboard'sWORKING ONcolumn.This PR replaces the single-prefix search with a small const slice of model-family prefixes and picks the prefix with the earliest occurrence. The rest of the trailing-word logic is identical.
Prefixes now supported
Tiebreak rule
When multiple families appear in a single line, the one at the earliest byte index wins. Rationale: the pane's actual status line is rendered at a fixed position; later occurrences usually come from scrollback or prompt text mentioning another model. (Longest-match was considered but discarded —
claude-andgemini-would never tie with each other, and the natural reading order is left-to-right.)Tests
Added 4 new test cases covering
claude-,gemini-,o3-, and the earliest-prefix tiebreak. All 70fleet-datatests pass (66 existing + 4 new).Test plan
cargo test -p fleet-data— 70 passed, 0 failedcargo check -p fleet-state -p fleet-waves -p fleet-watcher— all cleangpt-tests unchanged and still passing