mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Record neutral interruption markers for rollout budget stops (#61581)
## Why Turns stopped by an exhausted rollout budget need a history marker without attributing the interruption to the user. ## What changed - Record and flush a `<turn_aborted>` marker before the terminal event for `SessionBudgetExceeded`, respecting the interrupt-message setting. - Use neutral guidance in a `developer` message for automatic budget stops. - Centralize tool-start budget checks across parallel dispatch, tool handlers, and MCP handoff, retaining the check after tool-start observers finish waiting. - Share interruption classification and history recording across turn and compaction paths. ## Testing Extend the rollout-budget integration test to assert that both the budget-crossing turn and a later denied turn persist `developer` interruption markers. GitOrigin-RevId: 2a49ac9824a4e95e4799f2d0f638f8c46889e8e8
This commit is contained in:
@@ -1141,12 +1141,15 @@ fn assistant_msg(text: &str) -> ResponseItem {
|
||||
}
|
||||
|
||||
fn contextual_user_interrupted_marker() -> ResponseItem {
|
||||
interrupted_turn_history_marker(InterruptedTurnHistoryMarker::ContextualUser)
|
||||
.expect("contextual-user interrupted marker should be enabled")
|
||||
interrupted_turn_history_marker(
|
||||
InterruptedTurnHistoryMarker::ContextualUser,
|
||||
/*cause*/ None,
|
||||
)
|
||||
.expect("contextual-user interrupted marker should be enabled")
|
||||
}
|
||||
|
||||
fn developer_interrupted_marker() -> ResponseItem {
|
||||
interrupted_turn_history_marker(InterruptedTurnHistoryMarker::Developer)
|
||||
interrupted_turn_history_marker(InterruptedTurnHistoryMarker::Developer, /*cause*/ None)
|
||||
.expect("developer interrupted marker should be enabled")
|
||||
}
|
||||
|
||||
@@ -3846,7 +3849,7 @@ fn multi_agent_v2_interrupted_marker_uses_developer_input_message() {
|
||||
content: vec![ContentItem::InputText {
|
||||
text: format!(
|
||||
"<turn_aborted>\n{}\n</turn_aborted>",
|
||||
crate::context::TurnAborted::INTERRUPTED_DEVELOPER_GUIDANCE
|
||||
crate::context::TurnAborted::INTERRUPTED_NEUTRAL_GUIDANCE
|
||||
),
|
||||
}],
|
||||
phase: None,
|
||||
|
||||
Reference in New Issue
Block a user