Design: adapter stop() method and interrupt vs cancel semantics #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When a user cancels an agent run in Paperclip, the running adapter needs to stop its work. For local adapters (Claude Code, Codex) that spawn child processes, Paperclip uses signalRunningProcess() with SIGTERM/SIGKILL. For K8s-based adapters (paperclip-adapter-claude-k8s, paperclip-adapter-opencode-k8s), the work runs as Kubernetes Jobs outside the Node.js process.
Additionally, "Interrupt" is like Claude Code's Escape key - it injects context into the LLM's thinking rather than stopping work. This is not the same as cancel/stop.
Current Understanding
Methods on ServerAdapterModule
stop(runId: string): Promise - REQUIRED on all adapters
supportsInterrupt?: boolean - OPTIONAL capability flag
Interrupt vs Cancel
Open Questions
Related
Next Steps