mirror of
https://github.com/openai/codex.git
synced 2026-09-20 12:47:38 +00:00
Rename active turn injection helper
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>> {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user