@@ -21,6 +21,17 @@ function runAgentsDeleteAssert(root: string, outputPath: string, env: Record<str
2121 } ) ;
2222}
2323
24+ function runAgentsDeleteConfig ( root : string ) {
25+ const stateDir = path . join ( root , "state" ) ;
26+ const workspace = path . join ( root , "workspace" ) ;
27+ mkdirSync ( stateDir , { recursive : true } ) ;
28+ const result = spawnSync ( process . execPath , [ FIXTURE_SCRIPT , "agents-delete-config" ] , {
29+ encoding : "utf8" ,
30+ env : { ...process . env , OPENCLAW_STATE_DIR : stateDir , SHARED_WORKSPACE : workspace } ,
31+ } ) ;
32+ return { result, stateDir, workspace } ;
33+ }
34+
2435function runOpenWebUiWorkspace ( workspaceDir : string ) {
2536 return spawnSync ( process . execPath , [ FIXTURE_SCRIPT , "openwebui-workspace" ] , {
2637 encoding : "utf8" ,
@@ -32,6 +43,18 @@ function runOpenWebUiWorkspace(workspaceDir: string) {
3243}
3344
3445describe ( "workspace fixture assertions" , ( ) => {
46+ it ( "writes explicit owners for the shared-workspace agents" , ( ) => {
47+ const root = tempDirs . make ( "openclaw-fixture-workspace-" ) ;
48+ const { result, stateDir, workspace } = runAgentsDeleteConfig ( root ) ;
49+
50+ expect ( result . status ) . toBe ( 0 ) ;
51+ expect ( JSON . parse ( readFileSync ( path . join ( stateDir , "openclaw.json" ) , "utf8" ) ) . agents ) . toEqual ( {
52+ ownership : "explicit" ,
53+ defaults : { heartbeat : { agentId : "main" } } ,
54+ entries : { main : { workspace } , ops : { workspace } } ,
55+ } ) ;
56+ } ) ;
57+
3558 it ( "prepares Open WebUI without retired workspace setup state" , ( ) => {
3659 const root = mkdtempSync ( path . join ( tmpdir ( ) , "openclaw-fixture-workspace-" ) ) ;
3760 const workspaceDir = path . join ( root , "workspace" ) ;
0 commit comments