Skip to content

Conversation

@keelerm84
Copy link
Member

@keelerm84 keelerm84 commented Nov 7, 2025

Note

Propagates X-LD-EnvID and X-LD-FD-Fallback from HTTP/SSE headers through polling and streaming, updates error handling to surface env ID, and adds comprehensive tests.

  • Headers and Utilities:
    • Add _LD_ENVID_HEADER and _LD_FD_FALLBACK_HEADER constants; extend _Fail to carry headers; simplify UnsuccessfulResponseException (remove headers).
  • Polling (FDv2 and FDv1):
    • Read env ID/fallback from response headers and include in Update.environment_id and Update.revert_to_fdv1 for success and error paths.
    • When failures occur, pass response headers via _Fail(headers=...) and use them to set env ID/fallback; requester now includes headers on _Fail.
  • Streaming:
    • Capture env ID from Start/Fault headers and thread it through all emitted Updates (VALID/INTERRUPTED/OFF).
    • Honor fallback header to emit OFF with revert_to_fdv1=True; pass env ID into message/error processing.
  • Config/Docs:
    • Update TestDataV2 usage to pass builders directly and show integration via Config(..., datasystem_config=...).
  • Tests:
    • Add/adjust tests to verify env ID and fallback propagation across polling and streaming, including recoverable/unrecoverable errors and no-header cases.

Written by Cursor Bugbot for commit d3cb296. This will update automatically on new commits. Configure here.

@keelerm84 keelerm84 requested a review from a team as a code owner November 7, 2025 20:41

try:
update = self._process_message(action, change_set_builder)
update = self._process_message(action, change_set_builder, envid)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Environment ID Fails to Persist

The envid variable is reset to None at the start of each loop iteration, causing all Event actions to lose the environment ID that was captured from the initial Start action. The environment ID should persist across the stream session, but resetting it means only the Start action itself retains the correct envid, while all subsequent events processed by _process_message receive None instead of the actual environment ID.

Fix in Cursor Fix in Web

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.

2 participants