Skip to content

Session and Memory Formats

This page documents file formats generated by runtime persistence modules.

Session

Path:

  • workspace/sessions/session-<YYYYMMDD-HHMMSS>.md

Header template:

md
# OpenPocket Session

- id: <YYYYMMDD-HHMMSS>
- started_at: <ISO8601>
- model_profile: <profile_key>
- model_name: <model_name>

## Task

<task text>

## Steps

Per-step block template:

md
### Step N

- at: <ISO8601>
- thought:
```text
<thought or (empty)>
```
- action:
```json
<action json>
```
- execution_result:
```text
<result text>
```

Final block template:

md
## Final

- status: SUCCESS|FAILED
- ended_at: <ISO8601>

### Message

<final message>

Daily Memory

Path:

  • workspace/memory/YYYY-MM-DD.md

Created on first write with:

md
# Memory YYYY-MM-DD

Append format:

text
- [HH:MM:SS] [OK|FAIL] [<modelProfile>] task: <task> | result: <compact_message>

compact_message is whitespace-normalized and truncated to 400 chars.

Screenshot Format

Saved file path format:

text
<screenshots.directory>/<YYYYMMDD-HHMMSS>-session-<sessionId>-step-<NNN>-<safeCurrentApp>.png

Notes:

  • safeCurrentApp keeps only [a-zA-Z0-9._-], others become _
  • screenshot store enforces retention by deleting oldest PNG files beyond maxCount

Script Artifact

Path per run:

text
workspace/scripts/runs/run-<runId>/

Files:

  • script.sh
  • stdout.log
  • stderr.log
  • result.json

result.json shape:

json
{
  "ok": true,
  "runId": "20260218-130000-ab12cd",
  "runDir": "...",
  "scriptPath": ".../script.sh",
  "exitCode": 0,
  "timedOut": false,
  "durationMs": 432,
  "stdout": "...",
  "stderr": "..."
}