Skip to content

feat: resume <id> "<prompt>" continues a settled session with new instructions - #65

Merged
ajianaz merged 3 commits into
developfrom
feat/resume-prompt
Sep 12, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/resume-prompt

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

What (description of the change)

tole resume <id> "<prompt>" gains an optional PROMPT argument: on a session parked at a turn boundary, it appends the prompt as a new user message and drives one full turn via run_turn. Without PROMPT, resume keeps its existing approvals-only recovery semantics. Mid-flight sessions keep the durable precondition error (bare resume first — that protocol is unchanged).

Why (the problem you're solving)

Issue #55 (revised scope after validation): headless multi-mission flows needed a separate run session per mission, losing conversational context. The issue's other half ("chat REPL never exits on piped input") was REFUTED by live repro on 2026-09-12 — piped chat --resume processes queued messages and exits cleanly at EOF — so this PR intentionally covers only the resume-with-prompt gap.

Testing (how you verified this works)

  • fmt, clippy -D warnings, full workspace tests green (152 tests); CodeCora pre-push scan: no issues.
  • Live E2E with the fresh release binary: turn 1 planted codeword MANGO-9; resume <id> "What was the codeword?" in a separate invocation returned exactly MANGO-9 — proving the prompt lands in the SAME durable session with full history.
  • Recovery protocol re-proven live: a 429 parks a session mid-flight (pc Planning); resume-with-prompt correctly refuses it; bare resume completes the pending turn; the next resume-with-prompt works.
  • Edge: whitespace-only prompts fall through to approvals-only resume instead of committing an empty user message.

Closes #55

Formalize the nohup-background + poll pattern agents improvise for
CPU-bound jobs exceeding the 30s run_command ceiling (issue #59):

- job_start (Write): argv-split like run_command (no shell; bash -c is
  the explicit shell escape), detached into its own process group,
  stdin null, stdout+stderr -> tole-jobs/<id>/log inside the file-tools
  workspace. Returns job id + pid immediately.
- job_poll (ReadOnly): liveness via 'ps -p <pid> -o stat=' treating
  zombie state (Z*) as finished, plus a bounded 8KiB-window tail of the
  log (stat -> seek -> read; lossy UTF-8 at the boundary). The full log
  stays reachable via read_file through the same jail.

Depends on the --workspace jail (#57, merged): logs live under the
file_root so read_file can reach them without workarounds.

Closes #59, closes #56 (option b: native shell job control)
…tructions

Issue #55 (revised scope): resume previously took no prompt at all, so
headless multi-mission flows needed a separate run session per mission
and lost conversational context. An optional PROMPT argument now
appends a new user message at a turn boundary via run_turn; without it,
resume keeps the approvals-only recovery behavior. Mid-flight sessions
keep refusing run_turn (durable state-machine precondition) - the
recovery protocol stays: bare resume first, then resume-with-prompt.
Note: the chat-REPL half of the original issue was refuted by live
repro on 2026-09-12 (piped chat exits cleanly at EOF).

Closes #55
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit dac94f1 into develop Sep 12, 2026
13 checks passed
@ajianaz
ajianaz deleted the feat/resume-prompt branch September 12, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Headless automation: resume cannot take a new prompt; chat REPL never exits on piped input

1 participant