File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ export function FormatError(input: unknown) {
3232 }
3333 if ( Config . InvalidError . isInstance ( input ) )
3434 return [
35- `Config file at ${ input . data . path } is invalid` + ( input . data . message ? `: ${ input . data . message } ` : "" ) ,
35+ `Configuration is invalid${ input . data . path && input . data . path !== "config" ? ` at ${ input . data . path } ` : "" } ` +
36+ ( input . data . message ? `: ${ input . data . message } ` : "" ) ,
3637 ...( input . data . issues ?. map ( ( issue ) => "↳ " + issue . message + " " + issue . path . join ( "." ) ) ?? [ ] ) ,
3738 ] . join ( "\n" )
3839
Original file line number Diff line number Diff line change @@ -141,6 +141,17 @@ export namespace Config {
141141
142142 if ( ! result . keybinds ) result . keybinds = Info . shape . keybinds . parse ( { } )
143143
144+ // Only validate if user has configured agents - if none configured, built-in agents will be used
145+ if ( Object . keys ( result . agent ) . length > 0 ) {
146+ const primaryAgents = Object . values ( result . agent ) . filter ( ( a ) => a . mode !== "subagent" && ! a . hidden && ! a . disable )
147+ if ( primaryAgents . length === 0 ) {
148+ throw new InvalidError ( {
149+ path : "config" ,
150+ message : "No primary agents are available. Please configure at least one agent with mode 'primary' or 'all'." ,
151+ } )
152+ }
153+ }
154+
144155 return {
145156 config : result ,
146157 directories,
You can’t perform that action at this time.
0 commit comments