Skip to content

Shell mode silently drops floating attachments on submit #1250

@Astro-Han

Description

@Astro-Han

Context

Found during the PR #1247 optimality review (Codex finding, verified). Pre-existing behavior — it already affected legacy data-URL image attachments before #1247; path-backed chips now inherit it.

Problem

createPromptSubmit lets a prompt with floating attachments (images or chips) pass the non-empty gate, but the shell branch only calls session.shell({ command: text }) — no parts — and then lifecycle.clearInput() wipes the composer (packages/app/src/components/prompt-input/submit.ts, shell branch).

Net effect: add an attachment (drag/paste, or restored via undo/fork/history), switch to shell mode, submit → the attachment disappears without being sent and without warning. The attach action in the menu is disabled in shell mode, but drag/paste/restore paths don't go through that button.

Possible directions

  • Block shell submits while floating attachments exist (toast explaining why), or
  • Preserve floating attachments in the composer across a shell submit instead of clearing them.

Either keeps the invariant: nothing visible in the composer is silently destroyed by a submit that does not send it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions