feat(pi): add session resume shorthand (#113)

This commit is contained in:
banteg
2026-01-13 05:42:17 +04:00
committed by GitHub
parent c1205cd5a8
commit d4aad8e068
6 changed files with 198 additions and 18 deletions
+4 -2
View File
@@ -31,13 +31,15 @@ Provide the **`pi`** engine backend so Takopi can:
Takopi appends a **single backticked** resume line at the end of the message, like:
```text
`pi --session /home/user/.pi/agent/sessions/--repo--/2026-01-02T12-34-56-789Z_abcd.jsonl`
`pi --session ccd569e0`
```
Notes:
* `pi --resume/-r` opens an interactive session picker, so Takopi uses `--session <path>` instead.
* The resume token is the **session file path** (JSONL), treated as an opaque string.
* The resume token is the **session id** (short prefix), derived from the first JSON
object in the session file. If the id cannot be read, Takopi falls back to the
session file path.
* If the path contains spaces, the runner will quote it.
### Non-interactive runs
+3 -2
View File
@@ -30,10 +30,11 @@ Notes:
- Canonical resume line (embedded in chat):
```
`pi --session <path>`
`pi --session <id>`
```
The token is the **session JSONL file path**.
The token is the **short session id**, derived from the first JSON object in the
session file. If the id cannot be read, Takopi falls back to the session file path.
Why not `--resume`?
- `--resume/-r` opens an interactive session picker; it does not accept a