Skip to content

Commit 82c3eca

Browse files
aibrahim-oaicodex
andcommitted
Use protocol truncation alias in core tests
Co-authored-by: Codex <noreply@openai.com>
1 parent 207778e commit 82c3eca

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

codex-rs/core/src/context_manager/history_tests.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#![allow(clippy::all)]
2-
#![allow(dead_code)]
3-
#![allow(unused)]
4-
51
use super::*;
2+
use crate::truncate;
3+
use crate::truncate::TruncationPolicy;
64
use base64::Engine;
75
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
86
use codex_git_utils::GhostCommit;
@@ -20,8 +18,6 @@ use codex_protocol::models::ReasoningItemContent;
2018
use codex_protocol::models::ReasoningItemReasoningSummary;
2119
use codex_protocol::openai_models::InputModality;
2220
use codex_protocol::openai_models::default_input_modalities;
23-
use codex_protocol::output_truncation::TruncationPolicy;
24-
use codex_protocol::output_truncation::truncate_text;
2521
use codex_protocol::protocol::InterAgentCommunication;
2622
use image::ImageBuffer;
2723
use image::ImageFormat;
@@ -127,7 +123,7 @@ fn reasoning_with_encrypted_content(len: usize) -> ResponseItem {
127123
}
128124

129125
fn truncate_exec_output(content: &str) -> String {
130-
truncate_text(content, TruncationPolicy::Tokens(EXEC_FORMAT_MAX_TOKENS))
126+
truncate::truncate_text(content, TruncationPolicy::Tokens(EXEC_FORMAT_MAX_TOKENS))
131127
}
132128

133129
fn approx_token_count_for_text(text: &str) -> i64 {

codex-rs/core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ pub use codex_login::token_data;
8080
mod unified_exec;
8181
pub mod windows_sandbox;
8282
pub use client::X_RESPONSESAPI_INCLUDE_TIMING_METRICS_HEADER;
83+
#[cfg(test)]
84+
pub(crate) use codex_protocol::output_truncation as truncate;
8385
pub use model_provider_info::DEFAULT_LMSTUDIO_PORT;
8486
pub use model_provider_info::DEFAULT_OLLAMA_PORT;
8587
pub use model_provider_info::LMSTUDIO_OSS_PROVIDER_ID;

0 commit comments

Comments
 (0)