Skip to content

feat: queue TUI follow-ups through app-server#28307

Open
efrazer-oai wants to merge 1 commit into
dev/efrazer/app-server-queue-10-apifrom
dev/efrazer/user-message-queue-12-tui
Open

feat: queue TUI follow-ups through app-server#28307
efrazer-oai wants to merge 1 commit into
dev/efrazer/app-server-queue-10-apifrom
dev/efrazer/user-message-queue-12-tui

Conversation

@efrazer-oai

@efrazer-oai efrazer-oai commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The TUI currently keeps queued follow-ups in client memory while a turn is running. When User Message Queue is enabled, this PR sends eligible plain follow-ups to app-server so they survive the TUI process and join the same ordered idle queue used by other clients.

The TUI remains a thin client: it submits messages, renders the latest queue snapshot, and renders dispatched user messages through the normal turn event stream.

Behavior

  • Query experimentalFeature/list before queue operations; unsupported servers quietly retain the existing local queue behavior.
  • Send eligible plain follow-ups through thread/queue/add, including additional messages while server-owned work is pending.
  • Refresh the visible queue from thread/queue/list after thread/queue/changed, session attachment, or event-stream lag.
  • Keep queue refresh and fallback results scoped to the thread that originated the request.
  • Keep slash commands, shell commands, pending steers, IDE-context messages, and ephemeral side-conversation messages on their existing local paths.
  • Keep local-only commands and the messages behind them ordered after pending server work.
  • Show pending and failed server rows in the existing queued-input preview, including external-event provenance.
  • Hide the local edit hint when the preview contains only server-owned rows.
  • Preserve existing direct turn and steering behavior when no server-owned queue work is pending.

Design decisions

  • Queue snapshots are presentation state. UserMessageQueueState stores only the latest rows, whether more rows exist, and whether a refresh is in flight.
  • A successful thread/queue/add acknowledgement does not mutate TUI queue state. The queue invalidation and subsequent list response are authoritative.
  • The TUI does not infer whether a missing row was deleted or dispatched. Dispatched messages arrive through the normal ItemCompleted(UserMessage) stream.
  • Interrupting the active turn does not delete or restore server-owned queued messages.
  • A single queue page is enough for the preview. A non-empty nextCursor blocks local autosend because unseen rows may still be pending.
  • Failed rows remain visible but do not masquerade as live pending work.
  • Capability failures are compatibility fallback, not user-facing errors.

Testing

Tests: targeted queue submission, capability fallback, thread-scoped refresh, queue projection, IDE and side-conversation fallback, slash-command ordering, pending-preview rendering, compile checks, clippy, and CI.

Stack

  1. #28264 - extract the core user-submission payload
  2. #28265 - accept user submissions at idle turn boundaries
  3. #28266 - add durable queue storage
  4. #28267 - dispatch queued messages through ordered idle extensions
  5. #28268 - expose the app-server queue API
  6. #28307 - queue TUI follow-ups through app-server (this PR)

@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from 0c54bf4 to e81d12f Compare June 15, 2026 12:55

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: e81d12f1c3

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from 4656993 to 4c5a27c Compare June 15, 2026 13:22
@efrazer-oai efrazer-oai requested a review from a team as a June 15, 2026 13:22
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from e81d12f to 04f7678 Compare June 15, 2026 13:22

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 04f7678a64

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/app_server_session.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from 4c5a27c to 4a9f4c5 Compare June 15, 2026 13:57
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from 04f7678 to adeb33a Compare June 15, 2026 13:58
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from 4a9f4c5 to 68c9060 Compare June 15, 2026 14:03
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from adeb33a to fe9da30 Compare June 15, 2026 14:03
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from 68c9060 to 34bf046 Compare June 15, 2026 14:16
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from fe9da30 to bcb1942 Compare June 15, 2026 14:16

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: bcb19427b3

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/app/thread_routing.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/user_messages.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_flow.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from bcb1942 to aa323b7 Compare June 15, 2026 14:31

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: aa323b7a47

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/app/thread_routing.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/turn_runtime.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from ff3f334 to 9003b9d Compare June 15, 2026 15:12
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from aa323b7 to 44d703e Compare June 15, 2026 15:13

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 44d703e2f6

ℹ️ 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
  • 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 address that feedback".

@efrazer-oai efrazer-oai force-pushed the dev/efrazer/app-server-queue-11-tui branch from 9003b9d to cc8ba6b Compare June 15, 2026 15:26
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from 44d703e to 4aabda9 Compare June 15, 2026 15:26

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 4aabda9f80

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_restore.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/app/thread_routing.rs Outdated
Comment thread codex-rs/tui/src/app_server_session.rs Outdated
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from afb8967 to 05e89fe Compare June 16, 2026 01:12
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 05e89fe251

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/tests/composer_submission.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/user_messages.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from 05e89fe to c1362b3 Compare June 16, 2026 01:38
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: c1362b37ba

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/session_flow.rs Outdated
@efrazer-oai efrazer-oai force-pushed the dev/efrazer/user-message-queue-12-tui branch from c1362b3 to 31615b9 Compare June 16, 2026 02:11
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

1 similar comment
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 6809e66361

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_submission.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/session_flow.rs
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

1 similar comment
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 68a2deb529

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_restore.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_restore.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: 226a521921

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/ide_context.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/protocol.rs
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: d38ea7ac30

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_restore.rs
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs Outdated
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: fad4386e36

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/session_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: d6f2fc9bb8

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/app/app_server_events.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs
@efrazer-oai

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown
Contributor

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 automated review suggestions for this pull request.

Reviewed commit: e096bc93f0

ℹ️ 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
  • 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 address that feedback".

Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_submission.rs
Comment thread codex-rs/tui/src/chatwidget/input_flow.rs
Comment thread codex-rs/tui/src/chatwidget/input_queue.rs
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.

1 participant