@@ -30,6 +30,7 @@ import {
3030 CardHeader ,
3131 CardTitle ,
3232 Checkbox ,
33+ FormSelect ,
3334 Input ,
3435 Label ,
3536 Textarea ,
@@ -44,9 +45,19 @@ import {
4445import { useAuthStatus } from "~/hooks/useAuth" ;
4546import { formatRelativeTime } from "~/lib/dates" ;
4647import { streamSandboxRun } from "~/lib/api/sandbox" ;
48+ import {
49+ getSandboxPromptStrategyDescription ,
50+ getSandboxPromptStrategyLabel ,
51+ parseSandboxPromptStrategy ,
52+ sandboxPromptStrategyOptions ,
53+ } from "~/lib/sandbox/prompt-strategies" ;
4754import { normaliseGitHubRepoInput } from "~/lib/sandbox/repositories" ;
4855import { cn } from "~/lib/utils" ;
49- import type { SandboxRun , SandboxRunEvent } from "~/types/sandbox" ;
56+ import type {
57+ SandboxPromptStrategy ,
58+ SandboxRun ,
59+ SandboxRunEvent ,
60+ } from "~/types/sandbox" ;
5061import {
5162 REPO_PATTERN ,
5263 REPO_STORAGE_PREFIX ,
@@ -175,6 +186,8 @@ export default function SandboxConnectionPage() {
175186 const [ repo , setRepo ] = useState ( "" ) ;
176187 const [ task , setTask ] = useState ( "" ) ;
177188 const [ model , setModel ] = useState ( "" ) ;
189+ const [ promptStrategy , setPromptStrategy ] =
190+ useState < SandboxPromptStrategy > ( "auto" ) ;
178191 const [ shouldCommit , setShouldCommit ] = useState ( true ) ;
179192 const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
180193 const [ activeRunId , setActiveRunId ] = useState < string | undefined > ( ) ;
@@ -412,6 +425,7 @@ export default function SandboxConnectionPage() {
412425 repo : trimmedRepo ,
413426 task : trimmedTask ,
414427 model : model . trim ( ) || undefined ,
428+ promptStrategy,
415429 shouldCommit,
416430 } ,
417431 {
@@ -593,7 +607,7 @@ export default function SandboxConnectionPage() {
593607 </ CardDescription >
594608 </ CardHeader >
595609 < CardContent className = "space-y-4" >
596- < div className = "grid gap-4 md:grid-cols-2 " >
610+ < div className = "grid gap-4 md:grid-cols-3 " >
597611 < div className = "space-y-2" >
598612 < Label htmlFor = "sandbox-repo-input" > Repository</ Label >
599613 < Input
@@ -635,6 +649,25 @@ export default function SandboxConnectionPage() {
635649 set, backend defaults to < code > mistral-large</ code > .
636650 </ p >
637651 </ div >
652+ < div className = "space-y-2" >
653+ < FormSelect
654+ id = "sandbox-prompt-strategy"
655+ label = "Prompt strategy"
656+ value = { promptStrategy }
657+ onChange = { ( event ) =>
658+ setPromptStrategy (
659+ parseSandboxPromptStrategy ( event . target . value ) ,
660+ )
661+ }
662+ options = { sandboxPromptStrategyOptions . map ( ( option ) => ( {
663+ value : option . value ,
664+ label : option . label ,
665+ } ) ) }
666+ />
667+ < p className = "text-xs text-muted-foreground" >
668+ { getSandboxPromptStrategyDescription ( promptStrategy ) }
669+ </ p >
670+ </ div >
638671 </ div >
639672 < div className = "space-y-2" >
640673 < Label htmlFor = "sandbox-task-input" > Task</ Label >
@@ -838,6 +871,12 @@ export default function SandboxConnectionPage() {
838871 < p className = "text-muted-foreground" >
839872 { summariseRunResult ( selectedRun ) }
840873 </ p >
874+ < p >
875+ < span className = "font-medium" > Prompt strategy:</ span > { " " }
876+ { getSandboxPromptStrategyLabel (
877+ selectedRun . promptStrategy ,
878+ ) }
879+ </ p >
841880 { typeof selectedRun . result ?. branchName === "string" && (
842881 < p >
843882 < span className = "font-medium" > Branch:</ span > { " " }
0 commit comments