123123213weqw opened a new pull request, #5815:
URL: https://github.com/apache/rocketmq-dashboard/pull/5815

   ## Why
   
   A provider's `result` frame is only a success when its subtype says 
`success`. `AgentEventProjector.projectResultMeta` already treats every other 
subtype - including a missing or blank one, which it renames `unknown` - as an 
error: it persists a `TimelineEvent.Error` with code `llm.provider.unknown` and 
sends the live `error` frame.
   
   `AiRunExecutor` disagreed. `record()` stored the raw subtype, and `decide()` 
uses `StringUtils.hasText(outcome.subtype)` to detect "a result frame arrived" 
- so a blank subtype fell through to the final branch and the run row was 
written **COMPLETED** over a timeline whose last event is an error. The row is 
the authority for reloads and for the admission gate, so a reloaded 
conversation showed a finished answer where the live client watched a failure. 
Two components reading the same frame must not disagree about what it means.
   
   ## What changed
   
   `record()` normalises a missing/blank subtype to `unknown` - the exact name 
the projector uses - before storing it in the outcome. `decide()` then fails 
the run with stop reason `PROVIDER_ERROR` and error code 
`llm.provider.unknown`, matching the code the projector already wrote into the 
timeline.
   
   ## Validation
   
   Red test first: 
`aBlankResultSubtypeShouldFailTheRunLikeTheProjectorSaysTest` streams a 
`ResultMeta` with a null subtype and asserts `FAILED` + `llm.provider.unknown`; 
on `upstream-studio` it fails with the row reading `COMPLETED`. Full 
`AiRunExecutorTest` (20 tests) 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to