feat(agents): add claude-sonnet-5 to model catalog - #334
Conversation
Expose session actions on web, including Copy Session ID, Tags, and Pin.\n\nTests: pending focused UI test; this worktree has no dependencies.
- Add Sonnet 5 to CLAUDE_EFFORT_LEVELS_BY_MODEL_ID with full [low, medium, high, xhigh, max] support - Add Sonnet 5 to CLAUDE_1M_CONTEXT_MODEL_IDS and CLAUDE_1M_ALWAYS_ON_MODEL_IDS (always 1M context) - Add Sonnet 5 static model entry (after Fable 5, before Opus 4.8) with 1M context window - Tests: effort, contextWindow, models, CLI effort args, agentModelsProbe Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 1480 files, which is 1330 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (11)
📒 Files selected for processing (1480)
You can disable this status message by setting the |
Greptile SummaryThe PR registers Claude Sonnet 5 with its static model metadata, one-million-token context window, and full effort support. It also includes unrelated session-list UI changes that add web context menus, Copy Session ID, stable tag colors, and always-inline tag placement.
Confidence Score: 4/5The model-catalog addition appears sound, but the session-tag layout should be fixed before merging because valid tags can be silently hidden without an overflow indicator. The character-only inline budget ignores chip padding and gaps, allowing the planner to mark all short tags visible even when the overflow-hidden row cannot fit their rendered widths; the new palette also bypasses centralized theme tokens. Files Needing Attention: apps/ui/sources/components/sessions/shell/sessionTagPlacement.ts; apps/ui/sources/components/sessions/shell/sessionTagColors.ts
|
| Filename | Overview |
|---|---|
| packages/agents/src/models.ts | Adds the Sonnet 5 static catalog entry with a one-million-token context window. |
| packages/agents/src/providers/claude/contextWindow.ts | Registers Sonnet 5 as an always-on one-million-token Claude model. |
| packages/agents/src/providers/claude/effort.ts | Registers all five effort levels for Sonnet 5. |
| apps/ui/sources/components/sessions/shell/SessionItem.tsx | Adds web context-menu handling, Copy Session ID, wider inline tags, and application of the new tag palette. |
| apps/ui/sources/components/sessions/shell/sessionTagPlacement.ts | Forces tags inline and uses a character-only budget that can admit more rendered chip width than the container can display. |
| apps/ui/sources/components/sessions/shell/sessionTagColors.ts | Adds deterministic light and dark tag palettes using raw colors instead of theme tokens. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Catalog[Static Claude model catalog] --> Capabilities[Context and effort resolvers]
Capabilities --> Probe[Agent model capability probe]
Probe --> Clients[CLI and UI model selection]
Tags[Session tags] --> Planner[Inline tag display planner]
Planner --> SessionRow[Session list row]
WebInput[Web right-click] --> ContextMenu[Session action menu]
ContextMenu --> SessionRow
Comments Outside Diff (1)
-
apps/ui/sources/components/sessions/shell/sessionTagPlacement.ts, line 59-64 (link)When several short tag labels total at most 18 characters but their rendered chips exceed 180 pixels, this character-only budget marks every tag visible even though the non-wrapping row clips them, causing assigned tags to disappear without a
+Nindicator.
Reviews (1): Last reviewed commit: "feat(agents): add claude-sonnet-5 to mod..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR adds the claude-sonnet-5 model to the agents static model catalog (including 1M context + effort-tier support) and updates related tests across agents and CLI. It also includes additional sessions UI changes (tag placement/color + context menu behavior) that are not described in the PR metadata.
Changes:
- Register
claude-sonnet-5across Claude provider capability maps (effort tiers, always-1M context) and add the static model entry (contextWindowTokens: 1_000_000). - Expand/strengthen cross-package tests to ensure advertised Claude models have consistent effort/context-window configuration.
- Update session list UI: simplify tag placement logic, introduce deterministic tag chip colors, and add a “Copy Session ID” context-menu action (incl. web right-click).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/agents/src/providers/claude/effort.ts | Adds Sonnet 5 to the effort-tier support map. |
| packages/agents/src/providers/claude/effort.test.ts | Tests Sonnet 5 effort levels/default + [1m] variant behavior and ultracode capability. |
| packages/agents/src/providers/claude/contextWindow.ts | Marks Sonnet 5 as 1M-capable and always-on for 1M context. |
| packages/agents/src/providers/claude/contextWindow.test.ts | Adds Sonnet 5 assertions for 1M support/always-on and token resolution. |
| packages/agents/src/models.ts | Adds static catalog entry for claude-sonnet-5 with 1M context. |
| packages/agents/src/models.test.ts | Adds registration invariants for effort-capable Claude models and Sonnet 5 config expectations. |
| apps/ui/sources/components/sessions/shell/sessionTagPlacement.ts | Simplifies tag placement to inline + budgeted chips; suppresses tags when row actions are present. |
| apps/ui/sources/components/sessions/shell/sessionTagPlacement.test.ts | Updates expectations to match the simplified placement behavior. |
| apps/ui/sources/components/sessions/shell/sessionTagColors.ts | Introduces deterministic tag chip color selection for light/dark themes. |
| apps/ui/sources/components/sessions/shell/sessionTagColors.test.ts | Tests stability/neutral overflow behavior and distinctness of resolved colors. |
| apps/ui/sources/components/sessions/shell/SessionItem.tsx | Uses new tag colors, adjusts tag chip sizing, adds “Copy Session ID”, and opens context menu on web right-click. |
| apps/ui/sources/components/sessions/shell/SessionItem.tags.layout.test.tsx | Verifies tag chips render with the expected resolved colors and updated inline behavior. |
| apps/ui/sources/components/sessions/shell/SessionItem.contextMenu.suppressPress.test.tsx | Adds coverage for web right-click context menu items and press suppression. |
| apps/ui/sources/components/sessions/shell/row/actionMenu/useSessionRowActionMenu.tsx | Allows context menu items to be built on non-native platforms (enabling web context menu). |
| apps/cli/src/capabilities/probes/agentModelsProbe.staticOnly.test.ts | Ensures Sonnet 5 appears in the static-only models probe and has expected model options. |
| apps/cli/src/backends/claude/utils/claudeEffort.test.ts | Adds assertions that Sonnet 5 uses correct effort-tier resolution (not older substring matches). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| export function resolveSessionTagPlacement(input: ResolveSessionTagPlacementInput): SessionTagPlacement { | ||
| if (input.hasRowActions) return 'below'; | ||
| return planSessionTagDisplay(input).placement; | ||
| void input; | ||
| return 'inline'; | ||
| } |
| let hash = 5381; | ||
| for (const char of label.trim().toLocaleLowerCase()) { | ||
| hash = (hash * 33 + char.charCodeAt(0)) >>> 0; | ||
| } |
| } from './sessionListRowHeights'; | ||
| import { shouldUseReadableNativePhoneMinimalSessionRow } from './sessionListRowDensity'; | ||
| import { planSessionTagDisplay } from './sessionTagPlacement'; | ||
| import { resolveSessionTagChipColors } from './sessionTagColors'; | ||
| import { useIsTablet } from '@/utils/platform/responsive'; | ||
| import type { SessionStatus } from '@/utils/sessions/sessionUtils'; | ||
| import { useSessionRowActionMenu } from './row/actionMenu/useSessionRowActionMenu'; |
| const LIGHT_TAG_COLORS: Readonly<Record<SessionTagColorRole, SessionTagChipColors>> = { | ||
| slate: { backgroundColor: '#F1F4F6', borderColor: '#D9E0E5', color: '#60707A' }, blue: { backgroundColor: '#F0F5FC', borderColor: '#D3DFEF', color: '#607AA6' }, green: { backgroundColor: '#F0F7F1', borderColor: '#D4E5D7', color: '#5C8065' }, amber: { backgroundColor: '#FCF7ED', borderColor: '#E9DEC5', color: '#8B7345' }, violet: { backgroundColor: '#F5F2F9', borderColor: '#E0D8EC', color: '#77658E' }, rose: { backgroundColor: '#FBF2F3', borderColor: '#ECD6DA', color: '#946773' }, teal: { backgroundColor: '#EEF7F6', borderColor: '#D0E5E1', color: '#5C807B' }, neutral: { backgroundColor: '#F5F5F5', borderColor: '#E2E2E2', color: '#777777' }, | ||
| }; | ||
| const DARK_TAG_COLORS: Readonly<Record<SessionTagColorRole, SessionTagChipColors>> = { |
There was a problem hiding this comment.
The new tag palettes use raw hexadecimal values instead of Unistyles theme tokens, so centralized theme and accessibility adjustments cannot update these colors and the palette requires separate manual maintenance.
Context Used: apps/ui/CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Hi @jacobcoro , thank you for the contribution! Sorry I did not see your PR first before pushing changes on my end to fix #330 But I see you have other unrelated changes on your PR as well, do you want to open a new one for those? Thanks again! |
Adds Sonnet 5 (
claude-sonnet-5) to the static model catalog.Changes
[low, medium, high, xhigh, max]support — xhigh/max capable, defaulthighcontextWindowTokens: 1_000_000Tests
All 5 affected test files updated. 35/35 agents package tests pass.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Add
claude-sonnet-5to model catalog and redesignSessionItemtags and context menuclaude-sonnet-5with a 1,000,000 token context window, effort levelslow..xhigh,max(defaulthigh), and always-on 1M context in effort.ts and contextWindow.tsresolveSessionTagChipColorsin sessionTagColors.ts, applied to tag chips inSessionItemINLINE_MAX_TOTAL_LABEL_LENGTH = 18), removing below-row placement and width/density heuristicsresolveSessionTagPlacementnow always returns'inline'; any callers depending on'below'placement will no longer receive it.useSessionRowActionMenuno longer returns an empty list on web, which may surface menu items previously hidden on that platformMacroscope summarized bff0cd6.