Skip to content

feat(agent): add composer history search - #287

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/agent-composer-history-search
Aug 21, 2026
Merged

fcoury-oai merged 2 commits into
mainfrom
fcoury/agent-composer-history-search

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

The docked Agent composer persists submitted prompts, but it did not restore that history into a new pane and lacked the shell-style navigation users expect when iterating on prior requests.

This change:

  • adds opt-in Up/Down history browsing and incremental Ctrl-r substring search to text-panel composers while preserving multiline cursor motion, the exact unsent draft and cursor, and Normal-mode redo
  • hydrates the Agent pane from persisted prompt history through the new SetTextPanelComposerHistory host call, merging late storage results without discarding newer in-memory prompts
  • shows reverse-search state and match position in the composer footer, documents the interaction, and bumps the compatible plugin host API to 0.15.0

How to Test

  1. Open the Agent pane, submit two distinct prompts, then type an unsent multiline draft. Up should move within the draft until the first visual row, then recall older prompts; Down past the newest prompt should restore the exact draft and cursor.
  2. Press Ctrl-r, type a substring, and use Ctrl-r, Up, or Down to cycle matches. Enter should load the match without sending it; Escape or Ctrl-g should restore the untouched draft. Normal-mode Ctrl-r should still redo.
  3. Restart Red and reopen the Agent pane. Previously submitted prompts should remain available through Up/Down and Ctrl-r.

Automated coverage:

  • cargo test --all-features --lib -- --test-threads=1 (2,040 passed, 1 ignored)
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-20T23:58:15.940198Z b1b94a0 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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

ℹ️ 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 src/ui/prompt_buffer.rs
Comment on lines +196 to +197
self.history_position = None;
self.history_draft = None;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve in-progress history navigation during updates

When SetTextPanelComposerHistory arrives after the user has pressed Up, these assignments discard the saved draft and history position while leaving the recalled entry in the buffer. The next Down key is therefore handled as ordinary cursor movement and can no longer restore the user's original unsent draft and cursor. This can occur with a late Agent storage response or any plugin that refreshes history while the composer is active; preserve the navigation state or restore the saved draft before resetting it.

Useful? React with 👍 / 👎.

@fcoury-oai
fcoury-oai merged commit 54a6253 into main Aug 21, 2026
14 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/agent-composer-history-search branch August 21, 2026 00:02
@fcoury
fcoury restored the fcoury/agent-composer-history-search branch August 21, 2026 00:10
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