File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,9 +295,11 @@ class OpencodeLocalAgentAdapter implements LocalAgentAdapter {
295295 const sessionId = input . providerSessionId ?? await createOpencodeSession ( client , input ) ;
296296 observer ?. onSession ?.( sessionId ) ;
297297 const promptResult = await promptOpencodeSession ( client , sessionId , input ) ;
298+ // The prompt response is scoped to this turn; the messages endpoint returns
299+ // the whole session and would reattribute historical tools on resume.
300+ const usage = observeOpenCodeResult ( promptResult , observer ) ;
298301 await waitForOpencodeSession ( client , sessionId ) ;
299302 const messages = await readOpencodeMessages ( client , sessionId ) ;
300- const usage = observeOpenCodeResult ( messages , observer ) ;
301303 const finalResponse = requireFinalResponse (
302304 "OpenCode" ,
303305 extractOpenCodeFinalResponse ( messages ) || extractOpenCodeFinalResponse ( promptResult ) ,
You can’t perform that action at this time.
0 commit comments