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
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, 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>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
RulaKhaled
force-pushed
the
feat/flue-instrumentation-tests
branch
from
September 10, 2026 07:41
bdda8e5 to
612798a
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 is tests only.
Unit (15 cases): span shapes and ops, the conversation id lifted off the re-entered agent operation, usage/cost mapping, the all-zero-usage guard on failed turns, tool spans, content recording and 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.Two notes for review. The scenario uses
pi-ai's built-infauxprovider rather than a mock HTTP server, so it needs no key and is deterministic. And it is ESM only —@flue/runtimehas norequirecondition, so thecjsmode returns early; it is installed per-suite becauseengines.node >= 22.19would breakyarn installon the Node 20 lane, and is guarded byconditionalTest({ min: 22 }).Both suites were mutation-tested, not 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