mirror of
https://github.com/openai/codex.git
synced 2026-11-17 14:58:36 +00:00
Include node_repl images in Guardian review evidence (#38454)
## What changed - Preserve valid image content from completed `node_repl` Code Mode responses alongside text evidence for Guardian reviews. - Enable multimodal evidence for models that require automatic `node_repl` review, or when both `guardian_enhanced_node_repl_transcripts` and `guardian_node_repl_transcript_images` are enabled. - Bound retained and rendered evidence, deduplicate images already present in review history, and fall back to text-only evidence when the reviewer lacks image support or prompt capacity. - Keep review evidence out of the parent turn input. ## Testing - Cover feature gating, mixed text and image ordering, truncation and eviction, unsupported reviewers, prompt pressure, image detail normalization, and reused review sessions. GitOrigin-RevId: a3e482402f7b3484401b231dadc662e6e3504fdf
This commit is contained in:
1 parent
1b4ea8b3be
commit
4d9f3021c8
14 files changed
+713
-87
No files matched your search
@@ -629,6 +629,17 @@ impl ServerHandler for TestToolServer {
|
||||
Ok(CallToolResult::success(vec![
|
||||
rmcp::model::ContentBlock::text(" "),
|
||||
]))
|
||||
} else if args.code == "await nodeRepl.emitImage(await tab.screenshot())" {
|
||||
let mut meta = MetaObject::new();
|
||||
meta.insert("codex/imageDetail".to_string(), json!("low"));
|
||||
Ok(CallToolResult::success(vec![
|
||||
rmcp::model::ContentBlock::text("guardian-visible-before-image"),
|
||||
rmcp::model::ContentBlock::Image(
|
||||
rmcp::model::ImageContent::new(SMALL_PNG_BASE64, "IMAGE/PNG")
|
||||
.with_meta(meta),
|
||||
),
|
||||
rmcp::model::ContentBlock::text("guardian-visible-after-image"),
|
||||
]))
|
||||
} else if let Some(text) = args.code.strip_prefix("nodeRepl.write(")
|
||||
&& let Some(text) = text.strip_suffix(')')
|
||||
{
|
||||
@@ -817,10 +828,19 @@ impl TestToolServer {
|
||||
content.push(rmcp::model::ContentBlock::image(valid_data_b64, mime_type));
|
||||
}
|
||||
ImageScenario::InvalidImageBytesThenImage => {
|
||||
let oversized = std::env::var("MCP_TEST_OVERSIZED_INVALID_IMAGE") == Ok("1".into());
|
||||
content.push(rmcp::model::ContentBlock::image(
|
||||
"bm90IGFuIGltYWdl".to_string(),
|
||||
if oversized {
|
||||
"A".repeat(8 * 1024 * 1024 - 24)
|
||||
} else {
|
||||
"bm90IGFuIGltYWdl".to_string()
|
||||
},
|
||||
"image/png".to_string(),
|
||||
));
|
||||
let (mime_type, valid_data_b64) = std::env::var("MCP_TEST_IMAGE_DATA_URL")
|
||||
.ok()
|
||||
.and_then(|data_url| parse_data_url(&data_url))
|
||||
.unwrap_or((mime_type, valid_data_b64));
|
||||
content.push(rmcp::model::ContentBlock::image(valid_data_b64, mime_type));
|
||||
}
|
||||
ImageScenario::MultipleValidImages => {
|
||||
|
||||
Reference in new issue
Block a user