Skip to content

fix(fleet-data/scrape): generalize model-label sniff to claude / gemini / o-series#163

Merged
NagyVikt merged 1 commit into
mainfrom
fix/scrape-model-label-multi-family
May 16, 2026
Merged

fix(fleet-data/scrape): generalize model-label sniff to claude / gemini / o-series#163
NagyVikt merged 1 commit into
mainfrom
fix/scrape-model-label-multi-family

Conversation

@NagyVikt
Copy link
Copy Markdown
Contributor

Summary

fleet-data::scrape::extract_model_label previously called line.find(\"gpt-\"), so it only surfaced a label for codex panes. fleet-launcher also spawns claude, gemini, and claw panes — those rendered with no model label in the artboard's WORKING ON column.

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

const MODEL_PREFIXES: &[&str] = &[
    \"gpt-\", \"claude-\", \"gemini-\", \"o1-\", \"o3-\",
    \"sonnet-\", \"opus-\", \"haiku-\",
];

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- and gemini- 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 70 fleet-data tests pass (66 existing + 4 new).

Test plan

  • cargo test -p fleet-data — 70 passed, 0 failed
  • cargo check -p fleet-state -p fleet-waves -p fleet-watcher — all clean
  • Existing gpt- tests unchanged and still passing

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.
@NagyVikt NagyVikt merged commit 86b2182 into main May 16, 2026
2 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