All tagsThreadManager 持有 Arc<ThreadManagerState> 統管所有 thread,spawn_thread() 統一處理新建/恢復/分叉/子代理四種啟動路徑;ForkSnapshot 定義 TruncateBeforeNthUserMessage/Interrupted 兩種語義;AgentControl 透過 Weak<ThreadManagerState> 避免循環引用;agent_graph_store 追蹤 ThreadSpawnEdgeStatus::Open/Closed。
omp stores sessions as append-only JSONL with id/parentId forming a tree; a mutable leaf pointer selects the active path. /tree uses TreeSelectorComponent for navigation; navigateTree() switches leaf with optional branch summary, handles checkpoint/rewind, supports Claude/Codex foreign session import. Fork duplicates the session file inheriting providerPromptCacheKey. Resume/switchSession uses captureState/rollback for atomic transitions. Three-layer storage (indexed/history/artifact) separates concerns.