Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix(protocol): make local image test Bazel-friendly (#11799)

Josh McKinney067f8b1be0d7
diff --git a/codex-rs/protocol/src/models.rs b/codex-rs/protocol/src/models.rs
index 2f0a024fd0..eba748f2e4 100644
--- a/codex-rs/protocol/src/models.rs
+++ b/codex-rs/protocol/src/models.rs
@@ -1617,10 +1617,14 @@ mod tests {
let image_url = "data:image/png;base64,abc".to_string();
let dir = tempdir()?;
let local_path = dir.path().join("local.png");
- let png_bytes = include_bytes!(
- "../../core/src/skills/assets/samples/skill-creator/assets/skill-creator.png"
- );
- std::fs::write(&local_path, png_bytes.as_slice())?;
+ // A tiny valid PNG (1x1) so this test doesn't depend on cross-crate file paths, which
+ // break under Bazel sandboxing.
+ const TINY_PNG_BYTES: &[u8] = &[
+ 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1,
+ 8, 6, 0, 0, 0, 31, 21, 196, 137, 0, 0, 0, 11, 73, 68, 65, 84, 120, 156, 99, 96, 0, 2,
+ 0, 0, 5, 0, 1, 122, 94, 171, 63, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130,
+ ];
+ std::fs::write(&local_path, TINY_PNG_BYTES)?;
let item = ResponseInputItem::from(vec![
UserInput::Image {