Repository navigation
fix(harness): name a served coordinator's own calls by its run, as its jobs' hand-offs do - #318
Draft
KarthikAvinashFI wants to merge 1 commit into
Draft
KarthikAvinashFI wants to merge 1 commit into
KarthikAvinashFI wants to merge 1 commit into
Conversation
…s jobs' hand-offs do
This branch has not been deployed
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
Follow-up tracked in TH-9023, raised separately so the open multi-agent PRs (future-agi #3699, #3791, agent-learning-kit #265) keep their review as they are. It does not block them.
A LangGraph deep agent started with
start_async_taskruns each worker as its own background run. Run live on the pinned async deep agents reference app, currentdevalready records both jobs as hand-offs (start and end), each joined to the call that launched it, and every worker tool call carries its worker. One gap was left: the coordinator's own calls carried no participant.The cause is the shape a graph server gives these spans:
toolsnode carry no span kind and no agent name, so no agent span sits above the launch.So one call was "Unknown" on one row and
agenton the other.What changed
src/fi/alk/harness/simulation_worker_events.pygen_ai.conversation.idorsession.id). This is the same name a launch from that run already passes to its job's hand-off.lc_agent_nameand any agent named on the span all still win, in the same order. Outside a conversation, a run's name (a request handler, a chain) is never read as an agent.tests/harness/test_framework_tool_spans.pyTests
test_a_served_coordinator_s_own_calls_and_its_jobs_hand_offs_name_the_same_agentagent, the hand-off points at the launch, and the job's tool stays the job's.test_a_call_in_a_run_with_no_conversation_and_no_agent_stays_unnamedPOST /chatrun with no conversation keeps no agent.Both were mutation-checked:
None == 'agent').The span module's whole suite (109 tests), plus the bootstrap and process runtime suites, pass: 500 in total.
Tested on
These runs use the harness's own process hook (
sitecustomizewithALK_OBSERVE_FRAMEWORKS=1andHARNESS_TOOL_TRACE) and the instrumentor version the build installs (traceai-langchain==0.2.1). The apps run on a local machine, not in a hosted sandbox.langgraph dev), one chat turn, ondevand then with this changedev: both jobs became hand-offs (start and end), each joined to its launch, and the worker tools were attributed (analyze_topicto researcher,generate_teststo coder). The two launchingstart_async_taskcalls had no agent. With this change: the launching calls readagent, the same agent as their hand-offs, and everything else is unchanged.dev's module and against this changeThe trace rows from the LangGraph run with this change (outputs left out):
Scope
In: the coordinator's own calls in a served graph run.
Out:
Linear
TH-9023
🤖 Generated with Claude Code
https://claude.ai/code/session_019gWFtEXoqSfwg3LAdyoEUb