@@ -1011,6 +1011,12 @@ describe("gateway server sessions", () => {
10111011 "subagent:child" : {
10121012 sessionId : "sess-owned-child" ,
10131013 updatedAt : Date . now ( ) ,
1014+ chatType : "group" ,
1015+ channel : "discord" ,
1016+ groupId : "group-1" ,
1017+ subject : "Ops Thread" ,
1018+ groupChannel : "dev" ,
1019+ space : "hq" ,
10141020 spawnedBy : "agent:main:main" ,
10151021 spawnedWorkspaceDir : "/tmp/child-workspace" ,
10161022 parentSessionKey : "agent:main:main" ,
@@ -1053,6 +1059,12 @@ describe("gateway server sessions", () => {
10531059 ok : true ;
10541060 key : string ;
10551061 entry : {
1062+ chatType ?: string ;
1063+ channel ?: string ;
1064+ groupId ?: string ;
1065+ subject ?: string ;
1066+ groupChannel ?: string ;
1067+ space ?: string ;
10561068 spawnedBy ?: string ;
10571069 spawnedWorkspaceDir ?: string ;
10581070 parentSessionKey ?: string ;
@@ -1090,6 +1102,12 @@ describe("gateway server sessions", () => {
10901102 } > ( ws , "sessions.reset" , { key : "subagent:child" } ) ;
10911103
10921104 expect ( reset . ok ) . toBe ( true ) ;
1105+ expect ( reset . payload ?. entry . chatType ) . toBe ( "group" ) ;
1106+ expect ( reset . payload ?. entry . channel ) . toBe ( "discord" ) ;
1107+ expect ( reset . payload ?. entry . groupId ) . toBe ( "group-1" ) ;
1108+ expect ( reset . payload ?. entry . subject ) . toBe ( "Ops Thread" ) ;
1109+ expect ( reset . payload ?. entry . groupChannel ) . toBe ( "dev" ) ;
1110+ expect ( reset . payload ?. entry . space ) . toBe ( "hq" ) ;
10931111 expect ( reset . payload ?. entry . spawnedBy ) . toBe ( "agent:main:main" ) ;
10941112 expect ( reset . payload ?. entry . spawnedWorkspaceDir ) . toBe ( "/tmp/child-workspace" ) ;
10951113 expect ( reset . payload ?. entry . parentSessionKey ) . toBe ( "agent:main:main" ) ;
@@ -1127,6 +1145,12 @@ describe("gateway server sessions", () => {
11271145 const store = JSON . parse ( await fs . readFile ( storePath , "utf-8" ) ) as Record <
11281146 string ,
11291147 {
1148+ chatType ?: string ;
1149+ channel ?: string ;
1150+ groupId ?: string ;
1151+ subject ?: string ;
1152+ groupChannel ?: string ;
1153+ space ?: string ;
11301154 spawnedBy ?: string ;
11311155 spawnedWorkspaceDir ?: string ;
11321156 parentSessionKey ?: string ;
@@ -1162,6 +1186,12 @@ describe("gateway server sessions", () => {
11621186 label ?: string ;
11631187 }
11641188 > ;
1189+ expect ( store [ "agent:main:subagent:child" ] ?. chatType ) . toBe ( "group" ) ;
1190+ expect ( store [ "agent:main:subagent:child" ] ?. channel ) . toBe ( "discord" ) ;
1191+ expect ( store [ "agent:main:subagent:child" ] ?. groupId ) . toBe ( "group-1" ) ;
1192+ expect ( store [ "agent:main:subagent:child" ] ?. subject ) . toBe ( "Ops Thread" ) ;
1193+ expect ( store [ "agent:main:subagent:child" ] ?. groupChannel ) . toBe ( "dev" ) ;
1194+ expect ( store [ "agent:main:subagent:child" ] ?. space ) . toBe ( "hq" ) ;
11651195 expect ( store [ "agent:main:subagent:child" ] ?. spawnedBy ) . toBe ( "agent:main:main" ) ;
11661196 expect ( store [ "agent:main:subagent:child" ] ?. spawnedWorkspaceDir ) . toBe ( "/tmp/child-workspace" ) ;
11671197 expect ( store [ "agent:main:subagent:child" ] ?. parentSessionKey ) . toBe ( "agent:main:main" ) ;
0 commit comments