Reproduction
Create a sandbox executor whose stream emits:
{ type: "error", data: { message: "sandbox failed" } }
{ type: "done", data: { status: "failed" } }
Drain it through streamAgentTurn.
Actual
The final Runtime event has status: "completed", reason: "turn completed", and a structurally valid verdict.
Expected
The final event remains failed and preserves any measured token and cost receipt from the stream.
Cause
The sandbox executor treats any parsed output as a valid winner. streamAgentTurn then assigns completed whenever executor execution resolves. Neither layer reads the terminal sandbox outcome.
Downstream evidence
Braid reproduced this against agent-runtime 0.131.7 and added a boundary guard so failed sandbox events cannot appear successful.
Reproduction
Create a sandbox executor whose stream emits:
{ type: "error", data: { message: "sandbox failed" } }{ type: "done", data: { status: "failed" } }Drain it through
streamAgentTurn.Actual
The final Runtime event has
status: "completed",reason: "turn completed", and a structurally valid verdict.Expected
The final event remains failed and preserves any measured token and cost receipt from the stream.
Cause
The sandbox executor treats any parsed output as a valid winner.
streamAgentTurnthen assigns completed whenever executor execution resolves. Neither layer reads the terminal sandbox outcome.Downstream evidence
Braid reproduced this against agent-runtime 0.131.7 and added a boundary guard so failed sandbox events cannot appear successful.