Skip to content

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Nov 27, 2025

Adds a soft: boolean option to interruptStream() that sets a pending flag instead of immediately aborting. The stream manager checks this flag at content boundaries (end of text blocks, tool results, reasoning sections) and gracefully terminates at the next one.

This lays the groundwork for automatic context management—when the agent approaches the context window limit, we can issue a soft interrupt to let the current thought complete cleanly before triggering compaction. This avoids cutting off mid-sentence or mid-tool-call, producing cleaner conversation history for the compaction summary.

The frontend currently always uses hard interrupts; the soft interrupt path is exercised only by tests for now. A following PR will use this code.

I have an integration test to add back once the sendMessage integration test suite is restored.....


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
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".

@ethanndickson ethanndickson force-pushed the soft-interrupts-backend branch 3 times, most recently from aa5e615 to bbba562 Compare November 27, 2025 23:57
fix: restore null safety in useAIViewKeybinds call

fix: preserve abandonPartial flag through soft interrupt path

Changed softInterruptPending from boolean to union type that carries
the abandonPartial option through to cleanupStream when the soft
interrupt fires at a block boundary.
@ethanndickson ethanndickson force-pushed the soft-interrupts-backend branch from bbba562 to 114c741 Compare November 28, 2025 00:35
Comment on lines 888 to 892
if (options?.abandonPartial) {
log.debug("Abandoning partial for workspace:", workspaceId);
await this.partialService.deletePartial(workspaceId);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

This is already done in session.interruptStream

@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".

@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".

@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".

@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".

@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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 added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit b437977 Nov 28, 2025
18 of 19 checks passed
@ethanndickson ethanndickson deleted the soft-interrupts-backend branch November 28, 2025 02:07
ethanndickson added a commit that referenced this pull request Nov 28, 2025
Reverts:
- 470e4eb perf: fix streaming content delay from ORPC schema validation (#774)
- b437977 feat: add backend support for soft-interrupts (#767)
- df30cbc fix: use ResultSchema for sendMessage output to prevent field stripping (#773)
- 41c77ef fix: testUtils formatting (#771)
- 3ee7288 refactor: migrate IPC layer to ORPC for type-safe RPC (#763)
github-merge-queue bot pushed a commit that referenced this pull request Nov 28, 2025
Reverts:
- 470e4eb perf: fix streaming content delay from ORPC schema validation
(#774)
- b437977 feat: add backend support for soft-interrupts (#767)
- df30cbc fix: use ResultSchema for sendMessage output to prevent field
stripping (#773)
- 41c77ef fix: testUtils formatting (#771)
- 3ee7288 refactor: migrate IPC layer to ORPC for type-safe RPC (#763)

Due to a huge number of regressions.

_Generated with `mux`_
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