@@ -12,8 +12,8 @@ import {
1212type CallGateway = typeof import ( "../gateway/call.js" ) . callGateway ;
1313type GetRuntimeConfig = typeof import ( "./subagent-announce.runtime.js" ) . getRuntimeConfig ;
1414type ReadSessionEntry = typeof import ( "./subagent-announce.runtime.js" ) . readSessionEntry ;
15- type ReadSessionMessagesAsync =
16- typeof import ( "./subagent-announce.runtime.js" ) . readSessionMessagesAsync ;
15+ type ReadSessionMessagesFromFileAsync =
16+ typeof import ( "./subagent-announce.runtime.js" ) . readSessionMessagesFromFileAsync ;
1717type ResolveAgentIdFromSessionKey =
1818 typeof import ( "./subagent-announce.runtime.js" ) . resolveAgentIdFromSessionKey ;
1919type ResolveStorePath = typeof import ( "./subagent-announce.runtime.js" ) . resolveStorePath ;
@@ -23,12 +23,13 @@ function installOutputDeps(params: {
2323 transcriptMessages ?: Array < unknown > ;
2424} ) {
2525 const callGateway = vi . fn ( async ( ) => ( { messages : params . messages } ) ) ;
26- const readSessionMessagesAsync = vi . fn ( async ( ) => params . transcriptMessages ?? [ ] ) ;
26+ const readSessionMessagesFromFileAsync = vi . fn ( async ( ) => params . transcriptMessages ?? [ ] ) ;
2727 testing . setDepsForTest ( {
2828 callGateway : callGateway as unknown as CallGateway ,
29- readSessionMessagesAsync : readSessionMessagesAsync as unknown as ReadSessionMessagesAsync ,
29+ readSessionMessagesFromFileAsync :
30+ readSessionMessagesFromFileAsync as unknown as ReadSessionMessagesFromFileAsync ,
3031 } ) ;
31- return { callGateway, readSessionMessagesAsync } ;
32+ return { callGateway, readSessionMessagesFromFileAsync } ;
3233}
3334
3435function sessionsYieldTurn ( message = "Waiting for subagent completion." ) {
@@ -215,7 +216,7 @@ describe("readSubagentOutput", () => {
215216 sessionFile : "/tmp/openclaw-internal-run.jsonl" ,
216217 } ) ,
217218 ) . resolves . toBe ( "fresh recovered output" ) ;
218- expect ( deps . readSessionMessagesAsync ) . toHaveBeenCalledWith (
219+ expect ( deps . readSessionMessagesFromFileAsync ) . toHaveBeenCalledWith (
219220 {
220221 sessionFile : "/tmp/openclaw-internal-run.jsonl" ,
221222 sessionId : "agent:main:subagent:child" ,
0 commit comments