Rename active turn injection helper

This commit is contained in:
pakrym-oai
2026-05-19 10:10:55 -07:00
parent b622b26133
commit b03d728da1
5 changed files with 9 additions and 9 deletions

View File

@@ -365,7 +365,7 @@ impl CodexThread {
if self
.codex
.session
.inject_response_items(vec![pending_item])
.inject_into_active_turn(vec![pending_item])
.await
.is_err()
{

View File

@@ -689,7 +689,7 @@ impl Session {
.await;
if let Some(goal) = goal_for_steering {
let item = goal_context_input_item(objective_updated_prompt(&goal));
if self.inject_response_items(vec![item]).await.is_err() {
if self.inject_into_active_turn(vec![item]).await.is_err() {
tracing::debug!(
"skipping objective-updated goal steering because no turn is active"
);
@@ -1095,7 +1095,7 @@ impl Session {
.await;
if should_steer_budget_limit {
let item = budget_limit_steering_item(&goal);
if self.inject_response_items(vec![item]).await.is_err() {
if self.inject_into_active_turn(vec![item]).await.is_err() {
tracing::debug!("skipping budget-limit goal steering because no turn is active");
}
*self.goal_runtime.budget_limit_reported_goal_id.lock().await = Some(goal_id);

View File

@@ -1860,7 +1860,7 @@ impl Session {
}
if self
.inject_response_items(vec![ResponseInputItem::Message {
.inject_into_active_turn(vec![ResponseInputItem::Message {
role: "developer".to_string(),
content: vec![ContentItem::InputText { text }],
phase: None,
@@ -1957,7 +1957,7 @@ impl Session {
}
if self
.inject_response_items(vec![ResponseInputItem::Message {
.inject_into_active_turn(vec![ResponseInputItem::Message {
role: "developer".to_string(),
content: vec![ContentItem::InputText { text }],
phase: None,
@@ -3200,12 +3200,12 @@ impl Session {
Ok(active_turn_id.clone())
}
/// Returns the input if there was no task running to inject into.
/// Returns the input if there was no active turn to inject into.
#[expect(
clippy::await_holding_invalid_type,
reason = "active turn checks and input queue updates must remain atomic"
)]
pub async fn inject_response_items(
pub async fn inject_into_active_turn(
&self,
input: Vec<ResponseInputItem>,
) -> Result<(), Vec<ResponseInputItem>> {

View File

@@ -375,7 +375,7 @@ async fn persist_user_shell_output(
};
if let Err(items) = session
.inject_response_items(vec![response_input_item])
.inject_into_active_turn(vec![response_input_item])
.await
{
let response_items = items

View File

@@ -145,7 +145,7 @@ impl CodeModeTurnHost for CoreTurnHost {
}
self.exec
.session
.inject_response_items(vec![ResponseInputItem::CustomToolCallOutput {
.inject_into_active_turn(vec![ResponseInputItem::CustomToolCallOutput {
call_id,
name: Some(PUBLIC_TOOL_NAME.to_string()),
output: FunctionCallOutputPayload::from_text(text),