fix(graph): retire the teammate identity before structured extraction

PR #24 follow-up 10. The identity was only retired by the frontier and
chain-exit safety nets, so a peer stayed messageable during
structured::extract after its agent had already stopped. Mark it
finished the moment the agent future resolves, on success and on both
error paths.
This commit is contained in:
Dark-Alex-17 committed 2026-09-11 10:56:27 -06:00
1 parent 874ef7f6ec
commit 0bef0f2c39
2 files changed
+74 -11

No files matched your search

+1 -1
View File
@@ -465,7 +465,7 @@ pub(super) async fn step(
) -> Result<StepResult> {
match &node.node_type {
NodeType::Agent(agent_node) => {
AgentNodeExecutor::execute(agent_node, state, ctx).await?;
AgentNodeExecutor::execute(agent_node, state, ctx, !step_ctx.branch_mode).await?;
let targets = static_next_targets(node, current, "agent", step_ctx.branch_mode)?;
Ok(StepResult::Continue(targets))
}