@@ -1129,11 +1129,13 @@ describe("buildAgentSystemPrompt", () => {
11291129 expect ( prompt ) . not . toContain ( "capabilities= InlineButtons ,voice,inlinebuttons,Voice" ) ;
11301130 } ) ;
11311131
1132- it ( "includes agent id in runtime when provided" , ( ) => {
1132+ it ( "includes agent and session identity in runtime when provided" , ( ) => {
11331133 const prompt = buildAgentSystemPrompt ( {
11341134 workspaceDir : "/tmp/openclaw" ,
11351135 runtimeInfo : {
11361136 agentId : "work" ,
1137+ sessionKey : "agent:main:main" ,
1138+ sessionId : "23ae7fce-3c27-4a51-b58e-d800d8ca091f" ,
11371139 host : "host" ,
11381140 os : "macOS" ,
11391141 arch : "arm64" ,
@@ -1143,6 +1145,8 @@ describe("buildAgentSystemPrompt", () => {
11431145 } ) ;
11441146
11451147 expect ( prompt ) . toContain ( "agent=work" ) ;
1148+ expect ( prompt ) . toContain ( "session=agent:main:main" ) ;
1149+ expect ( prompt ) . toContain ( "sessionId=23ae7fce-3c27-4a51-b58e-d800d8ca091f" ) ;
11461150 } ) ;
11471151
11481152 it ( "includes reasoning visibility hint" , ( ) => {
@@ -1160,6 +1164,8 @@ describe("buildAgentSystemPrompt", () => {
11601164 const line = buildRuntimeLine (
11611165 {
11621166 agentId : "work" ,
1167+ sessionKey : "agent:main:subagent:runtime-check" ,
1168+ sessionId : "23ae7fce-3c27-4a51-b58e-d800d8ca091f" ,
11631169 host : "host" ,
11641170 repoRoot : "/repo" ,
11651171 os : "macOS" ,
@@ -1174,6 +1180,8 @@ describe("buildAgentSystemPrompt", () => {
11741180 ) ;
11751181
11761182 expect ( line ) . toContain ( "agent=work" ) ;
1183+ expect ( line ) . toContain ( "session=agent:main:subagent:runtime-check" ) ;
1184+ expect ( line ) . toContain ( "sessionId=23ae7fce-3c27-4a51-b58e-d800d8ca091f" ) ;
11771185 expect ( line ) . toContain ( "host=host" ) ;
11781186 expect ( line ) . toContain ( "repo=/repo" ) ;
11791187 expect ( line ) . toContain ( "os=macOS (arm64)" ) ;
0 commit comments