Skip to content

Fix router stream log field accumulation#115

Merged
nhynes merged 2 commits into
mainfrom
codex/router-stream-log-fields
May 20, 2026
Merged

Fix router stream log field accumulation#115
nhynes merged 2 commits into
mainfrom
codex/router-stream-log-fields

Conversation

@nhynes
Copy link
Copy Markdown
Member

@nhynes nhynes commented May 20, 2026

Summary

  • Keep per-SSE-event protocol fields on the stream log record instead of recording them back onto the long-lived router exchange span.
  • Add a regression test for runtime JSON span output so stream results do not overwrite or accumulate exchange-level RPC fields.

Root Cause

SSE stream events reused the normal binding log path, which records each event's protocol summary onto the exchange span. Runtime JSON logging includes the current span fields on each event, so every stream event could add another copy of fields such as amber_protocol, amber_rpc_kind, amber_request_key, and amber_rpc_id.

Validation

  • cargo fmt
  • cargo test -p amber-router sse_events_do_not_record_per_event_protocol_fields_on_exchange_span
  • cargo clippy --all-targets
  • cargo test --workspace --all-features
  • git diff --check

Closes #113

@nhynes nhynes merged commit a9525db into main May 20, 2026
20 checks passed
@nhynes nhynes deleted the codex/router-stream-log-fields branch May 20, 2026 12:43
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.

router: stream logs accumulate copies of fields

1 participant