fix(agents): name the map-branch output key in deep-research and finding-verifier
An llm node never persists its completion under `output` (the binding is transient), so a map branch without state_updates collected the stale inherited value: deep-research produced `None` findings and finding-verifier errored on its first item because `output` was absent. Both maps now declare an explicit output_key and their branch nodes write it via state_updates. graph.example.yaml's research_subject gets the same named-key pattern and its branch comment describes it. Design: plans/map-subgraph-branches-design.md §2.6, §3.7 (C9).
This commit is contained in:
3 files changed
+12
-3
No files matched your search
@@ -115,6 +115,7 @@ nodes:
|
|||||||
as: question
|
as: question
|
||||||
branch: research_one_question
|
branch: research_one_question
|
||||||
collect_into: question_findings
|
collect_into: question_findings
|
||||||
|
output_key: finding
|
||||||
max_concurrency: 3
|
max_concurrency: 3
|
||||||
next: combine_findings
|
next: combine_findings
|
||||||
|
|
||||||
@@ -152,6 +153,8 @@ nodes:
|
|||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
max_attempts: 2
|
max_attempts: 2
|
||||||
temperature: 0.1
|
temperature: 0.1
|
||||||
|
state_updates:
|
||||||
|
finding: "{{output}}"
|
||||||
|
|
||||||
combine_findings:
|
combine_findings:
|
||||||
id: combine_findings
|
id: combine_findings
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ nodes:
|
|||||||
as: finding
|
as: finding
|
||||||
branch: verify_one
|
branch: verify_one
|
||||||
collect_into: verdicts
|
collect_into: verdicts
|
||||||
|
output_key: verdict
|
||||||
max_concurrency: 4
|
max_concurrency: 4
|
||||||
next: done
|
next: done
|
||||||
|
|
||||||
@@ -150,6 +151,8 @@ nodes:
|
|||||||
max_iterations: 8
|
max_iterations: 8
|
||||||
max_attempts: 2
|
max_attempts: 2
|
||||||
temperature: 0.1
|
temperature: 0.1
|
||||||
|
state_updates:
|
||||||
|
verdict: "{{output}}"
|
||||||
|
|
||||||
done:
|
done:
|
||||||
id: done
|
id: done
|
||||||
|
|||||||
+6
-3
@@ -387,7 +387,7 @@ nodes:
|
|||||||
# (not spawn-finish order).
|
# (not spawn-finish order).
|
||||||
max_concurrency: 3 # Optional per-map cap. Defaults to
|
max_concurrency: 3 # Optional per-map cap. Defaults to
|
||||||
# settings.max_concurrency above.
|
# settings.max_concurrency above.
|
||||||
output_key: output # Optional. State key the branch's output
|
output_key: subject_summary # Optional. State key the branch's output
|
||||||
# appears under. Default "output". Useful
|
# appears under. Default "output". Useful
|
||||||
# only if the branch reads its own bound
|
# only if the branch reads its own bound
|
||||||
# name back (rare).
|
# name back (rare).
|
||||||
@@ -403,8 +403,11 @@ nodes:
|
|||||||
prompt: "Research {{subject}}: pull the key facts and one citation."
|
prompt: "Research {{subject}}: pull the key facts and one citation."
|
||||||
tools:
|
tools:
|
||||||
- web_search_coyote
|
- web_search_coyote
|
||||||
# No `next:`, `state_updates:`, or `output_schema:` here. Map branches
|
# Recommended pattern: write the completion to a named key via
|
||||||
# have a strict contract (see `subjects_map.branch` comment).
|
# `state_updates` and point the map's `output_key` at that same key.
|
||||||
|
# `{{output}}` is bound only while these templates render.
|
||||||
|
state_updates:
|
||||||
|
subject_summary: "{{output}}"
|
||||||
|
|
||||||
# Aggregator that runs after the map joins. Reads the collected list.
|
# Aggregator that runs after the map joins. Reads the collected list.
|
||||||
aggregate_subjects:
|
aggregate_subjects:
|
||||||
|
|||||||
Reference in new issue
Block a user