Commit 20a9192
committed
fix(langgraph): stop discarding a subagent's explicit manually_emit_state
Follows the protocol correction in the parent commit. An audit revision added a
subagent guard to the `manually_emit_state` handler that DROPPED the payload --
neither recording nor emitting it -- justified by the rule that only the parent
agent owns state. That rule was invented, and the guard silently discarded a
state write the caller had explicitly asked for.
Pre-audit behaviour is restored: the value is recorded and the snapshot emitted,
as it was before (verified against 3386757, where this handler had no subagent
guard at all). The dispatch chokepoint stamps subagent_run_id on the snapshot,
which is provenance -- it records who wrote the state, while the state itself
stays run-scoped.
The two tests pinning the drop are replaced by one asserting the restored
behaviour: the snapshot is emitted, carries the subagent's id, and the value is
recorded. Both directions are covered, since silently dropping and silently
mis-scoping are different failures.
The other two state suppressions are LEFT ALONE, because they are pre-existing
and their real reason still holds: node-exit and checkpoint snapshots carry a
subgraph's PARTIAL view of the run's state document, so emitting one
mid-delegation would overwrite the whole state with a fragment. Their comments
are corrected only to stop citing a protocol prohibition that does not exist --
this is a producer-side choice about the integration's state model, and the
distinction matters for anyone reading the code to learn what the protocol
requires.
Verified: 468 LangGraph tests (down one, as two tests became one).1 parent 2478a70 commit 20a9192
2 files changed
Lines changed: 49 additions & 71 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
1009 | 1010 | | |
1010 | 1011 | | |
1011 | 1012 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1015 | 1020 | | |
1016 | 1021 | | |
1017 | 1022 | | |
| |||
2283 | 2288 | | |
2284 | 2289 | | |
2285 | 2290 | | |
2286 | | - | |
2287 | | - | |
2288 | | - | |
2289 | | - | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
2293 | | - | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2294 | 2296 | | |
2295 | | - | |
2296 | | - | |
2297 | | - | |
2298 | | - | |
2299 | | - | |
2300 | | - | |
2301 | | - | |
2302 | | - | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
2312 | 2307 | | |
2313 | 2308 | | |
2314 | 2309 | | |
| |||
2771 | 2766 | | |
2772 | 2767 | | |
2773 | 2768 | | |
2774 | | - | |
2775 | | - | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
2776 | 2773 | | |
2777 | 2774 | | |
2778 | 2775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
174 | 155 | | |
175 | 156 | | |
176 | 157 | | |
| |||
0 commit comments