@@ -197,38 +197,45 @@ describe("plugins cli inspect", () => {
197197 expect ( runtimeErrors . at ( - 1 ) ) . toContain ( "Plugin not found: missing-plugin" ) ;
198198 } ) ;
199199
200- it ( "explains a policy-hidden built-in Skill Workshop at the legacy inspect surface" , async ( ) => {
200+ it . each ( [
201+ { label : "an implicit agent" , agentIds : [ "main" ] , entries : undefined } ,
202+ {
203+ label : "a multi-agent roster" ,
204+ agentIds : [ "main" , "venus" ] ,
205+ entries : { main : { } , venus : { } } ,
206+ } ,
207+ ] ) ( "explains policy-hidden Skill Workshop for $label" , async ( { agentIds, entries } ) => {
201208 const config : OpenClawConfig = {
202209 tools : { profile : "messaging" } ,
210+ ...( entries ? { agents : { ownership : "explicit" as const , entries } } : { } ) ,
203211 } ;
204212 pluginCliConfigMock . mockReturnValue ( config ) ;
205- workshopMocks . detectToolPolicyDiagnostic . mockReturnValue ( {
206- agentId : "main" ,
207- source : "tools.profile" ,
208- detail : 'tools.profile: "messaging" does not include "skill_workshop".' ,
209- fix : 'Add tools.alsoAllow: ["skill_workshop"].' ,
210- message :
211- 'Skill Workshop is active, but "skill_workshop" is hidden for agent "main": tools.profile: "messaging" does not include "skill_workshop". Add tools.alsoAllow: ["skill_workshop"].' ,
212- } ) ;
213- buildPluginSnapshotReportMock . mockReturnValue ( {
214- plugins : [ ] ,
215- diagnostics : [ ] ,
216- } ) ;
213+ workshopMocks . detectToolPolicyDiagnostic . mockImplementation (
214+ ( { agentId } : { agentId : string } ) => ( {
215+ agentId,
216+ message :
217+ `Skill Workshop is active, but "skill_workshop" is hidden for agent "${ agentId } ": ` +
218+ 'tools.profile: "messaging" does not include "skill_workshop". ' +
219+ 'Add tools.alsoAllow: ["skill_workshop"].' ,
220+ } ) ,
221+ ) ;
222+ buildPluginSnapshotReportMock . mockReturnValue ( { plugins : [ ] , diagnostics : [ ] } ) ;
217223
218224 await expect ( runPluginsCommand ( [ "plugins" , "inspect" , "skill-workshop" ] ) ) . rejects . toThrow (
219225 "__exit__:1" ,
220226 ) ;
221227
222- expect ( runtimeErrors . at ( - 1 ) ) . toContain (
223- "Skill Workshop is built into OpenClaw, not a plugin; configure it under skills.workshop." ,
224- ) ;
225- expect ( workshopMocks . detectToolPolicyDiagnostic ) . toHaveBeenCalledWith ( {
226- config,
227- workshopEnabled : true ,
228- } ) ;
229- expect ( runtimeErrors . at ( - 1 ) ) . toContain (
230- 'tools.profile: "messaging" does not include "skill_workshop".' ,
231- ) ;
232- expect ( runtimeErrors . at ( - 1 ) ) . toContain ( 'Add tools.alsoAllow: ["skill_workshop"].' ) ;
228+ const output = runtimeErrors . at ( - 1 ) ;
229+ expect ( output ) . toContain ( "Skill Workshop is built into OpenClaw, not a plugin" ) ;
230+ expect ( output ) . toContain ( 'tools.profile: "messaging" does not include "skill_workshop".' ) ;
231+ expect ( output ) . toContain ( 'Add tools.alsoAllow: ["skill_workshop"].' ) ;
232+ for ( const agentId of agentIds ) {
233+ expect ( workshopMocks . detectToolPolicyDiagnostic ) . toHaveBeenCalledWith ( {
234+ config,
235+ workshopEnabled : true ,
236+ agentId,
237+ } ) ;
238+ expect ( output ) . toContain ( `hidden for agent "${ agentId } "` ) ;
239+ }
233240 } ) ;
234241} ) ;
0 commit comments