feat(acp-client): expose session title, model state, and config options#559
feat(acp-client): expose session title, model state, and config options#559
Conversation
Extend the MessageWriter trait with default callbacks for session metadata events (title updates, model state, config option changes) and wire them through both the notification handler and session setup so consumers can react to these ACP protocol features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Broaden `on_session_title_update` to `on_session_info_update` so consumers receive the entire `SessionInfoUpdate` (including `updated_at`), not just the title. Correct the `on_model_state_update` doc comment to reflect that `SessionModelState` is only delivered in setup responses, not via notifications. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e39edc22c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Session metadata events are forwarded regardless of phase. | ||
| match ¬ification.update { | ||
| SessionUpdate::SessionInfoUpdate(info) => { | ||
| self.writer.on_session_info_update(info).await; | ||
| return Ok(()); |
There was a problem hiding this comment.
Preserve replay bookkeeping for metadata notifications
Avoid returning before phase handling for SessionInfoUpdate/ConfigOptionUpdate during resume. In Replaying, the bookkeeping that marks received_any and refreshes last_notification_at now never runs for these updates, so run_acp_protocol cannot satisfy is_replay_idle and falls back to the 10s absolute timeout when the replay stream contains only metadata events. That adds a deterministic startup delay on resumed sessions for agents that replay title/config updates without message/tool chunks.
Useful? React with 👍 / 👎.
Summary
MessageWritercallbacks for session info updates, model state, and config option changesSessionInfoUpdateandConfigOptionUpdatenotifications from ACP sessionsNewSessionResponseandLoadSessionResponseSessionInfoUpdate,SessionModelState,SessionConfigOption, etc.)Test plan
MessageWritertrait methods (default impls ensure backward compat)🤖 Generated with Claude Code