Skip to content

Add /archive slash command#25027

Merged
etraut-openai merged 1 commit into
mainfrom
etraut/archive-thread-slash-command
May 29, 2026
Merged

Add /archive slash command#25027
etraut-openai merged 1 commit into
mainfrom
etraut/archive-thread-slash-command

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 29, 2026

Why

TUI users can archive saved sessions from other surfaces, but there is no in-session command for archiving the active session. Since archiving the active session also exits the TUI, the command should ask for explicit confirmation instead of firing immediately.

I'm also working on a companion PR that adds codex archive and codex unarchive top-level CLI commands.

What changed

  • Adds a new /archive slash command described as archive this session and exit.
  • Shows a confirmation dialog with No, don't archive selected first and Yes, archive and exit as the explicit action.
  • On confirmation, calls the existing thread/archive app-server RPC for the active main session and exits after success.
  • Keeps /archive disabled while a task is running and unavailable in side conversations.

Verification

Added focused TUI coverage for the /archive confirmation flow, disabled-while-task-running behavior, and the /ar slash-command popup snapshot.

Copy link
Copy Markdown
Contributor

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

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: b9ea61cdbc

ℹ️ 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/event_dispatch.rs
@etraut-openai etraut-openai force-pushed the etraut/archive-thread-slash-command branch 2 times, most recently from 879fa61 to cb13286 Compare May 29, 2026 06:55
@etraut-openai etraut-openai changed the base branch from etraut/archive-thread-commands to main May 29, 2026 06:55
@etraut-openai etraut-openai force-pushed the etraut/archive-thread-slash-command branch from cb13286 to cdc1d67 Compare May 29, 2026 07:00
Problem: TUI users can archive saved sessions through other surfaces, but the active running session has no slash command for archiving itself.

Solution: Add /archive for the active main session, require an explicit confirmation before dispatching the archive request, exit after success, and keep the command unavailable in side conversations or while a task is running.
@etraut-openai etraut-openai force-pushed the etraut/archive-thread-slash-command branch from cdc1d67 to 6af3860 Compare May 29, 2026 07:05
@etraut-openai etraut-openai changed the title Add archive slash command Add /archive slash command May 29, 2026
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran the smoke tests, worked as expected. Code looks good.

@etraut-openai etraut-openai merged commit 36cd366 into main May 29, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/archive-thread-slash-command branch May 29, 2026 18:07
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants