feat: claude effort controls, ultrathink UI, and adapter robustness#1146
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
abb5d9c to
2439fca
Compare
|
had to do some sweeping changes to align with anthropic branding guidelines. can you resolve the conflicts? |
|
yes working on it |
2439fca to
f882fc9
Compare
|
@juliusmarminge done. you should be able to merge it no problem now. |
| <svg {...props} preserveAspectRatio="xMidYMid" viewBox="0 0 256 257"> | ||
| <path | ||
| fill="#D97757" | ||
| fill="currentColor" |
There was a problem hiding this comment.
the Claude icon needs to inherit Tailwind text color from the caller. Icons.tsx (line 146) so the styling in ProviderModelPicker.tsx (line 120) actually works, including the normal Claude orange and the ultrathink-chroma state. With a hardcoded fill, those classes were ignored.
| MenuTrigger, | ||
| } from "../ui/menu"; | ||
|
|
||
| export const CodexTraitsPicker = memo(function CodexTraitsPicker(props: { |
There was a problem hiding this comment.
hmm not sure it's worth compacting these as one just yet... we don't really know what the future will look like so keeping them separate for now is the best. iirc i separated them when i had all codex/claude/cursor working because they had differernt enough logic to justify separate components instead of single component with switch statements internalyl
There was a problem hiding this comment.
the reason for the refactor is that ChatView only renders one traits-picker slot, and the current UI shape is still the same for both providers: one menu, one effort selector, plus Codex-only fast mode in the same surface. You can point at ChatView.tsx (line 3630) and CodexTraitsPicker.tsx (line 37).
But if you want I can change the implementation to be less of an abstraction
| const TaskProgressPayload = Schema.Struct({ | ||
| taskId: RuntimeTaskId, | ||
| description: TrimmedNonEmptyStringSchema, | ||
| summary: Schema.optional(TrimmedNonEmptyStringSchema), |
There was a problem hiding this comment.
what does this cover that "description" doesn't? is it something claude specific? not opposed to keeping mostly curious
There was a problem hiding this comment.
description is the provider’s raw task label, while summary is an optional more user-facing progress line when the provider gives both. Claude does give both on task_progress; see ClaudeAdapter.ts (line 1698). The ingestion layer then prefers summary for the activity detail and falls back to description; see ProviderRuntimeIngestion.ts (line 363). it is an optional field that preserves richer provider data without overloading description.
- Auto-start synthetic turns for assistant messages arriving without an active turnState (fixes invisible background agent/subagent responses that arrive between user-initiated turns) - Auto-close stale synthetic turns in sendTurn to prevent session deadlock when a background response left an orphaned turn open - Clear inFlightTools between turns in completeTurn to prevent stale JSON fragments from corrupting the next turn's tool inputs - Fix missing Fiber import in ProviderHealth Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The clear() was placed before the loop that emits item.completed events for remaining in-flight tools, causing the loop to never execute. Move it after the loop so tools get properly finalized before cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Updates all remaining references from "claudeCode" to "claudeAgent" to match the Anthropic branding guidelines applied upstream. Includes provider kind literals, object property keys, test payloads, and component comparisons across server, web, and shared packages. Also fixes synthetic turn state to match upstream's refactored ClaudeTurnState interface (assistantTextBlocks map instead of the old assistantItemId/messageCompleted/emittedTextDelta fields). Also fixes inFlightTools.clear() placement: moved after the loop that emits item.completed events for remaining in-flight tools, so tools are properly finalized before cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
49e27ab to
3e5371c
Compare
|
@juliusmarminge let me know if you have any other concerns. |
e6254a8
into
pingdotgg:codething/648ca884-claude
What Changed
Claude Effort Controls & Ultrathink
ClaudeCodeEfforttype with levels: low, medium, high, max, ultrathinkgetEffectiveClaudeCodeEffort()maps effort levels to Claude SDK valuesapplyClaudePromptEffortPrefix()prepends "Ultrathink:" prefix to promptsCodexTraitsPickerinto a provider-aware traits picker with Claude effort labelsAdapter Robustness (Background Agents & Subagents)
sendTurnto prevent session deadlockinFlightToolsmap incompleteTurnto prevent stale JSON fragments from corrupting subsequent turnsSubagent Progress Surfacing
task.progressevents surface as activities with summary andlastToolNamecollab_agent_tool_callclassification for Agent/Task tools with "Subagent task" labelsProvider Health
Why
Background agent results, subagent responses, and tool call details were silently dropped because the adapter's turn state machine only handled user-initiated turns. When a background agent finished work and the lead generated a response, that response was invisible in the UI.
The effort controls bring feature parity with the Codex reasoning effort UI, adapted for Claude's effort model including the ultrathink mode.
UI Changes
Checklist
Note
Add Claude effort controls and ultrathink UI to the chat composer
ClaudeCodeEffortoptions (low,medium,high,max,ultrathink) to contracts and shared model utilities, withultrathinkmapping tomaxat runtime and prefixing outgoing prompts with'Ultrathink:\n'.modelOptions.claudeAgent.effortin turn payloads, and shows an animated 'Ultrathink' pill and rainbow frame when ultrathink is active.ClaudeAdapterforwards effective effort into Claude SDK query options and auto-closes a stale active turn instead of returning a validation error whensendTurnis called.ProviderCommandReactorrestarts the Claude session whenmodelOptionschange between turns, and carries cached model options forward on runtime-mode changes.ProviderTraitsPickerreplacesCodexTraitsPickerwith a provider-agnostic picker that shows Fast Mode only for Codex and uses provider-specific effort labels.nullto'high'; existing sessions without a persisted effort will now sendeffort: 'high'to the Claude API.Macroscope summarized 3e5371c.