Skip to content

feat(harness): soft interrupt — inject owner message into a running session without cancelling it #377

Closed

Description

@ajianaz

Goal

Allow the owner to steer a running session mid-turn WITHOUT cancelling it — no partial work lost. This complements the existing 3-face cancel (#184/#185). Adopted from jcode's soft-interrupt design (tier A).

Acceptance criteria

  • New injection channel: an injected message lands in a queue; the harness drains it at the safe point — after all tools of the current turn finish, before the next provider call.
  • urgent mode may skip the remaining tools, but MUST write stub tool_result entries first (API constraint: every tool_use must be immediately followed by a tool_result).
  • No tool call is dropped silently: every interrupted tool either completes or leaves a valid tool_result stub.
  • The injected message is visible in the resumed transcript, clearly attributed as an interrupt injection (not as a provider turn).
  • Works for both interactive sessions and serve/MCP-driven sessions.
  • Docs (harness docs) + CHANGELOG entry.

Testing

  • Unit tests: queue drain at safe point; urgent-mode stub insertion; attribution in persisted history.
  • Integration test: start a long multi-tool turn, inject normal + urgent, assert no orphan tool_use without tool_result on the wire and the transcript shows the injection.
  • Live E2E (fleet standard): run a real session, inject from a second client, verify steering takes effect at the safe point.

Reference

jcode (MIT, https://github.com/1jehuang/jcode) — design adopted; implementation is our own.

Activity

  1. added
    enhancement
    harness
    on Oct 16, 2026
  2. ajianaz commented on Nov 3, 2026

    @ajianaz
    ContributorAuthor

    Verified SHIPPED against develop @ 3ec70f4: the feature exists in code (CHANGELOG entries + module/endpoint present — soft-interrupt queue in cancel.rs + POST /sessions/{id}/interrupt + MCP tool for #377, doctor-ledger.json for #378, per-turn usage_report for #379, sibling_watch for #380, tole_core::handoff + verify gate for #383). The acceptance checkboxes were never ticked even though the work shipped (known board-sync defect class). Closing with this evidence comment. Remaining gaps, if any, are tracked by follow-up issues instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementharness

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions