Skip to content

Commit 99d4bed

Browse files
fix(acp): forward session title updates to ACP clients via session_info_update
When a session title is auto-generated after the first prompt turn, Session.setTitle() fires a session.updated bus event. handleEvent() had no case for this event type, so ACP clients never learned the session title changed. Add a case that calls connection.sessionUpdate with sessionUpdate: "session_info_update" whenever session.updated carries a non-empty title. Fixes anomalyco#21013
1 parent 3a0e00d commit 99d4bed

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎packages/opencode/src/acp/agent.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,26 @@ export namespace ACP {
529529
}
530530
return
531531
}
532+
533+
case "session.updated": {
534+
const props = event.properties
535+
const session = this.sessionManager.tryGet(props.sessionID)
536+
if (!session) return
537+
if (!props.info.title) return
538+
await this.connection
539+
.sessionUpdate({
540+
sessionId: session.id,
541+
update: {
542+
sessionUpdate: "session_info_update",
543+
title: props.info.title,
544+
updatedAt: new Date(props.info.time.updated).toISOString(),
545+
},
546+
})
547+
.catch((error) => {
548+
log.error("failed to send session_info_update to ACP", { error })
549+
})
550+
return
551+
}
532552
}
533553
}
534554

0 commit comments

Comments
 (0)