Bug Description
identify_flow() returns {"flow_context": flow_context} andverify_mechanism() reads state.get("flow_context"), but flow_context is never declared in CrossDatabaseState.
This means the topological reasoning pipeline fetches real API data from the Reactome Content Service but never uses it — the fix is a one-line state declaration.
Minimal Reproduction
# Before fix: topology data silently lost by LangGraph
result = await builder.identify_flow(state, {})
print(result.get("flow_context")) # Returns data ✓
# But in the next node, state never receives it:
flow_ctx = state.get("flow_context") # None — key dropped by LangGraph ✗
Why It's Non-Obvious
LangGraph does not raise an error for undeclared state keys — it silently discards them. This makes the bug invisible in unit tests that mock state directly, since those tests never pass through the LangGraph state reducer.
Fix
Add flow_context: str to CrossDatabaseState in src/agent/profiles/cross_database.py and a regression test to prevent recurrence.
Files Affected
src/agent/profiles/cross_database.py
tests/test_flow_reasoning.py
Bug Description
identify_flow()returns{"flow_context": flow_context}andverify_mechanism()readsstate.get("flow_context"), butflow_contextis never declared inCrossDatabaseState.This means the topological reasoning pipeline fetches real API data from the Reactome Content Service but never uses it — the fix is a one-line state declaration.
Minimal Reproduction
Why It's Non-Obvious
LangGraph does not raise an error for undeclared state keys — it silently discards them. This makes the bug invisible in unit tests that mock state directly, since those tests never pass through the LangGraph state reducer.
Fix
Add
flow_context: strtoCrossDatabaseStateinsrc/agent/profiles/cross_database.pyand a regression test to prevent recurrence.Files Affected
src/agent/profiles/cross_database.pytests/test_flow_reasoning.py