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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]