Skip to content

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Nov 14, 2025

Soft interrupts allow graceful stream cancellation at block boundaries (tool-result, reasoning-end, etc). First Escape triggers soft interrupt with orange UI feedback and waits for boundary; second Escape forces immediate abort.

Implementation

Frontend state tracking:

  • AIView tracks interrupt state with useState
  • First Escape press → sets flag, calls interruptStream({ soft: true })
  • Second Escape press → calls interruptStream({ soft: false })
  • Flag resets when stream ends via useEffect watching canInterrupt

Backend behavior:

  • interruptStream(workspaceId, { soft?, abandonPartial? })
  • If soft: true: Sets internal flag, cancels at next block boundary
  • If soft: false: Immediate abort via cancelStreamSafely
  • Block boundaries: tool-result, reasoning-end, reasoning-start, tool-call-start

UI feedback:

  • Orange "⏸️ Interrupting..." text when soft interrupt pending
  • Standard blue streaming indicator otherwise
  • Cancel text shows "force" on second press

Testing

  • Integration tests verify soft → hard interrupt progression
  • Manual testing with tool calls and reasoning blocks
  • Verified flag reset on stream completion

Generated with mux

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ethanndickson ethanndickson changed the base branch from main to queued-messages November 14, 2025 02:22
@ethanndickson ethanndickson marked this pull request as draft November 14, 2025 02:57
@ethanndickson ethanndickson force-pushed the soft-interrupts branch 3 times, most recently from 12c5222 to a608663 Compare November 14, 2025 08:29
@ethanndickson ethanndickson changed the base branch from queued-messages to main November 17, 2025 03:47
@ethanndickson ethanndickson marked this pull request as ready for review November 17, 2025 03:52
@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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