Skip to content

feat: add atomic interrupt-and-deliver - #388

Open
VishnuM049 wants to merge 2 commits into
mainfrom
fix/interrupt-and-deliver-28
Open

feat: add atomic interrupt-and-deliver#388
VishnuM049 wants to merge 2 commits into
mainfrom
fix/interrupt-and-deliver-28

Conversation

@VishnuM049

Copy link
Copy Markdown
Contributor

Purpose

Make interruption reliable and add an atomic way to stop current work and deliver a replacement prompt. This also fixes the TUI race where Escape could be accepted before the daemon installed operation ownership.

Fixes

Fixes #28
Fixes #387

Approach

  • Add the typed session.interruptAndDeliver RPC and session.interrupt_deliver capability in wire version 12.
  • Record queued, interrupting, delivered, and failed delivery states in canonical history.
  • Reserve interrupt delivery in the daemon, target active or admitted operations by ID, wait for a safe terminal boundary, and deliver replacement content exactly once.
  • Reconcile interrupted deliveries after restart and preserve blob references through export and event migration.
  • Remove TUI interrupt polling, report an idle or failed interrupt, and add Ctrl+Enter for interrupt-and-deliver.
  • Correct the stale steer and follow-up capability names in the web protocol documentation.

How was this tested?

  • pnpm build: passed.
  • pnpm format:check: passed.
  • pnpm lint: passed.
  • pnpm typecheck: passed.
  • pnpm check:boundaries: passed.
  • pnpm check:generated: passed.
  • pnpm --filter @axl/protocol test: passed, 31 tests.
  • pnpm --filter @axl/sdk test: passed, 29 tests.
  • pnpm --filter @axl/daemon test: passed, 63 tests over real Unix-socket client and daemon sessions.
  • Focused TUI interrupt and editor tests: passed.
  • The admitted-operation interrupt test passed 20 consecutive runs.
  • reuse lint: passed, 322 files compliant.
  • pnpm audit --audit-level high: passed with no known vulnerabilities.
  • A full pnpm test run was attempted. Two existing OCI tests require Linux /proc/self/mountinfo and failed on macOS. Two existing timing-sensitive TUI tests failed in the aggregate run and passed when rerun individually.

Learning

Interrupt intent must bind to an operation during request admission. Client polling cannot safely close the gap between optimistic UI state and daemon ownership.

Checklist

  • I reviewed the complete diff.
  • I added or updated the smallest relevant test for behavior changes.
  • I ran the relevant formatting, lint, type-check, test, boundary, and license checks.
  • Every new file has SPDX metadata, directly or through REUSE.toml.
  • Every commit has a matching DCO Signed-off-by trailer.
  • UI changes include screenshots attached to the pull request, not committed to the repository. No visual layout changed; the new keyboard behavior is covered by tests.

AI assistance

  • Generative AI materially assisted this change. Tool and model/version: OpenAI through pi; the harness did not expose an exact model version.
  • I manually reviewed, understood, and tested the generated work.

Signed-off-by: VishnuM049 <vishnu.muthiah04@gmail.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Signed-off-by: VishnuM049 <vishnu.muthiah04@gmail.com>
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.

[Bug] Esc can silently fail to interrupt: the TUI discards session.interrupt's result Complete daemon-owned interrupt-and-deliver semantics

1 participant