You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "123123213weqw (via GitHub)" <gi...@apache.org> on 2026/10/09 04:14:57 UTC
[PR] fix(ai): attach the run observer before the replay query [rocketmq-dashboard]
123123213weqw opened a new pull request, #5753:
URL: https://github.com/apache/rocketmq-dashboard/pull/5753
## What\n\n`GET /api/ai/runs/{runId}/stream` (the reconnect path, `AiRunService.attach`) read the persisted rows, replayed them to the socket, and only then registered the session as an observer with `AgentRunRegistry`.\n\n## Why it is a bug\n\nA live frame the run published between the replay query and the registration reached nobody: the session was not yet an observer, and its persisted row was written after the query, so it was not in the replay window either. The reconnecting client's transcript silently lost exactly the blocks the run produced while it was catching up (a tool call, a text flush), and only another reload could fill the hole.\n\nThis contradicts the invariant `AgentStreamSession` already documents and implements: "The observer is registered *before* the replay is sent … Frames that arrive during the replay are buffered and drained afterwards, still deduplicated." The service simply wired it in the opposite order.\n\n## The fix\n\nRegister the observer **befo
re** the replay query. Frames published during the replay are buffered by the session (it is in the REPLAYING state), and `finishReplay()` drains them after the replayed rows, dropping anything at or below the replay watermark — the mechanism that already existed for exactly this purpose.\n\n## Test\n\nRed-first: `AiRunServiceTest.attachShouldRegisterTheObserverBeforeTheReplayQueryTest` publishes a frame from inside the replay query stub (the exact window) and asserts the observer still receives it. Fails on the previous ordering, passes with the fix; the rest of the class (23 tests) stays green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ai): attach the run observer before the replay query [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #5753:
URL: https://github.com/apache/rocketmq-dashboard/pull/5753
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ai): attach the run observer before the replay query [rocketmq-dashboard]
Posted by "123123213weqw (via GitHub)" <gi...@apache.org>.
123123213weqw commented on PR #5753:
URL: https://github.com/apache/rocketmq-dashboard/pull/5753#issuecomment-6123349699
@lizhimins Refreshed this branch onto the current `rocketmq-studio` — no conflicts, and this PR's own tests pass: `AiRunServiceTest` green (21/21).
One CI note that is not this PR's doing: **Backend Build** is red for every open PR right now — the `binary-license-gate` (`server/pom.xml` → `scripts/legal.py`) fails on the current `rocketmq-studio` HEAD as well, because the spring-ai/swagger-ui/tencentcloud jars carry no embedded LICENSE/COPYING text for the gate to collect. Not something this PR can fix from its own branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org