unbridled-41 commented on PR #4740:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4740#issuecomment-5762092400

   @lizhimins Thanks — the blocking issue and the fixture contract are both 
addressed in 1e7a86e4 (branch rebased onto trunk `4c697f07`, resolving 
`useAgentRun.ts` against #4613's `knownRunId` seeding).
   
   **Admission without blocking**: `startStream` now returns an admission 
promise — `true` on the first stream frame, `false` when the open lifecycle 
settled without delivering any frame (409 `ai.run.busy`, a route that moved on, 
or a transport failure). The stream lifecycle continues inside the hook until 
the terminal frames and the timeline refetch settle (its promise is awaited 
there and its rejection consumed — no fire-and-forget, no unhandled rejection, 
timeline/finalization semantics unchanged).
   
   **useDraftHandoff**: with admission settling at the first frame, an admitted 
handoff clears the composer immediately and strips the history entry's state 
immediately; a refusal still restores the draft (and strips the state so a 
reload cannot replay it). The plain composer send likewise restores only on 
refusal, now at admission time.
   
   **Fixture**: both refusal fixtures use `code: 'ai.run.busy', status: 409` — 
the real `AiRunService.REFUSED_BUSY_CODE` contract; `ai.run.in_flight` is gone.
   
   **New regression**: 
`clearsTheComposerAndHistoryStateImmediatelyWhenAnAdmittedHandoffIsStillStreamingTest`
 — handoff onto an existing conversation whose stream emits `run_started` and 
then stays open: composer reads empty and the history state is `null` while the 
stream has NOT finished. Red against the previous code (`Received: '检查集群状态'` — 
the clearing was deferred to the end of the run), green now. The boundary test 
`keepsTheComposerClearedWhenAnAdmittedStreamFailsTest` is retained.
   
   AiPage **19/19**, full `src/pages/ai` suite **190/190**; `tsc -b`, eslint, 
`npm run build` clean.
   
   Ready for re-review.
   


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

Reply via email to