Skip to content

Fix Step 7 handoff 400 by moving skills to the Activities leaf - #13

Merged
Pierre Malarme (pmalarme) merged 1 commit into
mainfrom
fix-step7-handoff-skills
Jul 8, 2026
Merged

Fix Step 7 handoff 400 by moving skills to the Activities leaf#13
Pierre Malarme (pmalarme) merged 1 commit into
mainfrom
fix-step7-handoff-skills

Conversation

@pmalarme

Copy link
Copy Markdown
Collaborator

Problem

A deployed Step 7 agent hit a runtime error after a handoff sequence (a specialist hands back to the Coordinator):

Error code: 400 - No tool call found for function call output with call_id ...

Root cause

The skills provider is a context provider that registers its skill tools on whichever agent holds it. Step 7 uses a HandoffBuilder runtime handoff, where the Coordinator is the only participant invoked twice — once to route, then again to synthesize after a specialist hands back. Every agent sets the hard workshop invariant default_options={"store": False}, so the framework replays the whole tool-call history on the Coordinator's second call. A prior change (PR #9) had moved the skills onto the Coordinator; that extra tool stream desyncs the replay and the service rejects it with the 400. Leaf specialists are invoked once, so they carry context providers safely.

Fix

  • Step 7: Coordinator becomes a pure router (no tools, no context providers); the travel-guide (PDF) + response-guardrails skills ride on the Activities leaf. The Coordinator gathers flights/hotels first, then hands the full draft to Activities last so the deliverable and guardrail check reliably run through it.
  • Steps 8–9: unchanged runtime — the workflow's finalize_itinerary node still owns the skills (invoked once, no handoff re-entry). Stripped the skills off the now-legacy build_travel_coordinator factory (reference-only, not the 8–9 runtime path) and corrected its docstring + the finalize prompt that referenced the Step 7 Coordinator owning the deliverable.
  • Docs / README / slices / scaffold: kept in sync (docs > solutions > step_files). Adds the teaching point that a handoff Coordinator can't own tools/skills under store=False replay — which motivates Step 8's dedicated finalize node.

Keeps all the independent PR #9 improvements (Flights returns fares, Hotels web toolbox, multi-section prompts, model-size hint, agent-framework-orchestrations in requirements).

Known teaching limitation (intentional)

In Step 7 the guarded final path is routed, not structurally enforced — that's a real limitation of a pure router, and it's exactly what Step 8's workflow finalize node fixes.

Validation

  • Custom parity check: all coordinator.py/workflow.py parse; every specialist slice == its *_INSTRUCTIONS constant; step_files/07 slices == solution.
  • python .workshop/scripts/lint_steps.py0 failures (2 pre-existing unrelated warnings).
  • Reviewed by the rubber-duck agent; its actionable findings (stale finalize-prompt reference, determinism of the deliverable path, over-broad root-cause wording, legacy-factory docstring) are addressed.

The Step 7 runtime-handoff Coordinator is invoked twice (route, then
synthesize after a hand-back). With default_options={store: False} the
tool-call history is replayed on the second call, so a tool-producing
context provider (the skills provider) on the Coordinator desyncs that
replay and the service returns 400 'No tool call found for function call
output'. Move the travel-guide + response-guardrails skills back onto the
Activities leaf (invoked once) and make the Coordinator a pure router that
hands the full draft to Activities last to own the final deliverable.

Steps 8-9 keep skills on the workflow finalize node; strip skills off the
now-legacy build_travel_coordinator factory and correct its docstring plus
the finalize prompt that referenced the Step 7 Coordinator owning the
deliverable. Docs, README capability table, slices/manifests, and the
step_files/07 scaffold updated to match; adds the teaching point that a
handoff Coordinator cannot own tools/skills, motivating Step 8's finalize
node.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pmalarme
Pierre Malarme (pmalarme) merged commit ab168a7 into main Jul 8, 2026
8 checks passed
@pmalarme
Pierre Malarme (pmalarme) deleted the fix-step7-handoff-skills branch July 8, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant