feat(evals v4): OTEL agent spans for claude_code/codex harnesses - #2761
Open
miguelg719 wants to merge 1 commit into
Open
feat(evals v4): OTEL agent spans for claude_code/codex harnesses#2761miguelg719 wants to merge 1 commit into
miguelg719 wants to merge 1 commit into
Conversation
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Architecture diagram
sequenceDiagram
participant Eval as Eval Runner
participant Cli as claudeCodeHarness/codexHarness
participant Span as withHarnessAgentSpan
participant OTEL as OTEL/LangSmith
participant Agent as claude-code/codex SDK
Note over Eval,Agent: Runtime flow for external harnesses
Eval->>Cli: execute plan
Cli->>Cli: Prepare tool adapter, plan, signal, verifier
alt EVAL_TRACE_TRANSPORT is set
Cli->>Span: Wrap agent execution
Span->>Span: Create agent span (attributes: harness, model, task, instruction)
Span->>OTEL: Start agent span
Span->>Agent: Execute runClaudeCodeAgent/runCodexAgent
Agent-->>Span: Agent result
Span->>OTEL: End agent span (attach to eval task-root)
Span-->>Cli: Return result
else EVAL_TRACE_TRANSPORT is unset
Cli->>Agent: Execute runClaudeCodeAgent/runCodexAgent (no-op span)
Agent-->>Cli: Agent result
end
Cli->>Cli: Run toolAdapter cleanup and deregister carrier
Cli-->>Eval: Return task result
Note over OTEL,Agent: Native page/act/observe spans from stagehand flow in via global provider
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 19:46
5ea3bad to
5987e13
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 20:03
5987e13 to
adfeb68
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 21:03
adfeb68 to
33dc9b5
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 22:05
33dc9b5 to
a380ea2
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 22:07
a380ea2 to
6496668
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-harness-spans
branch
from
August 17, 2026 22:34
6496668 to
db1f171
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.
Why
Stack 5/6. External harnesses drive their own SDKs (claude-agent-sdk/codex-sdk) which emit no OTEL.
What
runClaudeCodeAgent/runCodexAgentinwithHarnessAgentSpanso their runs nest an agent node under the eval task-root span — parity with thestagehandharness (whose native RPC spans flow in via the global provider).EVAL_TRACE_TRANSPORTis unset.Testing
Validated live: a claude_code run on Browserbase produced an 85-span LangSmith trace (task-root → agent.claude_code → native page/act/observe spans).
Base: #2760
Summary by cubic
Adds OpenTelemetry agent spans for the
claude_codeandcodexharnesses so eval traces show a nested agent span under the task root. Previously these harnesses emitted no OTEL; now each run sets harness, model, task, and instruction span attributes without changing execution.runClaudeCodeAgent/runCodexAgentwithwithHarnessAgentSpaninpackages/evals/framework/benchHarness.ts.EVAL_TRACE_TRANSPORTis set; behavior matches thestagehandharness; no migration required.Written for commit db1f171. Summary will update on new commits.