test(server-utils): Cover the Flue instrumentation - #24266
Draft
RulaKhaled wants to merge 2 commits into
Draft
Conversation
Contributor
size-limit report 📦
|
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 9, 2026 19:00
89239da to
deb3330
Compare
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 9, 2026 19:08
deb3330 to
bdda8e5
Compare
RulaKhaled
force-pushed
the
feat/flue-instrumentation-base
branch
from
September 10, 2026 07:41
9fb3fcd to
d62f4f2
Compare
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 10, 2026 07:41
bdda8e5 to
612798a
Compare
RulaKhaled
force-pushed
the
feat/flue-instrumentation-base
branch
from
September 11, 2026 06:13
d62f4f2 to
a0e8143
Compare
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 11, 2026 06:13
612798a to
411cfed
Compare
Unit tests over `createFlueInstrumentation` for the span shapes, the conversation id lifted off the re-entered agent operation, the usage/cost mapping, the all-zero-usage guard on failed turns, tool spans, content recording and its `recordInputs`/`recordOutputs` gating, and dispose. The integration test drives a real agent through a tool call using `pi-ai`'s `faux` provider, so the run is deterministic and needs no provider key or mock server. ESM only: `@flue/runtime` has no `require` export condition, and it is installed per-suite because its `engines.node >= 22.19` would break `yarn install` on the Node 20 CI matrix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Concurrent agent runs, subagent delegation (adopted from Isaac's repro, moved into the suite and asserted through a helper so a span-order assumption cannot creep back), the agent name arriving via the observations, trace continuation from the replayed traceparent, the provider skip applying on first use and re-applying after a registry reset, the recording options following the current client, and the conventional request attributes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 11, 2026 08:19
411cfed to
b4ad273
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #24265 — review that first; this diff is tests only.
Unit (15 cases): span shapes and ops, the conversation id lifted off the re-entered agent operation, the usage/cost mapping, the all-zero-usage guard on failed turns, tool spans and their error status, content recording with its
recordInputs/recordOutputsgating, and dispose.Integration: drives an agent through a tool call and asserts the full
invoke_agent→chat/execute_toolhierarchy, including that tool spans are siblings ofchatunder the agent invocation rather than children — matching how Flue's own OpenTelemetry adapter projects them.The scenario uses
pi-ai's built-infauxprovider rather than a mock HTTP server, so responses are scripted in-process and no provider key is needed. It is ESM only —@flue/runtimehas norequireexport condition, so thecjsmode returns early — and@flue/runtimeis installed per-suite because itsengines.node >= 22.19would breakyarn installon the Node 20 lane. Guarded byconditionalTest({ min: 22 }), so it skips on the repo's default Node 20; verified on Node 24.Both suites were mutation-tested rather than just run green: reverting the zero-usage guard, the conversation-id lift and the tool-span handling each produced a failure. One test passed vacuously on the first attempt and was fixed.
🤖 Generated with Claude Code