Skip to content

[FEATURE]: v2 API to edit the prompt of an undelivered inbox item #52275

Open

Description

@remorses

Feature hasn't been suggested before.

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

Related but UI-focused and closed as stale: #6942, #21906. This one is about the V2 server API.

Describe the enhancement you want to request

I'm porting Kimaki (Discord bot on top of opencode) to V2. Users queue prompts with delivery: "queue" from Discord messages. Discord lets them edit a message after sending it, and I want the edit to update the queued prompt.

Today (v2 branch, 2.0.20)

Action API Works
list pending items GET /api/session/:sessionID/inbox yes
cancel an item DELETE /api/session/:sessionID/inbox/:inboxID yes
change delivery PATCH /api/session/:sessionID/inbox/:inboxID { delivery } yes
change the prompt text / files none no

The only workaround is cancel + re-enqueue, which moves the item to the end of the queue and needs a new message ID.

Proposal

Extend session.inbox.update to accept the prompt for items that are not delivered yet:

await client.session.inbox.update({
  sessionID,
  inboxID,
  prompt: { text: "edited text", files: [] }, // optional, same shape as session.prompt
  delivery: "queue",                           // optional, as today
})
  • keeps the item's enqueue position
  • ConflictError if the item was already delivered or cancelled (same as today)
  • emits a durable event so clients can re-render, e.g. session.inbox.updated { inboxID, item } (today session.inbox.delivery.changed only covers delivery)

This also gives the TUI/app a primitive for "edit queued message" (the ask in #6942).

Activity

  1. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    This issue might be related to existing requests for editing queued prompts and managing queued messages. Please check:

    • #6942: edit queued message prompts
    • #21906: queue, change, cancel, and forward prompts
    • #24472: queued-message editing and cancellation
    • #8685: queued-message edit/cancel controls

    This issue focuses on the V2 API, while some of these requests focus on UI behavior.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed request! You'd like session.inbox.update to also accept a new prompt (text and files) for inbox items that haven't been delivered yet. The item would keep its place in the queue, you'd get a conflict error if it was already delivered or cancelled, and an inbox.updated-style event would let clients re-render. That way an edited Discord message could update the queued prompt instead of being cancelled and re-added at the end of the queue.

    I checked the current v2 code. The inbox can cancel an item or switch it between steer and queue, and the only change event (session.inbox.delivery.changed) carries just the delivery mode. There's no way to edit the prompt itself, so this would be a new API rather than a fix. This can't be done as a plugin for now, because plugins can't modify existing inbox items. Maintainers will consider it.

    Related issues:

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