mirror of
https://github.com/openai/codex.git
synced 2026-09-03 14:59:03 +00:00
fix(imagegen): scope render-once hint
This commit is contained in:
@@ -18,7 +18,7 @@ fn image_generation_hint(
|
||||
image_output_path: impl Display,
|
||||
) -> String {
|
||||
format!(
|
||||
"Generated images are saved to {image_output_dir} as {image_output_path} by default.\nThe generated image is already displayed to the user. Do not embed or link it, or an unchanged copy of it, in Markdown.\nIf you need to use the generated image at another path for further work, copy it and leave the original in place unless the user explicitly asks you to delete it."
|
||||
"Generated images are saved to {image_output_dir} as {image_output_path} by default.\nAlready displayed; do not repeat it or an unchanged copy in final Markdown unless asked.\nFor another path, copy it and keep the original unless asked to delete it."
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -703,8 +703,11 @@ async fn generated_image_is_replayed_for_image_capable_models() -> Result<()> {
|
||||
second_request
|
||||
.message_input_texts("developer")
|
||||
.iter()
|
||||
.any(|text| text.contains("Generated images are saved to")),
|
||||
"second request should include the saved-path note in model-visible history"
|
||||
.any(|text| {
|
||||
text.contains("Generated images are saved to")
|
||||
&& text.contains("do not repeat it or an unchanged copy")
|
||||
}),
|
||||
"second request should include the saved-path and render-once note in model-visible history"
|
||||
);
|
||||
let _ = std::fs::remove_file(&saved_path);
|
||||
|
||||
@@ -827,8 +830,11 @@ async fn model_change_from_generated_image_to_text_preserves_prior_generated_ima
|
||||
second_request
|
||||
.message_input_texts("developer")
|
||||
.iter()
|
||||
.any(|text| text.contains("Generated images are saved to")),
|
||||
"second request should include the saved-path note in model-visible history"
|
||||
.any(|text| {
|
||||
text.contains("Generated images are saved to")
|
||||
&& text.contains("do not repeat it or an unchanged copy")
|
||||
}),
|
||||
"second request should include the saved-path and render-once note in model-visible history"
|
||||
);
|
||||
let _ = std::fs::remove_file(&saved_path);
|
||||
|
||||
|
||||
@@ -225,8 +225,8 @@ fn generated_output_returns_image_input_and_output_hint() {
|
||||
let output_hint =
|
||||
extension_image_generation_output_hint("/tmp", "/tmp/call-1.png").expect("hint should fit");
|
||||
let expected_output_hint = "Generated images are saved to /tmp as /tmp/call-1.png by default.
|
||||
The generated image is already displayed to the user. Do not embed or link it, or an unchanged copy of it, in Markdown.
|
||||
If you need to use the generated image at another path for further work, copy it and leave the original in place unless the user explicitly asks you to delete it.";
|
||||
Already displayed; do not repeat it or an unchanged copy in final Markdown unless asked.
|
||||
For another path, copy it and keep the original unless asked to delete it.";
|
||||
let output = GeneratedImageOutput {
|
||||
result: RESULT.to_string(),
|
||||
output_hint: Some(output_hint),
|
||||
|
||||
Reference in New Issue
Block a user