zmuxuny opened a new pull request, #7393: URL: https://github.com/apache/rocketmq-dashboard/pull/7393
### Which Issue(s) This PR Fixes Fixes [#7146](https://github.com/apache/rocketmq-dashboard/issues/7146). Replaces stale-closed [#7147](https://github.com/apache/rocketmq-dashboard/pull/7147), preserving the replay contribution and its current-base merge. Both the old PR and issue were closed by the inactivity bot. ### Brief Description The run-stream endpoint queries conversation-wide event pages. Replaying every row can put other turns' answers and terminal statuses into the requested run, including reporting a reaped FAILED run as COMPLETED. - Start at the later of the caller's cursor and a positive stored `startSeq - 1`, so earlier runs do not consume the requested run's replay budget. - Advance the scan cursor across every row, but check `runId` before decoding, projection, terminal detection, or the live deduplication watermark. - Keep the null/zero `startSeq` fallback. Do not cap at `endSeq`, which can retain its admission-time value after a run is reaped. The delta is limited to `AiRunService.attach` and its regression tests: two files, +208/-1. SQL, replay limits, observer registration, completion behavior, API shapes, dependencies, and build configuration are unchanged. This addresses content/status correctness within one owned conversation. Tested head: `604a1125610ef98c2fc7cd94e2c6ec1e3bb85b73`, based on `rocketmq-studio@7abf8adaf660d75f2d686bbe8741be76c3a5ddd3`. Admission and executor terminal/EOF changes are not included. Static patch compatibility with the separate admission replacement #7390 was checked; no combined-tree runtime validation is claimed. ### How Did You Test This Change? Fresh local verification on November 4, 2026, with Temurin 21.0.13+9 and Maven 3.9.9: - Exact candidate `AiRunServiceTest`: **43 passed**, zero failures/errors/skips. - Base negative control: replaced only production `AiRunService.java` with the current base, retaining the new tests. The seven new methods ran as nine instances: **8 expected assertion failures and 1 passing control**, zero errors/skips. The `after=8` control already works on base because no later rows remain. Failures cover middle-run isolation, reaped FAILED status, active tailing, history budget, null/zero start metadata, cursor-at-end handling, and the later-run watermark. - Independent start-boundary mutation: removed only the positive `startSeq` lower bound while retaining run filtering. The budget regression failed because the requested answer was not reached. - Independent watermark mutation: moved only `noteWatermark` before the foreign-run filter while retaining the start boundary and projection filter. The between-pages regression failed because the requested buffered COMPLETED terminal was dropped. Each mutation produced **one expected assertion failure**, zero errors/skips. - Restored exact candidate source: **251 passed across all 16 direct conversation-package classes**, zero failures/errors/skips, including 9 H2 persistence integration cases and 4 schema migration cases. - Related stream/projector/event contract selection: **423 passed across 9 classes**, zero failures/errors/skips. - RAT and Checkstyle passed in the normal test lifecycle. Final source/test hashes, `git diff --check`, and the clean-tree check passed. The history-budget fixture has **exactly 5,000 earlier-run rows**, followed by the requested text and terminal at 5001/5002. Null/zero legacy start metadata retains the existing total-row ceiling. Test selections overlap; their counts should not be added as unique tests. From `server/`, each test invocation used these common options with the relevant selection: ```sh mvn -o -B -ntp -s "$MAVEN_SETTINGS" \ -Dmaven.repo.local="$MAVEN_REPO" -DforkCount=1 \ "-DargLine=-Xmx512m -javaagent:$MAVEN_REPO/org/mockito/mockito-core/5.23.0/mockito-core-5.23.0.jar" \ "-Dtest=$TEST_SELECTION" test ``` `MAVEN_SETTINGS` and `MAVEN_REPO` denote the existing local settings and cache. The final related selection was `AiRunExecutorTest,AiRunServiceTest,AgentStreamSessionTest,AgentRunRegistryTest,AgentRunHandleStopTest,AgentEventProjectorTest,AiEventSeqAllocationTest,AiEventContractTest,AiEventJsonSerializationTest`. The explicit Mockito startup agent avoids dynamic attachment; no project configuration, assertion, or timeout was changed. **Packaging limitation:** the subsequent offline `package -DskipTests` attempt stopped during plugin resolution because `org.apache.maven.plugins:maven-jar-plugin:3.5.0` was not cached. The package lifecycle did not execute. This attempt is not reported as a successful package build. The service regressions exercise real replay/projector/session/registry logic with controlled repository fixtures. H2 persistence/migration coverage is separate. No live-provider test, multi-connection MySQL concurrency demonstration, full backend aggregate, frontend aggregate, or browser reproduction is claimed. Historical CI results from the old PR are not treated as current results. AI assistance was used for investigation, source review, and validation. ### Checklist - [x] One coherent replay change; no unrelated changes bundled in - [x] Conventional Commit subject - [x] Regression methods use the `...Test` suffix - [x] Existing ASF headers retained; no new source files or UI text - [x] Replay boundary comments explain the behavior - [ ] Full backend aggregate and ArchUnit checks were not rerun locally - [ ] Local package build remains unverified because of the offline plugin-cache limitation -- 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]
