feat(workflow): handoff formation is traced under its own 'handoff' role - #88
Merged
Conversation
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.
What
The handoff-formation exchange — where the model is asked to write the baton for the next step — is now traced under its own role,
handoff, instead ofworker.Why
Handoff formation runs lazily at the first
ai()of the NEXT step, so itsaispan sat inside that step's span under the genericworkerrole. In the trace it read as the next step doing work it had not begun — anassess-style step looked like it did nothing, its only visible exchange actually being the previous step's handoff. Naming the exchangehandoffmakes it what it is.Pure trace-label change:
formPendingHandoff()passes'handoff'as the$agenttorunTurns.agentModel('handoff')falls back to the scope's default model (no such role configured → no throw), so routing and content are unchanged; only the span's role differs.Test
handoffFormationIsTracedUnderItsOwnRoleNotTheNextStepsWorkasserts the ai roles across a two-step relay are['worker', 'handoff', 'worker'].Scope note
This is part (a) of the "handoff attribution" item. Part (b) — skipping the model call entirely for single-exchange steps and handing the reply on verbatim — was dropped by design: it would replace a consciously-formed, forward-looking baton with the step's own backward-looking reply, and (per the project direction) a well-made workflow should have essentially no single-exchange/trivial steps in the first place.