Spaces:
Running
Running
Sync Space session state naming
Browse filesFiles changed (3)
64 unmodified lines6566676869707161 unmodified lines13313413513613713813964 unmodified linesmanaged run directory under `RH_SPACE_RUNS_DIR`.- The runtime layout is always:`run_.../agent_workspace/` for agent-visible files and`run_.../agent_trace/` for traces and `_session_state.json`.- Uploaded images are saved under `agent_workspace/inputs/images/` and are alsopassed to the model as image inputs when supported.- Users can download files created or handled by the agent with the61 unmodified linesβββ run_YYYYMMDD_HHMMSS_<random>/βββ agent_workspace/β βββ inputs/images/ # user uploaded images, when presentβββ agent_trace/ # trace JSONL and _session_state.json```The frontend exposes the chat UI and a single `Download workspace.zip` action64 unmodified lines6566676869707161 unmodified lines13313413513613713813964 unmodified linesmanaged run directory under `RH_SPACE_RUNS_DIR`.- The runtime layout is always:`run_.../agent_workspace/` for agent-visible files and`run_.../agent_trace/` for traces and `session_state_*.json`.- Uploaded images are saved under `agent_workspace/inputs/images/` and are alsopassed to the model as image inputs when supported.- Users can download files created or handled by the agent with the61 unmodified linesβββ run_YYYYMMDD_HHMMSS_<random>/βββ agent_workspace/β βββ inputs/images/ # user uploaded images, when presentβββ agent_trace/ # trace JSONL and session_state_*.json```The frontend exposes the chat UI and a single `Download workspace.zip` action
912 unmodified lines913914915916917918919912 unmodified lineson_event=event_callback,)self.trace_path = trace_writer.pathself.session_state_path = resolve_session_state_path(trace_dir) if trace_dir else Nonesession_state = AgentSessionState(run_id=trace_writer.run_id,model_name=self.model,912 unmodified lines913914915916917918919912 unmodified lineson_event=event_callback,)self.trace_path = trace_writer.pathself.session_state_path = resolve_session_state_path(self.trace_path) if self.trace_path else Nonesession_state = AgentSessionState(run_id=trace_writer.run_id,model_name=self.model,
8 unmodified lines910111213141558 unmodified lines74757677787980818 unmodified linesfrom agent_base.utils import safe_jsonableSESSION_STATE_FILENAME = "_session_state.json"@dataclass58 unmodified lines}def resolve_session_state_path(trace_dir: str | Path) -> Path:return Path(trace_dir) / SESSION_STATE_FILENAMEdef persist_session_state(path: str | Path, state: AgentSessionState) -> None:8 unmodified lines910111213141558 unmodified lines74757677787980818283848 unmodified linesfrom agent_base.utils import safe_jsonableSESSION_STATE_PREFIX = "session_state"@dataclass58 unmodified lines}def resolve_session_state_path(trace_path: str | Path) -> Path:trace = Path(trace_path)stem = trace.stemsuffix = stem[len("trace_") :] if stem.startswith("trace_") else stemreturn trace.with_name(f"{SESSION_STATE_PREFIX}_{suffix}.json")def persist_session_state(path: str | Path, state: AgentSessionState) -> None:
README.md+2-2
agent_base/react_agent.py+1-1
agent_base/session_state.py+6-3