@@ -136,6 +136,7 @@ describe("task detail panel", () => {
136136 it . each ( [
137137 {
138138 name : "uses qualified child session archive attribution" ,
139+ scope : "per-sender" as const ,
139140 sessionsResultAgentId : "main" ,
140141 childRow : {
141142 key : "agent:work:task-child" ,
@@ -150,6 +151,7 @@ describe("task detail panel", () => {
150151 } ,
151152 {
152153 name : "uses raw global child metadata for the owning agent" ,
154+ scope : "global" as const ,
153155 sessionsResultAgentId : "work" ,
154156 childRow : {
155157 key : "global" ,
@@ -162,8 +164,24 @@ describe("task detail panel", () => {
162164 childSessionKey : "agent:work:main" ,
163165 expected : "Archived by Global Owner" ,
164166 } ,
167+ {
168+ name : "rejects raw global child metadata in per-sender scope" ,
169+ scope : "per-sender" as const ,
170+ sessionsResultAgentId : "work" ,
171+ childRow : {
172+ key : "global" ,
173+ kind : "global" ,
174+ updatedAt : 2_000 ,
175+ archived : true ,
176+ archivedAt : 2_000 ,
177+ archivedBy : { type : "human" , id : "per-sender-owner" , label : "Per-Sender Owner" } ,
178+ } satisfies GatewaySessionRow ,
179+ childSessionKey : "agent:work:main" ,
180+ expected : undefined ,
181+ } ,
165182 {
166183 name : "rejects raw global child metadata from a different agent" ,
184+ scope : "global" as const ,
167185 sessionsResultAgentId : "main" ,
168186 childRow : {
169187 key : "global" ,
@@ -176,7 +194,7 @@ describe("task detail panel", () => {
176194 childSessionKey : "agent:work:main" ,
177195 expected : undefined ,
178196 } ,
179- ] ) ( "$name" , async ( { sessionsResultAgentId, childRow, childSessionKey, expected } ) => {
197+ ] ) ( "$name" , async ( { scope , sessionsResultAgentId, childRow, childSessionKey, expected } ) => {
180198 const task : TaskSummary = {
181199 id : "task-child" ,
182200 taskId : "task-child" ,
@@ -200,6 +218,7 @@ describe("task detail panel", () => {
200218 client : createGatewayBrowserClientFixture ( { request } ) ,
201219 connected : true ,
202220 hello : null ,
221+ agentsList : { defaultId : "main" , mainKey : "main" , scope } ,
203222 sessionsResultAgentId,
204223 } ;
205224 const parentRow : GatewaySessionRow = {
@@ -249,7 +268,7 @@ describe("task detail panel", () => {
249268 if ( expected ) {
250269 expect ( container . textContent ) . toContain ( expected ) ;
251270 } else {
252- expect ( container . textContent ) . not . toContain ( "Wrong Owner" ) ;
271+ expect ( container . textContent ) . not . toContain ( `Archived by ${ childRow . archivedBy . label } ` ) ;
253272 }
254273 transcript . hostDisconnected ( ) ;
255274 } ) ;
0 commit comments