Matrix: keep partial previews aligned with block streaming#59384
Conversation
Greptile SummaryThis PR fixes a bug where Confidence Score: 5/5
Reviews (1): Last reviewed commit: "Matrix: record partial preview block con..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Fixes Matrix reply delivery so streaming: "partial" can coexist with channels.matrix.blockStreaming: true, preserving completed assistant block messages while still using a live editable draft for the current block.
Changes:
- Update Matrix handler reply options so block streaming is only disabled when Matrix block streaming is not enabled (no longer implicitly disabled by partial draft streaming).
- Extend Matrix handler config tests to assert the correct
disableBlockStreamingbehavior for partial previews with block streaming on/off. - Update Matrix config/type docs and channel docs to describe the combined behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/matrix/src/types.ts | Clarifies streaming/blockStreaming semantics in the Matrix config type docs. |
| extensions/matrix/src/matrix/monitor/handler.ts | Changes disableBlockStreaming wiring to allow block streaming alongside partial draft previews when explicitly enabled. |
| extensions/matrix/src/matrix/monitor/handler.test.ts | Adds/updates unit tests covering the new coexistence contract. |
| docs/channels/matrix.md | Documents how partial previews interact with Matrix block streaming. |
| CHANGELOG.md | Notes the Matrix streaming behavior fix in Unreleased fixes. |
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42a2114c5d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: beb808281e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7789ac7d5b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11c2158a3a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7980047 to
5856d97
Compare
Track queued Matrix block boundaries in order so the live draft stays scoped to the current block even when multiple block replies queue before Matrix delivery drains. This also adds regression coverage for multi-boundary rotation and keeps assistant-message resets from reopening stale draft text.
Keep queued Matrix block boundaries tagged to their assistant message so a new assistant-message start cannot erase the bookkeeping for older in-flight block deliveries. This prevents delayed block drains from rewinding or dropping the next draft preview and adds regression coverage for the cross-message race.
Capture the source assistant-message index before text_end flushes cross the microtask boundary, then thread that metadata into queued block-boundary signals for Matrix. This keeps delayed block replies attached to the correct message generation and adds regressions for the late-boundary routing path.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5856d97125
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5856d97 to
981aa35
Compare
|
Merged via squash.
Thanks @gumadeiras! |
Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…59384) Merged via squash. Prepared head SHA: 981aa35 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
streaming: "partial"andblockStreaming: truewere not just incompatible in config wiring; async block delivery could also desynchronize draft offsets and assistant-message generations.assistantMessageIndexmetadata so delayed block flushes stay attached to the correct message generation.streaming: "off"behavior.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
disableBlockStreaming=truewhenever partial drafts were enabled, so explicitchannels.matrix.blockStreamingintent was ignored.onPartialReplyslicing against stale offsets.text_endblock flushes can be deferred pastonAssistantMessageStart, so old block boundaries could be stamped with the next assistant message generation unless the source generation is captured and routed through.git blame, prior PR, issue, or refactor if known): this extends earlier Matrix draft-streaming and block-streaming behavior rather than introducing a new delivery model.Regression Test Plan (if applicable)
extensions/matrix/src/matrix/monitor/handler.test.tssrc/auto-reply/reply/dispatch-from-config.test.tssrc/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.emits-block-replies-text-end-does-not.test.tstext_endblock flush drainsassistantMessageIndexpropagation into block-boundary queueingUser-visible / Behavior Changes
streaming: "partial"withblockStreaming: true.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
channels.matrix.streaming: "partial",channels.matrix.blockStreaming: trueSteps
text_endblock flush.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
text_end, and message-generation propagation.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
onBlockReplyQueued+ optional metadata), and pin the routing contract with targeted tests.