OpenProgram Docs

DAG edge fields

callerpredecessor
QuestionWho called meWho I follow in chat order
EdgeSub-callConversation chain
FieldCall.callerCall.predecessor
ExampleThe LLM that invoked a toolSecond-round user follows first-round reply
DecidesSub-call indentation, internal nodesForks: one predecessor with several children

The two often differ. A top-level user node hangs off ROOT but follows the previous reply, and a spawn root has a caller but no predecessor. One name for both once let a helper read the wrong edge.

No compatibility layer

Only these two key names exist: no alias, no backfill in from_dict or the message adapters, no unused parent field in GNode. The backend graph dict and frontend are one protocol, so a key rename lands on both sides at once.

Where each name is used

Backend (openprogram/state/store/session/)

SymbolRole
nodes.py CallThe two dataclass fields
_msg_adapter.py _msg_to_nodeMessage keys to fields; predecessor is popped from metadata so no mirror survives
_msg_adapter.py _node_to_msgFields to two explicit keys
session_store/shared.py_node_conv_predecessor, _node_caller
memory_index.py appendIndexes children_by_predecessor, children_by_caller
graph/builder.py build_session_graphGraph dict with both keys
graph/layout/_common.pypredecessor_of, caller_of
graph/layout/tier.pyCaller, for sub-call indentation
graph/layout/lane.pyPredecessor
graph/layout/depth.py, topology.pyBoth; depth takes predecessor first, then caller

Frontend (apps/web/lib/runtime-bridge/)

SymbolRole
dag/types.ts GNodeCarries both
dag/types.ts semanticParent, layoutParentpredecessor, else caller; layout prefers _overview_parent. The caller fallback connects internal code and LLM rows and spawn roots.
dag/pipeline.ts rendercaller marks internal nodes; predecessor drives the chain
dag/render/ edges, nodes, agents, labels/badgesRead predecessor to draw edges and detect branches
session/conversations.ts LegacyMessage, BranchRowCarry both keys through

Implementation status

Implemented on both sides. The session data model treats both edges as authoritative.

Last updated · 2026-11-25