Skip to content

Conversation

dedrisian-oai
Copy link
Collaborator

Adds a "View Image" tool so Codex can find and see images by itself:

Screenshot 2025-08-26 at 10 40 04 AM

@dedrisian-oai dedrisian-oai added codex-rust-review Perform a detailed review of Rust changes. codex-review labels Aug 26, 2025
Copy link

Summary

  • Adds a new “view_image” tool that lets the agent attach a local image path to the conversation context, with config plumbing and tests updated across core, openai_tools, exec, mcp-server, and tui.

Notes

  • Enabled by default via Config.include_view_image_tool with TOML override (tools.view_image) and per-process overrides.

Review

  • Looks clean and consistent; config propagation and test expectations are updated appropriately. A couple of small nits to consider:
  • codex-rs/core/src/codex.rs:@@ +2075,30 @@ async fn handle_function_call(…): Rename SeeImageArgsViewImageArgs to match the tool name.
  • codex-rs/core/src/codex.rs:@@ +2075,30 @@ async fn handle_function_call(…): Consider checking that the resolved path exists/is a file before inject_input to return a clearer error.
  • codex-rs/core/src/config.rs:@@ +693,4 @@ impl Config { …: unwrap_or(true) enables the tool by default—confirm this is the intended default.
  • codex-rs/core/src/openai_tools.rs:@@ +299,24 @@ create_view_image_tool(…): Optional: expand the path description with accepted formats or constraints for UX clarity.

View workflow run

Copy link

Summary
Adds a new “view_image” tool to let the agent attach a local image path to the conversation context, wires it through config and tool selection, and updates tests. Touches core tool plumbing, config loading/overrides, exec/TUI defaults, and MCP integration.

Changes

  • core: add view_image tool handler and plumb include_view_image_tool through Sessions/ToolsConfig.
  • config: add include_view_image_tool and tools.view_image TOML option; update profile tests.
  • openai_tools: define create_view_image_tool() and include it when enabled; update tool-order tests.
  • exec/mcp-server/tui: pass through include_view_image_tool: None in overrides.

Review
Nice addition and cleanly integrated across crates. A couple of small nits and one robustness suggestion:

  • codex-rs/core/src/codex.rs (handle_function_call, new "view_image" arm):
    • Rename SeeImageArgs to ViewImageArgs for consistency with the tool name.
    • Consider checking that the resolved path exists and is a file before inject_input, and include the path in the error with format!("...: {abs}").
  • codex-rs/core/src/config.rs (Config + ToolsToml additions):
    • Clarify and document the default for include_view_image_tool (true vs false) in config docs/comments; tests expect true in some profiles.
  • codex-rs/core/src/openai_tools.rs (create_view_image_tool):
    • Consider strict: true if other tools use strict schemas; otherwise note why false is preferred for consistency.
  • Tests:
    • Add a unit test covering the new handle path: valid path success, invalid path error, and “no active task” branch.

If the PR body doesn’t already, please add a brief motivation and a short usage note (what scenarios benefit from attaching local images).


View workflow run

@dedrisian-oai dedrisian-oai marked this pull request as ready for review August 27, 2025 23:19
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@dedrisian-oai dedrisian-oai merged commit 4e9ad23 into main Aug 28, 2025
25 of 27 checks passed
@dedrisian-oai dedrisian-oai deleted the daniel/view-image-tool branch August 28, 2025 00:41
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants