You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Frun1na (via GitHub)" <gi...@apache.org> on 2026/09/20 17:43:44 UTC

[PR] fix(ai): seed the run id on attach so stop works after a reconnect [rocketmq-dashboard]

Frun1na opened a new pull request, #4613:
URL: https://github.com/apache/rocketmq-dashboard/pull/4613

   ### Which Issue(s) This PR Fixes
   
   - Fixes #ISSUE_ID_PLACEHOLDER
   
   ### Brief Description
   
   Reattaching to a live run (reload, reconnect, second tab) never receives a `run_started` frame: the server replays persisted events on attach and its live event vocabulary starts at `run_started` — `AgentEventProjector` does not project a replayed run row into one. The hook therefore never learned the run id, while the composer still renders the stop state from `isStreaming`. Result: a clickable stop button whose `stop()` call returns immediately, and `reportSpeed` silently skipped for the same reason.
   
   Fix: `startStream` accepts a `knownRunId` that `attach` passes in, seeding `runIdRef`/`runId` with the id the caller already knows. The fresh-send path is unchanged (`knownRunId` defaults to null).
   
   ### How Did You Test This Change?
   
   ```
   cd web && npx vitest run src/pages/ai/hooks/useAgentRun.test.ts
    Test Files  1 passed (1)
         Tests  14 passed (14)
   ```
   
   The new `stopsAnAttachedRunThroughTheApiTest` fails without the hook change (`canStop` stays false after attach, `stopRun` never called).
   
   ```
   cd web && npx vitest run src/pages/ai
    Test Files  14 passed (14)
         Tests  179 passed (179)
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / `refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named `...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / in-app help)
   


-- 
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): seed the run id on attach so stop works after a reconnect [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #4613:
URL: https://github.com/apache/rocketmq-dashboard/pull/4613


-- 
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