-
Notifications
You must be signed in to change notification settings - Fork 9k
fix: prevent repeating interrupted turns #9043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
etraut-openai
merged 32 commits into
openai:main
from
swordfish444:fix/interrupt-aborted-turn-marker
Jan 20, 2026
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
2b8befd
fix: prevent repeating interrupted turns
swordfish444 80434a3
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 07b15fe
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 8745d8c
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 03761d1
core: refine interrupted-turn marker
swordfish444 de8719c
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 a1f39d3
core: document abort test expectations
swordfish444 bb44a06
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 04730ea
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 2cc4233
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 4e1b1cb
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 344f408
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 3920f4a
Merge branch 'main' into fix/interrupt-aborted-turn-marker
jif-oai 111de08
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 2e6deb5
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 445691a
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 850a4f4
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 b728a8c
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 2c52858
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 06f9a52
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 75816d8
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 c775d57
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 b246b5c
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 d6b1a98
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 67257da
Merge branch 'main' into fix/interrupt-aborted-turn-marker
etraut-openai e758326
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 e8fb3f2
core: include text_elements in abort task tests
swordfish444 377583c
core: keep <turn_aborted> during compaction
swordfish444 80f526f
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 4f2b27b
Merge upstream/main
swordfish444 b80ac16
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 6a15428
Merge branch 'main' into fix/interrupt-aborted-turn-marker
swordfish444 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /// Helpers for identifying model-visible "session prefix" messages. | ||
| /// | ||
| /// A session prefix is a user-role message that carries configuration or state needed by | ||
| /// follow-up turns (e.g. `<environment_context>`, `<turn_aborted>`). These items are persisted in | ||
| /// history so the model can see them, but they are not user intent and must not create user-turn | ||
| /// boundaries. | ||
| pub(crate) const ENVIRONMENT_CONTEXT_OPEN_TAG: &str = "<environment_context>"; | ||
| pub(crate) const TURN_ABORTED_OPEN_TAG: &str = "<turn_aborted>"; | ||
|
|
||
| /// Returns true if `text` starts with a session prefix marker (case-insensitive). | ||
| pub(crate) fn is_session_prefix(text: &str) -> bool { | ||
| let trimmed = text.trim_start(); | ||
| let lowered = trimmed.to_ascii_lowercase(); | ||
| lowered.starts_with(ENVIRONMENT_CONTEXT_OPEN_TAG) || lowered.starts_with(TURN_ABORTED_OPEN_TAG) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.