Skip to content

[FEATURE]: Paste images into built-in questions tool answer #24199

Closed as not planned

Description

@josippapez

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

When an agent calls the built-in question / ask-user tool and the user replies, let the user paste an image from the clipboard into the answer box. The tool should persist the pasted image to a temp file and return its absolute path as part of the user's answer, so the agent can immediately consume it (e.g. re-read with its Read tool, pass to vision, attach to a follow-up message).

Motivation

Agents frequently need to collect visual context mid-run — screenshots of bugs, design mocks, stack-trace pictures, diagrams. Today the only way to get an image to the agent during a question reply is:

  1. Save the clipboard image to disk manually
  2. Paste/type the absolute path as text

This breaks flow and is error-prone (wrong path, forgotten save step). Interactive MCP desktop apps (e.g. interactive-mcp-server's QuestionDock) already solve this by intercepting paste, saving clipboard bytes to a temp location, and inlining the absolute path into the answer. The built-in tool should match that UX.

Proposed behavior

  • While typing an answer to a question prompt, pressing paste (⌘V / Ctrl+V) with an image on the clipboard:
    1. Writes the image bytes to a temp file (e.g. $TMPDIR/opencode-clipboard-<timestamp>.<ext>).
    2. Inserts the absolute path as text at the caret, optionally wrapped (e.g. file:///... or plain path).
    3. Returns that path in the tool response answer field alongside any other text the user typed.
  • Supported formats: PNG, JPEG, WebP, GIF (at minimum PNG — the common clipboard format).
  • No change when clipboard contains plain text.
  • Multiple images in one answer should each produce their own absolute path.

Why the path (not base64)

  • Agent's existing Read / vision tools already take paths.
  • Keeps the question response small.
  • Matches how screenshots, file-drag, and @file mentions already work.

Prior art

  • GitHub/Slack/Discord clipboard-image-paste flows.

Acceptance criteria

  • User can paste an image while answering a question prompt.
  • Image is saved to a temp file; absolute path returned to agent in the answer.
  • Plain-text paste still works unchanged.
  • Works on macOS, Linux, Windows.
  • Temp files are cleaned up per OS temp-dir policy (no long-lived growth).

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Apr 24, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 24, 2026
  3. github-actions commented on Apr 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your request is distinct, please clarify how it differs.

  4. baltasarblanco commented on Apr 24, 2026

    @baltasarblanco

    Hi team! 👋

    This is a fantastic UX improvement idea. As someone who frequently shares
    screenshots during debugging sessions, this would save so much friction.

    A couple of small suggestions that might complement the proposal:

    • 🎨 Consider adding a subtle visual indicator when an image is pasted
      (e.g., a small thumbnail preview or icon next to the inserted path)
    • ♿ Ensure keyboard-only users can still trigger this flow without mouse
    • 🧹 Maybe add a config option to customize the temp file naming pattern
      for easier debugging?

    Happy to help test this on [your OS] if needed! 🚀

  5. baltasarblanco commented on Apr 24, 2026

    @baltasarblanco

    Thanks for the links! 🙏

    After reviewing #11026 and #906, I believe this proposal has a distinct focus:

    • It targets the ask-user/question tool specifically (not general chat or generic file references)
    • It emphasizes clipboard-image → temp file → absolute path as an atomic flow
    • The goal is to let agents consume visual context mid-run without breaking user flow

    That said, I'm happy to consolidate discussions if the maintainers prefer!
    Just let me know what works best for the project. 😊

  6. assigned and unassigned on Apr 26, 2026
  7. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. github-actions commented on Jul 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions