Stopping and resuming
When a quest fails or you interrupt it, its work stays, and pandra quest resume carries the quest on from where it stopped. A step can also stop the quest to ask you, and the quest goes on once you answer.
When a quest stops
A step or check that fails ends the quest with its error and exit code, such as when its harness fails the turn or its checks still ask for changes after the last send-back. Ctrl-C interrupts every run of the quest. The work stays, and when the quest has a session or a workspace it created, the last line on stderr says where, with the command that carries the quest on:
error: the checks of step implement did not approve: security
security asked for:
P1 src/list.rs:42 prints the table even with --json
The work stays in /home/me/app, and `pandra quest resume 11c048d99b39` carries the quest on from where it stopped; `pandra guild ps -a` lists its sessions as change 11c048d99b39.A quest in the current directory that fails before any member's session starts, such as at a command step's script, has no such line. pandra quest list -a shows its ID, and pandra quest resume takes it as for any other quest.
Resume a quest
pandra quest resume carries a failed or interrupted quest on from where it stopped, under its ID. Run it where Pandra finds the same guild file the quest was carried out from (where Pandra finds the guild file):
pandra quest resume 11c048d99b39Here the implement step of the change quest has max-retries = 0, so the quest failed when security asked for changes. The resume sends the step back with the check's findings, and the quest goes on. The digests are shortened here:
change: 2 steps, 2 checks (pandra-guild.toml, no profile)
implementer claude-code agents/implementer
reviewer claude-code ghcr.io/acme/reviewer:1.2.0@sha256:f4fa007adf9e...
security-reviewer claude-code agents/security-reviewer
release-notes claude-code github.com/acme/agents//release-notes@2361c0c3c457...
[implement] attempt 2 continues here
[implement] sent back (from before the resume, not counted)
[implement] Session: 5a6808f0b750 (implementer)
[implement] Skills not loaded: pandra
[implement / security] Session: 12df2ffeae42 (security-reviewer)
[implement / security] Skills not loaded: pandra
[implement / security] approved
[release-note] Session: 41a6be346689 (release-notes)
[release-note] Skills not loaded: pandra- The steps that finished are not carried out again, and their outputs stand in the later prompts. A check that gave its verdict on the step's latest answer keeps it.
- A member's turn that was cut short continues in its session. A script that did not end runs again from the start, so what it changes outside the workspace, such as a push, happens again.
- The quest keeps its request, its workspace, and its profile, so
quest resumetakes no workspace option and no--profile. It checks the members and asks for the approvals they lack, asquest rundoes. - Pandra never resumes a quest on its own: a quest whose process died, such as at a restart, stays
interrupteduntil you runquest resume.
With --prompt, quest resume adds your text to the quest's request, so a later step whose prompt names ${{ quest.prompt }} reads it, and a turn that continues gets it as its message. On a completed quest, --prompt carries the quest out again from its first step:
pandra quest resume 9ebe48954864 --prompt "Sort the items by name."A resume fails, and leaves the quest as it was, when:
- the quest is running;
- the quest completed, and you gave no
--prompt; - the quest changed since it started, such as its quest file or a schema file it names: carry it out again with
quest run; - its workspace is gone.
Ask the user
A member's step with output-schema can stop the quest to ask you, with ask-user, a list of cases that compare its output as the cases of next do. Here a planner stops the plan quest when only you can settle a choice:
[[steps]]
name = "plan"
member = "planner"
output-schema = "schemas/report.json"
prompt = """
Plan the change below. When only the user can settle a choice, set status to "questions" and ask in text.
${{ quest.prompt }}
"""
ask-user = [{ when = { output.status = "questions" } }]
[[steps]]
name = "implement"
member = "implementer"schemas/report.json asks for an object with the strings status and text. When the planner asks, the quest prints its answer on stdout and the command that answers it on stderr:
[plan] Session: 33c53ab2ad27 (planner)
[plan] Skills not loaded: pandra
[plan] asks the user
{"status":"questions","text":"Should --json keep the table's column order?"}
The quest waits for the user: `pandra quest resume 9ebe48954864 --prompt TEXT` answers step plan.To answer, run that command with your answer:
pandra quest resume 9ebe48954864 --prompt "Keep the column order."The planner's session continues with your text, and the quest goes on. Your text is also added to the quest's request, for later steps. The answer's turn does not count toward max-retries. A quest that waits for you is not running, so quest remove removes it without --force, and pandra session prune keeps it.