Skip to content

Commit 8af97ce

Browse files
Revert "Pass more params to compaction" (openai#14298)
1 parent 2cfa106 commit 8af97ce

File tree

5 files changed

+5
-88
lines changed

5 files changed

+5
-88
lines changed

codex-rs/codex-api/src/common.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ pub struct CompactionInput<'a> {
2121
pub model: &'a str,
2222
pub input: &'a [ResponseItem],
2323
pub instructions: &'a str,
24-
pub tools: Vec<Value>,
25-
pub parallel_tool_calls: bool,
26-
#[serde(skip_serializing_if = "Option::is_none")]
27-
pub reasoning: Option<Reasoning>,
28-
#[serde(skip_serializing_if = "Option::is_none")]
29-
pub text: Option<TextControls>,
3024
}
3125

3226
/// Canonical input payload for the memory summarize endpoint.

codex-rs/core/src/client.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ impl ModelClient {
281281
&self,
282282
prompt: &Prompt,
283283
model_info: &ModelInfo,
284-
effort: Option<ReasoningEffortConfig>,
285-
summary: ReasoningSummaryConfig,
286284
session_telemetry: &SessionTelemetry,
287285
) -> Result<Vec<ResponseItem>> {
288286
if prompt.input.is_empty() {
@@ -296,29 +294,10 @@ impl ModelClient {
296294
.with_telemetry(Some(request_telemetry));
297295

298296
let instructions = prompt.base_instructions.text.clone();
299-
let input = prompt.get_formatted_input();
300-
let tools = create_tools_json_for_responses_api(&prompt.tools)?;
301-
let reasoning = Self::build_reasoning(model_info, effort, summary);
302-
let verbosity = if model_info.support_verbosity {
303-
self.state.model_verbosity.or(model_info.default_verbosity)
304-
} else {
305-
if self.state.model_verbosity.is_some() {
306-
warn!(
307-
"model_verbosity is set but ignored as the model does not support verbosity: {}",
308-
model_info.slug
309-
);
310-
}
311-
None
312-
};
313-
let text = create_text_param_for_request(verbosity, &prompt.output_schema);
314297
let payload = ApiCompactionInput {
315298
model: &model_info.slug,
316-
input: &input,
299+
input: &prompt.input,
317300
instructions: &instructions,
318-
tools,
319-
parallel_tool_calls: prompt.parallel_tool_calls,
320-
reasoning,
321-
text,
322301
};
323302

324303
let mut extra_headers = self.build_subagent_headers();
@@ -396,25 +375,6 @@ impl ModelClient {
396375
request_telemetry
397376
}
398377

399-
fn build_reasoning(
400-
model_info: &ModelInfo,
401-
effort: Option<ReasoningEffortConfig>,
402-
summary: ReasoningSummaryConfig,
403-
) -> Option<Reasoning> {
404-
if model_info.supports_reasoning_summaries {
405-
Some(Reasoning {
406-
effort: effort.or(model_info.default_reasoning_level),
407-
summary: if summary == ReasoningSummaryConfig::None {
408-
None
409-
} else {
410-
Some(summary)
411-
},
412-
})
413-
} else {
414-
None
415-
}
416-
}
417-
418378
/// Returns whether the Responses-over-WebSocket transport is active for this session.
419379
///
420380
/// This combines provider capability and feature gating; both must be true for websocket paths

codex-rs/core/src/codex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6229,7 +6229,7 @@ async fn run_sampling_request(
62296229
}
62306230
}
62316231

6232-
pub(crate) async fn built_tools(
6232+
async fn built_tools(
62336233
sess: &Session,
62346234
turn_context: &TurnContext,
62356235
input: &[ResponseItem],

codex-rs/core/src/compact_remote.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
use std::collections::HashSet;
21
use std::sync::Arc;
32

43
use crate::Prompt;
54
use crate::codex::Session;
65
use crate::codex::TurnContext;
7-
use crate::codex::built_tools;
86
use crate::compact::InitialContextInjection;
97
use crate::compact::insert_initial_context_before_last_real_user_or_summary;
108
use crate::context_manager::ContextManager;
@@ -21,7 +19,6 @@ use codex_protocol::items::TurnItem;
2119
use codex_protocol::models::BaseInstructions;
2220
use codex_protocol::models::ResponseItem;
2321
use futures::TryFutureExt;
24-
use tokio_util::sync::CancellationToken;
2522
use tracing::error;
2623
use tracing::info;
2724

@@ -95,20 +92,10 @@ async fn run_remote_compact_task_inner_impl(
9592
.cloned()
9693
.collect();
9794

98-
let prompt_input = history.for_prompt(&turn_context.model_info.input_modalities);
99-
let tool_router = built_tools(
100-
sess.as_ref(),
101-
turn_context.as_ref(),
102-
&prompt_input,
103-
&HashSet::new(),
104-
None,
105-
&CancellationToken::new(),
106-
)
107-
.await?;
10895
let prompt = Prompt {
109-
input: prompt_input,
110-
tools: tool_router.specs(),
111-
parallel_tool_calls: turn_context.model_info.supports_parallel_tool_calls,
96+
input: history.for_prompt(&turn_context.model_info.input_modalities),
97+
tools: vec![],
98+
parallel_tool_calls: false,
11299
base_instructions,
113100
personality: turn_context.personality,
114101
output_schema: None,
@@ -120,8 +107,6 @@ async fn run_remote_compact_task_inner_impl(
120107
.compact_conversation_history(
121108
&prompt,
122109
&turn_context.model_info,
123-
turn_context.reasoning_effort,
124-
turn_context.reasoning_summary,
125110
&turn_context.session_telemetry,
126111
)
127112
.or_else(|err| async {

codex-rs/core/tests/suite/compact_remote.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -271,28 +271,6 @@ async fn remote_compact_replaces_history_for_followups() -> Result<()> {
271271
compact_body.get("model").and_then(|v| v.as_str()),
272272
Some(harness.test().session_configured.model.as_str())
273273
);
274-
let response_requests = responses_mock.requests();
275-
let first_response_request = response_requests.first().expect("initial request missing");
276-
assert_eq!(
277-
compact_body["tools"],
278-
first_response_request.body_json()["tools"],
279-
"compact requests should send the same tools payload as /v1/responses"
280-
);
281-
assert_eq!(
282-
compact_body["parallel_tool_calls"],
283-
first_response_request.body_json()["parallel_tool_calls"],
284-
"compact requests should match /v1/responses parallel_tool_calls"
285-
);
286-
assert_eq!(
287-
compact_body["reasoning"],
288-
first_response_request.body_json()["reasoning"],
289-
"compact requests should match /v1/responses reasoning"
290-
);
291-
assert_eq!(
292-
compact_body["text"],
293-
first_response_request.body_json()["text"],
294-
"compact requests should match /v1/responses text controls"
295-
);
296274
let compact_body_text = compact_body.to_string();
297275
assert!(
298276
compact_body_text.contains("hello remote compact"),

0 commit comments

Comments
 (0)