Commit 8e8892e
fix(langgraph): don't guess subagent attribution when it's a coin flip (#864)
LangGraph's tools:<uuid> namespace is a checkpoint id assigned
independently of the parent's call_* tool-call id. I checked the wire for a
link between them and there is none — no metadata field, no co-occurrence
in any payload of a live run. When a delegation tool carries no matchable
description, position is genuinely the only signal left.
That is fine with one outstanding child, and it is what every graph here
produces: cockpit/chat/subagents dispatches ONE tool call per assistant
turn, three sequential ToolNode round-trips. With several outstanding at
once, arrival order is not dispatch order, and claiming the first unmapped
call silently cross-wires them. Reproduced: two children whose streams
arrive in reverse dispatch order, and call_ALPHA's card renders beta's
output. A booking card showing research text is worse than an empty one.
The fallback now fires only when exactly one candidate is outstanding.
Ambiguous streams stay buffered rather than mis-attributed, and can still
resolve later — as siblings complete, the candidate set shrinks back to
one. The description rungs are untouched and still preferred.
Verified: 344/344 (new cross-wiring guard included). Mutation-tested —
restoring the greedy fallback fails exactly that guard. Sequential
attribution re-checked against a live model: all three cards populate,
each on its own call_* id.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 779b008 commit 8e8892e
2 files changed
Lines changed: 71 additions & 7 deletions
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2906 | 2906 | | |
2907 | 2907 | | |
2908 | 2908 | | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
2909 | 2955 | | |
2910 | 2956 | | |
2911 | 2957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
196 | 214 | | |
197 | 215 | | |
198 | 216 | | |
| |||
0 commit comments