MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / load

Method load

src/agent/session.py:82–99  ·  view source on GitHub ↗

Load session from disk.

(cls, session_id: str)

Source from the content-addressed store, hash-verified

80
81 @classmethod
82 def load(cls, session_id: str) -> Optional['Session']:
83 """Load session from disk."""
84 session_file = Path.home() / ".clawcodex" / "sessions" / f"{session_id}.json"
85
86 if not session_file.exists():
87 return None
88
89 with open(session_file, 'r') as f:
90 data = json.load(f)
91
92 return cls(
93 session_id=data["session_id"],
94 provider=data["provider"],
95 model=data["model"],
96 conversation=Conversation.from_dict(data["conversation"]),
97 created_at=data["created_at"],
98 updated_at=data["updated_at"]
99 )
100
101 @classmethod
102 def create(cls, provider: str, model: str) -> 'Session':

Callers 15

useInputHistoryFunction · 0.45
mainFunction · 0.45
_read_jsonFunction · 0.45
_read_jsonFunction · 0.45
_read_settings_envFunction · 0.45
_load_settings_fileFunction · 0.45
maybe_resize_imageFunction · 0.45
resumeMethod · 0.45
test_persists_ruleMethod · 0.45
test_no_duplicatesMethod · 0.45
test_manifest_writtenMethod · 0.45

Calls 1

from_dictMethod · 0.45

Tested by 7

test_persists_ruleMethod · 0.36
test_no_duplicatesMethod · 0.36
test_manifest_writtenMethod · 0.36
_readMethod · 0.36