@@ -22,8 +22,11 @@ interface AutoresearchComposerControlsProps {
2222}
2323
2424/**
25- * Autoresearch settings rendered inside the composer box (its header addon)
26- * while the mode is armed — one input view, not a widget attached under it.
25+ * Autoresearch settings shown as a bar above the composer while the mode is
26+ * armed. It reads as one sentence — "Optimize to maximize until it reaches N
27+ * or after K iterations using <model>" — so each control explains itself in
28+ * place; tooltips on the labels add the detail.
29+ *
2730 * There is deliberately no metric or instructions field: the prompt IS the
2831 * optimization brief, and the agent names the metric in its reports.
2932 *
@@ -39,44 +42,63 @@ export function AutoresearchComposerControls({
3942 onExit,
4043} : AutoresearchComposerControlsProps ) {
4144 return (
42- < div className = "flex w-full flex-wrap items-center gap-x-2 gap-y-1 text-[12px]" >
43- < span className = "flex shrink-0 items-center gap-1 font-medium text-violet-11" >
44- < ChartLineUp size = { 13 } />
45- Autoresearch
45+ < div className = "flex w-full flex-wrap items-center gap-x-2 gap-y-1.5 text-[12px]" >
46+ < Tooltip content = "Runs an autonomous optimization loop: it measures a baseline from your brief, then edits the code and re-measures each round — keeping changes that move the metric and reverting the ones that don't. It stops when the metric reaches your target or hits the iteration cap, whichever comes first." >
47+ < span className = "flex shrink-0 cursor-help items-center gap-1 font-medium text-violet-11" >
48+ < ChartLineUp size = { 13 } />
49+ Autoresearch
50+ </ span >
51+ </ Tooltip >
52+
53+ { /* The goal: which way to push the metric the brief describes. */ }
54+ < span className = "flex items-center gap-1.5 whitespace-nowrap text-(--gray-11)" >
55+ < Tooltip content = "Whether the agent should drive the metric from your brief up or down." >
56+ < span className = "cursor-help" > Optimize to</ span >
57+ </ Tooltip >
58+ < Select . Root
59+ size = "1"
60+ value = { draft . direction }
61+ onValueChange = { ( value ) =>
62+ onChange ( { direction : value as AutoresearchDirection } )
63+ }
64+ disabled = { disabled }
65+ >
66+ < Select . Trigger variant = "soft" aria-label = "Optimization direction" />
67+ < Select . Content >
68+ < Select . Item value = "maximize" > maximize</ Select . Item >
69+ < Select . Item value = "minimize" > minimize</ Select . Item >
70+ </ Select . Content >
71+ </ Select . Root >
72+ </ span >
73+
74+ { /* Two stop conditions, whichever comes first: the metric hits the
75+ target value, or the run exhausts its iteration budget. Only the
76+ label text is wrapped in a tooltip — never the input — so focusing
77+ the field to type doesn't pop the tooltip open. */ }
78+ < span className = "flex items-center gap-1.5 whitespace-nowrap text-(--gray-11)" >
79+ < Tooltip content = "Finish early once the metric reaches this value. Leave blank to always run the full iteration budget." >
80+ < span className = "cursor-help" > until it reaches</ span >
81+ </ Tooltip >
82+ < TextField . Root
83+ size = "1"
84+ className = "w-24"
85+ value = { draft . targetValue === null ? "" : String ( draft . targetValue ) }
86+ onChange = { ( event ) => {
87+ const raw = event . target . value . trim ( ) ;
88+ const numeric = Number ( raw ) ;
89+ onChange ( {
90+ targetValue :
91+ raw === "" || ! Number . isFinite ( numeric ) ? null : numeric ,
92+ } ) ;
93+ } }
94+ placeholder = "optional"
95+ inputMode = "decimal"
96+ aria-label = "Target metric value to stop at (optional)"
97+ disabled = { disabled }
98+ />
4699 </ span >
47- < Select . Root
48- size = "1"
49- value = { draft . direction }
50- onValueChange = { ( value ) =>
51- onChange ( { direction : value as AutoresearchDirection } )
52- }
53- disabled = { disabled }
54- >
55- < Select . Trigger variant = "soft" aria-label = "Optimization direction" />
56- < Select . Content >
57- < Select . Item value = "maximize" > Maximize</ Select . Item >
58- < Select . Item value = "minimize" > Minimize</ Select . Item >
59- </ Select . Content >
60- </ Select . Root >
61- < TextField . Root
62- size = "1"
63- className = "w-24"
64- value = { draft . targetValue === null ? "" : String ( draft . targetValue ) }
65- onChange = { ( event ) => {
66- const raw = event . target . value . trim ( ) ;
67- const numeric = Number ( raw ) ;
68- onChange ( {
69- targetValue :
70- raw === "" || ! Number . isFinite ( numeric ) ? null : numeric ,
71- } ) ;
72- } }
73- placeholder = "Target"
74- inputMode = "decimal"
75- aria-label = "Target value (optional)"
76- disabled = { disabled }
77- />
78- < span className = "flex items-center gap-1 text-(--gray-11)" >
79- ≤
100+ < span className = "flex items-center gap-1.5 whitespace-nowrap text-(--gray-11)" >
101+ or after
80102 < TextField . Root
81103 size = "1"
82104 className = "w-14"
@@ -89,18 +111,28 @@ export function AutoresearchComposerControls({
89111 } )
90112 }
91113 inputMode = "numeric"
92- aria-label = "Iteration budget "
114+ aria-label = "Maximum iterations "
93115 disabled = { disabled }
94116 />
95- iterations
117+ < Tooltip content = "Hard cap on build-and-measure rounds before the run stops." >
118+ < span className = "cursor-help" > iterations</ span >
119+ </ Tooltip >
96120 </ span >
97- < StagesPopover
98- draft = { draft }
99- modelOptions = { modelOptions }
100- effortOptions = { effortOptions }
101- disabled = { disabled }
102- onChange = { onChange }
103- />
121+
122+ { /* The engine: model + effort per stage. */ }
123+ < span className = "flex items-center gap-1.5 whitespace-nowrap text-(--gray-11)" >
124+ < Tooltip content = "Model and reasoning effort the loop runs on. Set the build and measure stages to different models to measure with a cheaper one." >
125+ < span className = "cursor-help" > using</ span >
126+ </ Tooltip >
127+ < StagesPopover
128+ draft = { draft }
129+ modelOptions = { modelOptions }
130+ effortOptions = { effortOptions }
131+ disabled = { disabled }
132+ onChange = { onChange }
133+ />
134+ </ span >
135+
104136 < span className = "ml-auto flex shrink-0 items-center" >
105137 < Tooltip content = "Exit autoresearch mode" >
106138 < button
0 commit comments