LangGraph state transition inconsistency in agentic workflows
The current architecture follows this flow:
1. llm_welcome initiates the request.
2. A conditional edge validates input.
3. If input is insufficient, it triggers human_input for clarification.
4. The flow then hits process_feedback.
The core issue is that even when process_feedback explicitly updates the state to point toward finalize_bt, the graph occasionally bypasses that node and resets to llm_welcome. This makes the entire agentic loop feel unreliable for production-grade collaboration.
The state management uses a TypedDict, and the routing logic is implemented as follows:
def _feedback(self, state: State) -> str:
return state.get("next_step", "END")In the feedback node, the return payload is explicitly mapped to drive the next step:
# If no errors
return {"messages_chat": state["messages_chat"], "text_rp": "", "next_step": "finalize_bt", "messages_extr": []}From a high-level perspective, this looks like a potential race condition or a deeper issue with how LangGraph handles state updates during conditional edge evaluation. If the state is being misread or corrupted during the transition from the interrupt back to the main loop, the entire UX breaks.
I’m looking into whether we are hitting a limitation in how the graph respects the next_step instruction when the state dictionary is being updated. It’s a scalability blocker if we can't guarantee deterministic routing in complex, multi-turn agent workflows.