fix(cli): align stream error handling after output-mode merge
Follow up on #1740/#1741 by typing terminal SSE errors in the SDK, classifying them as server.error in the CLI/MCP, marking Projector done on error frames, attaching session_id to MCP stream failures, and migrating the e2e chat step to the bounded JSON envelope.
This commit is contained in:
@@ -64,6 +64,9 @@ func (p *Projector) Chat(r *sdk.StreamResponse) (ProjectedEvent, bool) {
|
||||
if r.ResponseType == sdk.ResponseTypeComplete {
|
||||
p.done = true
|
||||
}
|
||||
if r.ResponseType == sdk.ResponseTypeError && r.Done {
|
||||
p.done = true
|
||||
}
|
||||
|
||||
responseType := string(r.ResponseType)
|
||||
isAnswer := r.ResponseType == sdk.ResponseTypeAnswer || (r.ResponseType == "" && r.Content != "")
|
||||
@@ -103,6 +106,9 @@ func (p *Projector) Agent(r *sdk.AgentStreamResponse) (ProjectedEvent, bool) {
|
||||
if r.ResponseType == sdk.AgentResponseTypeComplete {
|
||||
p.done = true
|
||||
}
|
||||
if r.ResponseType == sdk.AgentResponseTypeError && r.Done {
|
||||
p.done = true
|
||||
}
|
||||
|
||||
isAnswer := r.ResponseType == sdk.AgentResponseTypeAnswer
|
||||
isReference := r.ResponseType == sdk.AgentResponseTypeReferences
|
||||
|
||||
Reference in New Issue
Block a user