fix(graph): honor an explicit output key in state_updates

Hoist the three copies of apply_state_updates (llm, agent, rag) into
graph::state_updates::apply(state, output, has_schema, updates). The
helper computes every state_updates value first, restores the transient
`output` binding, and only then writes the computed updates, so a
`state_updates: { output: "{{output}}" }` entry is no longer clobbered
by the restore step.

The per-file wrappers stay as one-line calls so their existing tests are
unchanged; new direct helper tests live in state_updates.rs, including
the regression test for the clobber.

Design: plans/map-subgraph-branches-design.md §2.6, §3.7 (C5, D3).
This commit is contained in:
Dark-Alex-17 committed 2026-09-11 10:56:26 -06:00
1 parent 1df82b50b6
commit 24088a48a1
5 files changed
+172 -87

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ pub mod reducer;
pub mod script;
pub mod staging;
pub mod state;
pub mod state_updates;
pub mod structured;
pub mod types;
pub mod user_interaction;