Repository navigation
feat(acp): forward session title updates via session_info_update - #45536
Closed
tudor-the-conqueror wants to merge 1 commit into
Closed
tudor-the-conqueror wants to merge 1 commit into
tudor-the-conqueror wants to merge 1 commit into
Conversation
The ACP event subscription did not handle session.updated events, so title changes (e.g. generated by the title agent after the first prompt) never reached ACP clients. Clients like Zed fall back to a provisional title derived from the first user message and only replace it when the agent sends a session_info_update notification. Handle session.updated in the ACP event subscription and forward non-empty title changes for known sessions as session_info_update notifications, deduplicating repeated events with unchanged titles.
Contributor
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Type of change
What does this PR do?
When a session title changes (e.g. the title agent generates a title after the first prompt, or a custom
agent.title.promptconfig renames it), ACP clients never learn about it. The ACP event subscription inpackages/opencode/src/acp/event.tsonly handlessession.status,permission.asked, andmessage.part.updated/delta—session.updatedevents are ignored.Clients like Zed set a provisional title from the truncated first user message and only replace it when the agent sends a
session_info_updatenotification (stabilized ACP protocol feature; Zed handles it inacp_thread.rsand replaces the provisional title on receipt). Since opencode never sends one, ACP sessions stay mislabeled even thoughopencodeCLI/TUI shows the correct title. Titles are only exposed passively viasession/list.This PR handles
session.updatedin the ACP event subscription and forwards non-empty title changes for known sessions assession_info_updatenotifications. Repeatedsession.updatedevents with an unchanged title are deduplicated via a per-session map so we do not spam the notification on every session write.How did you verify your code works?
packages/opencode/test/acp/event.test.tscovering: title forwarded assession_info_update, dedup of unchanged titles, and ignoring unknown sessions / empty titles.bun test test/acp/event.test.ts— 19 pass, 0 fail.bun run typecheck(tsgo) — clean.Screenshots / recordings
Checklist