Skip to content

feat: enable Codex image support for resumed sessions (local + SSH)#375

Merged
pedramamini merged 5 commits intoRunMaestro:mainfrom
chr1syy:fix-codex-images
Feb 16, 2026
Merged

feat: enable Codex image support for resumed sessions (local + SSH)#375
pedramamini merged 5 commits intoRunMaestro:mainfrom
chr1syy:fix-codex-images

Conversation

@chr1syy
Copy link
Copy Markdown
Contributor

@chr1syy chr1syy commented Feb 15, 2026

Summary

This PR enables image inputs when resuming Codex sessions by switching from CLI image flags to prompt-embedded temp file paths in resume mode.

Previously, Codex resume flows could not consume images because codex exec resume does not accept -i. This change introduces a resume-specific image strategy that works for both local and SSH execution paths.

What changed

  • Added a new capability field: imageResumeMode?: 'prompt-embed'
  • Set Codex to imageResumeMode: 'prompt-embed' and marked supportsImageInputOnResume as true
  • Local spawner now embeds temp image paths into prompt text for resume mode instead of adding -i
  • SSH command builder now supports prompt-embed mode for resumed sessions, and cleans up remote temp image files after execution
  • Process IPC forwards resume image mode into SSH command construction
  • Removed renderer-side Codex resume image attach blocking

Validation

Ran targeted tests:

pm test -- src/tests/main/process-manager/utils/imageUtils.test.ts src/tests/main/process-manager/spawners/ChildProcessSpawner.test.ts src/tests/main/utils/ssh-command-builder.test.ts src/tests/main/agents/capabilities.test.ts

Result: 4 files passed, 128 tests passed, 0 failed.

Validation on local/ssh

image image

closes #323

chr1syy and others added 5 commits February 15, 2026 10:21
Set supportsImageInputOnResume to true for Codex agent and remove the
blockCodexResumeImages blocking logic from App.tsx. Images will be
written to disk with paths embedded in prompt text as a workaround
since codex exec resume doesn't support the -i flag.

Removes: blockCodexResumeImages variable, showImageAttachBlockedNotice
callback, paste/drop handler image blocks, and unused getProviderDisplayName
import.

Refs: RunMaestro#323

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…essions

When Codex resumes a session with `codex exec resume`, the -i flag is not
supported. This adds a new imageResumeMode capability that triggers an
alternative image handling path: images are saved to temp files and their
paths are embedded as a text prefix in the prompt instead of using -i args.

- Add imageResumeMode?: 'prompt-embed' to AgentCapabilities interface
- Add buildImagePromptPrefix() utility in imageUtils.ts
- Split ChildProcessSpawner Branch 2 into resume vs initial spawn paths
- Ensure modified prompt flows through stdin handling for Windows support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add imageResumeMode option to buildSshCommandWithStdin() that embeds
image file paths in the prompt/stdinInput instead of adding -i CLI args
when resuming Codex sessions over SSH. The IPC handler detects resume
mode via agentSessionId + imageResumeMode capability and passes the
flag through to the SSH command builder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When remote temp image files are created on the SSH host (for Codex/OpenCode
image support), the shell script now runs the agent command without `exec`
so that cleanup `rm -f` commands execute after the agent exits. When no
temp files exist, the existing `exec` behavior is preserved.

Also adds `remoteTempImagePaths` to the `SshCommandResult` return type
for informational purposes, and updates/adds comprehensive tests for the
exec/no-exec cleanup behavior and return value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sions

Resolved merge conflicts in ChildProcessSpawner.ts and applied fixes:

- CRITICAL: Restore promptAddedToArgs tracking in both image branches
  (resume-with-prompt-embed and initial-spawn). Without this, the
  stream-json stdin writer would double-send prompts to Codex agents,
  re-introducing the bug fixed in 6097736.

- DRY: Use shared buildImagePromptPrefix() in ssh-command-builder.ts
  instead of inline duplicate.

- Remove imageResumeMode: undefined noise from all non-Codex agent
  definitions (optional field, DEFAULT_CAPABILITIES omits it).

- Remove dead onPromptImageAttachBlocked={undefined} prop from App.tsx.

- Update capability tests for optional imageResumeMode field.
@pedramamini pedramamini merged commit 0472781 into RunMaestro:main Feb 16, 2026
@chr1syy chr1syy deleted the fix-codex-images branch February 16, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex: write images to disk and pass file paths instead of rejecting on resume

2 participants