AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Interrupt_after/Before With A Single String Matches Substrings And Compile Rejects Str/Tuple

When interrupt_after or interrupt_before is passed a single node name as a string at runtime, LangGraph uses substring matching (`'no' in 'node_one'` is True), so it pauses at the wrong node. Passing the same string or a tuple to StateGraph.compile raises TypeError because the code concatenates a list with a non-list interrupt specification.

highConfidence 95%LanggraphPersistenceCheckpointingAffected V1.2.14

Origin Analysis

Runtime interrupt checks perform `task.name in interrupt_nodes` where `interrupt_nodes` may be a plain string, so Python's substring semantics cause false positives. In compile, interrupt_after/interrupt_before are not normalized to lists before being merged with graph-level interrupts, leading to `list + str`/`list + tuple` concatenation errors.
1. Build a StateGraph with nodes 'no', 'node_one', 'two' and edges START->no->node_one->two->END. 2. Compile with `builder.compile(checkpointer=InMemorySaver())`. 3. Invoke with `interrupt_after='node_one'`. 4. Observe it pauses after 'no' instead of after 'node_one'. 5. Try `builder.compile(checkpointer=InMemorySaver(), interrupt_after='node_one')`; observe TypeError.

Fixing Code Block

Edge Case Audit

The change alters string handling from iterable-of-characters to single node name. This is intentional but could break code that relied on passing a multi-character string expecting it to be split (unlikely and not documented). Ensure both compile-time and runtime paths normalize consistently; otherwise one path may still use substring matching after the other is fixed. Apply with tests for str, tuple, list, None, and '*' inputs. Rollback is simply reverting to the previous version; no data migration is needed.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state