@@ -8,6 +8,7 @@ export default function NewRunPanel() {
88 const entrypoints = useRunStore ( ( s ) => s . entrypoints ) ;
99 const [ selectedEp , setSelectedEp ] = useState ( "" ) ;
1010 const [ chatSupported , setChatSupported ] = useState ( true ) ;
11+ const [ entrypointError , setEntrypointError ] = useState < string | null > ( null ) ;
1112
1213 useEffect ( ( ) => {
1314 if ( ! selectedEp && entrypoints . length > 0 ) {
@@ -18,13 +19,17 @@ export default function NewRunPanel() {
1819 useEffect ( ( ) => {
1920 if ( ! selectedEp ) return ;
2021 setChatSupported ( true ) ;
22+ setEntrypointError ( null ) ;
2123 getEntrypointSchema ( selectedEp )
2224 . then ( ( schema ) => {
2325 const props = ( schema . input as any ) ?. properties ;
2426 setChatSupported ( ! ! props ?. messages ) ;
2527 } )
26- . catch ( ( ) => {
27- setChatSupported ( true ) ; // don't block on schema fetch errors
28+ . catch ( ( err : any ) => {
29+ const detail = err . detail || { } ;
30+ setEntrypointError (
31+ detail . error || detail . message || `Failed to load entrypoint "${ selectedEp } "`
32+ ) ;
2833 } ) ;
2934 } , [ selectedEp ] ) ;
3035
@@ -41,7 +46,7 @@ export default function NewRunPanel() {
4146 < div className = "flex items-center justify-center gap-2 mb-2" >
4247 < div
4348 className = "w-1.5 h-1.5 rounded-full"
44- style = { { background : "var(--accent)" } }
49+ style = { { background : entrypointError ? "var(--error)" : "var(--accent)" } }
4550 />
4651 < span
4752 className = "text-[10px] uppercase tracking-widest font-semibold"
@@ -50,9 +55,11 @@ export default function NewRunPanel() {
5055 New Run
5156 </ span >
5257 </ div >
53- < p className = "text-xs" style = { { color : "var(--text-muted)" } } >
54- { entrypoints . length > 1 ? "Select an entrypoint and choose a mode" : "Choose a mode" }
55- </ p >
58+ { ! entrypointError && (
59+ < p className = "text-xs" style = { { color : "var(--text-muted)" } } >
60+ { entrypoints . length > 1 ? "Select an entrypoint and choose a mode" : "Choose a mode" }
61+ </ p >
62+ ) }
5663 </ div >
5764
5865 { /* Entrypoint */ }
@@ -83,29 +90,65 @@ export default function NewRunPanel() {
8390 </ div >
8491 ) }
8592
86- { /* Mode cards */ }
87- < div className = "grid grid-cols-2 gap-4" >
88- < ModeCard
89- title = "Autonomous"
90- description = "Run the agent end-to-end. Set breakpoints to pause and inspect execution."
91- icon = { < BoltIcon /> }
92- color = "var(--success)"
93- onClick = { ( ) => handleModeSelect ( "run" ) }
94- disabled = { ! selectedEp }
95- />
96- < ModeCard
97- title = "Conversational"
98- description = {
99- ! chatSupported
100- ? "Requires a \"messages\" property in the input schema."
101- : "Interactive chat session. Send messages and receive responses in real time."
102- }
103- icon = { < ChatIcon /> }
104- color = "var(--accent)"
105- onClick = { ( ) => handleModeSelect ( "chat" ) }
106- disabled = { ! selectedEp || ! chatSupported }
107- />
108- </ div >
93+ { /* Mode cards or error */ }
94+ { entrypointError ? (
95+ < div
96+ className = "rounded-md border overflow-hidden"
97+ style = { {
98+ borderColor : "color-mix(in srgb, var(--error) 25%, var(--border))" ,
99+ background : "var(--bg-secondary)" ,
100+ } }
101+ >
102+ < div
103+ className = "px-3 py-2 flex items-center gap-2"
104+ style = { {
105+ borderBottom : "1px solid color-mix(in srgb, var(--error) 15%, var(--border))" ,
106+ background : "color-mix(in srgb, var(--error) 4%, var(--bg-secondary))" ,
107+ } }
108+ >
109+ < svg width = "14" height = "14" viewBox = "0 0 16 16" fill = "none" style = { { flexShrink : 0 } } >
110+ < path
111+ d = "M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z"
112+ fill = "var(--error)"
113+ />
114+ </ svg >
115+ < span className = "text-[11px] font-medium" style = { { color : "var(--error)" } } >
116+ Failed to load entrypoint
117+ </ span >
118+ </ div >
119+ < div className = "overflow-auto max-h-48 p-3" >
120+ < pre
121+ className = "text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0"
122+ style = { { color : "var(--text-muted)" } }
123+ >
124+ { entrypointError }
125+ </ pre >
126+ </ div >
127+ </ div >
128+ ) : (
129+ < div className = "grid grid-cols-2 gap-4" >
130+ < ModeCard
131+ title = "Autonomous"
132+ description = "Run the agent end-to-end. Set breakpoints to pause and inspect execution."
133+ icon = { < BoltIcon /> }
134+ color = "var(--success)"
135+ onClick = { ( ) => handleModeSelect ( "run" ) }
136+ disabled = { ! selectedEp }
137+ />
138+ < ModeCard
139+ title = "Conversational"
140+ description = {
141+ ! chatSupported
142+ ? "Requires a \"messages\" property in the input schema."
143+ : "Interactive chat session. Send messages and receive responses in real time."
144+ }
145+ icon = { < ChatIcon /> }
146+ color = "var(--accent)"
147+ onClick = { ( ) => handleModeSelect ( "chat" ) }
148+ disabled = { ! selectedEp || ! chatSupported }
149+ />
150+ </ div >
151+ ) }
109152 </ div >
110153 </ div >
111154 ) ;
0 commit comments