Skip to content

llm anthropic: translated stream's in-stream error event carries request_id (ErrorResponse requires it) - #967

Merged
MattJackson merged 1 commit into
predevfrom
lane-gaps-anthropic-error-request-id
Oct 15, 2026
Merged

MattJackson merged 1 commit into
predevfrom
lane-gaps-anthropic-error-request-id

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

Owner rule 22 (2026-10-14): named conformance gaps are zero. ARCHITECT ruling 2026-10-14.

The anthropic writer's in-stream event: error body is Anthropic's ErrorResponse. The pinned schema requires type, error and request_id (nullable). v1.5.5 omitted request_id (crates/busbar/src/proto/anthropic/writer.rs:626-666 at v1.5.5), and so did predev. The llm spec-conformance rig would therefore FAIL any translated stream that fails part way.

The fix. The writer mints a req_ id, using the same mint as its buffered error envelope.

Accepted difference "R-22 a translated Anthropic stream's error event carries request_id":

  • kind improvement, body class only;
  • expected_cells 0: no oracle cell records a translated mid-stream failure. The diagonal stream_upstream_error cells are verbatim relays;
  • CHANGELOG line added.

RED. crates/busbar-plane-llm/tests/anthropic_stream_error_request_id.rs fails on predev because request_id is absent.

…quest_id, as Anthropic's published ErrorResponse requires

When a translated stream into Anthropic ingress fails part way, the anthropic writer writes the
`event: error` frame itself. Its body is Anthropic's ErrorResponse, and the pinned schema requires
type, error and request_id (nullable). v1.5.5 wrote no request_id
(crates/busbar/src/proto/anthropic/writer.rs:626-666 at v1.5.5), and neither did this writer, so the
llm spec-conformance rig fails any such row on `required`. Owner rule 22 (2026-10-14): named
conformance gaps are zero; ARCHITECT ruling 2026-10-14.

The writer now mints a req_ id, the same way its buffered error envelope does (synth_request_id).

Registered as accepted difference "R-22 a translated Anthropic stream's error event carries
request_id": improvement, body only, owed cells (expected_cells 0, since no oracle cell records a
translated stream failing part way), with its CHANGELOG line.

RED: tests/anthropic_stream_error_request_id.rs. For three error classes, the written event must
carry every member ErrorResponse requires. On predev request_id is absent.
@MattJackson

Copy link
Copy Markdown
Collaborator Author

#1028 also edits crates/busbar-plane-llm/src/codec/anthropic/writer.rs: every ProtocolWriter method takes host, and the synth_* ids draw from it. Test merge with this branch is clean.

@MattJackson
MattJackson merged commit f2c6bbd into predev Oct 15, 2026
1 check was pending
@MattJackson
MattJackson deleted the lane-gaps-anthropic-error-request-id branch October 15, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant