Skip to content

Do not record a turn the caller already recorded - #70

Merged
vitramir merged 1 commit into
mainfrom
dont-double-the-turn
Aug 20, 2026
Merged

Do not record a turn the caller already recorded#70
vitramir merged 1 commit into
mainfrom
dont-double-the-turn

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

invocation.message marks where a turn begins, and whoever handed the message over is the one that knows.

Under the platform that is agynd: it opens the trace and records the span before the message reaches this process. Recording a second one puts two on a single turn, and a reader counting turns sees two:

trace summary: expected invocation.message count 1, got 2

That surfaced the moment agn started writing into the trace agynd opened (#69) rather than one of its own — before that the duplicate was invisible because the two spans were in different traces.

Standalone there is no such caller and the span is this turn's root, so it is opened only when nothing else has: an inherited span context means somebody already did.

invocation.message marks where a turn begins, and whoever handed the message
over is the one that knows. Under the platform that is agynd: it opens the
trace and records the span before the message reaches this process. Recording a
second one puts two on a single turn, and a reader counting turns sees two --
which is what the platform's own trace assertion caught, once agn started
writing into the trace agynd opened rather than one of its own.

Standalone there is no such caller, and the span is this turn's root. So it is
opened only when nothing else has: an inherited span context means somebody
already did.
@vitramir
vitramir merged commit 1d9e4ef into main Aug 20, 2026
1 of 2 checks passed
@vitramir
vitramir deleted the dont-double-the-turn branch August 20, 2026 11:13
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