Skip to content

feat(cli): soft interrupt entry points — serve and MCP (#377, 2/2) - #393

Merged
ajianaz merged 6 commits into
developfrom
feat/soft-interrupt-hosts
Oct 16, 2026
Merged

ajianaz merged 6 commits into
developfrom
feat/soft-interrupt-hosts

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Part 2 of 2 of soft interrupts: the host entry points. Builds on the core merged in #391.

Why

#377. The owner needs a second client that can steer a running serve/MCP-driven session without cancelling it.

Changes

  • session_host.rs: interrupt_session shared by both faces. It refuses with NotBusy when no turn is running (a stale message must not wait around and hijack the next, unrelated turn) and maps the queue's bounds (blank, oversized, 16 pending) to Invalid.
  • serve.rs: POST /sessions/{id}/interrupt with {text, urgent?} — 202 queued, 404 unknown session, 409 no turn running, 400 bad JSON / missing, blank or oversized text.
  • session_tools.rs: tole_session_interrupt MCP tool (same ReadOnly classification as tole_session_cancel; the steered turn's tools still pass the session approver, so no new authority).
  • README, docs/mobile-control.md, docs/threat-model.md, CHANGELOG.
  • Interactive chat has no second client on stdin, so it is not wired; ACP has no interrupt method either. Both are out of scope here.

Testing

  • Real tole serve binary against a scripted OpenAI-compatible server: a prompt whose first provider call takes ~2 s is interrupted at 500 ms (202); the stale answer is superseded, the next provider call carries the attributed interrupt, and the prompt returns the steered answer. Also covers 404 / 409 / 400 refusals.
  • MCP tool test: unknown id, idle refusal, missing and blank text, queued on the session's own handle while busy.
  • fmt, clippy -D warnings, cargo test --workspace pass; cora review --staged clean.
  • Not done: a live run with a real provider and a second real client; feat(harness): soft interrupt — inject owner message into a running session without cancelling it #377 stays open for that.

Refs #377

@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 fd74e31 into develop Oct 16, 2026
17 checks passed
@ajianaz
ajianaz deleted the feat/soft-interrupt-hosts branch October 16, 2026 04:57
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.

1 participant