Repository navigation
Conversation
There was a problem hiding this comment.
The fix works. I ran the new test against the base branch: it fails there because Effect replaces the explicit traceparent with its own. With this change, test/executor.test.ts passes and typecheck:tsc is clean. I also checked Effect 4.1.0's client: the propagation setting is read inside the per-request effect that HttpClient.transform wraps, and header names are lowercased. So the check sees headers added by middleware, and turning propagation off applies to that request only.
Public API is unchanged. The only change in behaviour: a request that already has a traceparent no longer gets Effect's traceparent or b3 headers.
One request: the new test is large for a 9-line fix. Please cut it to the core cases (see inline comment).
There was a problem hiding this comment.
My earlier request is addressed: the test is now cut down to the core cases (an explicit traceparent set directly, one set by middleware, both without b3, and normal propagation when there is none). It still fails on the base branch and passes with this change, and typecheck:tsc is clean. The fix itself is unchanged and the public API is unchanged. Nothing else to raise.
caab8b4 to
4619067
Compare
4619067 to
7b91415
Compare
eb1f035 to
79ee64c
Compare
79ee64c to
d1312ce
Compare
d1312ce to
5879ac0
Compare
5879ac0 to
ce9f381
Compare
ce9f381 to
00e8b97
Compare
00e8b97 to
c3b6ba3
Compare
c3b6ba3 to
af374eb
Compare
af374eb to
7561cc2
Compare
7561cc2 to
8d49719
Compare
8d49719 to
7b07e75
Compare
Issue for this PR
Closes #49038
Type of change
What does this PR do?
Effect's HTTP client overwrites an existing
traceparentheader with its own trace context and may also add a B3 header from a different trace. This breaks trace correlation when a plugin injects its own trace context through request middleware.The fix disables Effect's automatic trace propagation for requests that already contain a
traceparentheader. Requests without an explicittraceparentcontinue using the default behavior.How did you verify your code works?
Built OpenCode locally and tested the complete tracing setup with:
Verified trace context propagation through OpenCode, AgentGateway and Langfuse.
Also added an integration test using a local HTTP server to verify the actual outgoing headers, including middleware-injected headers.
Full
packages/aitest suite: 2,035 passed, 28 skipped, 0 failed.All 35 pre-push checks passed.
Checklist