File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,22 +176,4 @@ describe("resolveAgentPluginProfiles", () => {
176176 ) ,
177177 ) . toBe ( true ) ;
178178 } ) ;
179-
180- test ( "warns once when a prompt file is missing and still loads the profile" , async ( ) => {
181- const { mod, config } = agentModule ( "p1" , [
182- { id : "scout" , systemPromptPath : "prompts/does-not-exist.md" } ,
183- ] ) ;
184- mod . dir = "/tmp/wt-cl-6724-missing-prompt-dir" ;
185- const warnings : string [ ] = [ ] ;
186- const profiles = await resolveAgentPluginProfiles ( [ mod ] , config , ( msg ) =>
187- warnings . push ( msg ) ,
188- ) ;
189- expect ( profiles . length ) . toBe ( 1 ) ;
190- expect ( defined ( profiles [ 0 ] ) . systemPromptRole ) . toBeUndefined ( ) ;
191- expect ( warnings . length ) . toBe ( 1 ) ;
192- expect ( warnings [ 0 ] ) . toContain ( '"p1"' ) ;
193- expect ( warnings [ 0 ] ) . toContain ( '"scout"' ) ;
194- expect ( warnings [ 0 ] ) . toContain ( "prompts/does-not-exist.md" ) ;
195- expect ( defined ( warnings [ 0 ] ) ) . toMatch ( / u n r e a d a b l e | m i s s i n g / i) ;
196- } ) ;
197179} ) ;
Original file line number Diff line number Diff line change @@ -90,18 +90,14 @@ export async function resolveAgentPluginProfiles(
9090 profile . systemPromptRole === undefined &&
9191 mod . dir !== undefined
9292 ) {
93- const promptPath = join ( mod . dir , profile . systemPromptPath ) ;
9493 try {
95- const promptRaw = await readFile ( promptPath , "utf8" ) ;
96- profile . systemPromptRole = promptRaw . trim ( ) ;
97- } catch ( err ) {
98- const reason =
99- ( err instanceof Error ? err . message : String ( err ) )
100- . split ( "\n" ) [ 0 ]
101- ?. trim ( ) || "unknown error" ;
102- onWarning (
103- `plugin "${ mod . manifest . id } " agent "${ profile . id } " systemPromptPath "${ profile . systemPromptPath } " unreadable (${ promptPath } ): ${ reason } ` ,
94+ const promptRaw = await readFile (
95+ join ( mod . dir , profile . systemPromptPath ) ,
96+ "utf8" ,
10497 ) ;
98+ profile . systemPromptRole = promptRaw . trim ( ) ;
99+ } catch {
100+ // Missing prompt file is non-fatal — the profile loads without a role.
105101 }
106102 }
107103 // Provenance for search_agents: Claude marketplace installs stamp
You can’t perform that action at this time.
0 commit comments