Skip to content

feat(agent): add a vim-native responsive agent workspace#156

Open
fcoury-oai wants to merge 3 commits into
masterfrom
fcoury/agent-workspace
Open

feat(agent): add a vim-native responsive agent workspace#156
fcoury-oai wants to merge 3 commits into
masterfrom
fcoury/agent-workspace

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

The Codex agent should feel like a native part of Red: prompts and follow-ups need real Vim editing, the conversation needs to fit any editor layout, and native Codex tools and approvals should remain available without weakening the isolated review workflow.

What changed

  • Add one real, buffer-backed modal composer for floating prompts and persistent agent conversations, including multiline Vim editing, undo and history, Unicode-safe cursor movement, mode-specific cursor shapes, and immediate Ctrl+Enter submission.
  • Make the conversation dock responsive and movable to the left, right, top, or bottom with Ctrl+W H/J/K/L and :AgentLeft, :AgentRight, :AgentTop, and :AgentBottom. Preserve drafts, history, reading position, focus, editor space, and theme-correct rendering across moves and terminal resizes.
  • Support native Agent, Plan, and isolated Review modes; persistent and resumable workspace-scoped threads; model and reasoning selection; live turn steering; streaming tool activity; and explicit, fail-closed Codex approvals.
  • Synchronize native agent edits into clean open buffers while preserving unsaved buffers and reporting conflicts. Keep automatic context and staged review overlays bounded to safe, non-sensitive workspace files.
  • Introduce and document the version 0.4.1 agent conversation plugin APIs, update [agent] defaults and workflow documentation, and add targeted modal composer, panel, editor, plugin, and app-server regressions.

How to Test

  1. Run the focused automated coverage:
    cargo test --lib modal_composer
    cargo test --test editing
    cargo test --test codex_app_server
    Expected: modal Vim editing, modified-Enter submission, four-sided dock layout, native session and approval handling, resumable threads, and isolated review regressions pass.
  2. Start Red with an authenticated codex on PATH, press Space A, compose a multiline prompt, switch between Insert and Normal modes, and submit with Ctrl+Enter. Expected: the prompt opens a streaming docked conversation; plain Enter still inserts a newline in Insert mode, and Ctrl+S remains an editor save shortcut. When using tmux, first enable extended-keys on and extended-keys-format csi-u.
  3. Focus the conversation, enter an unsent follow-up, and move the dock with Ctrl+W H, Ctrl+W J, Ctrl+W K, and Ctrl+W L; resize to a narrow terminal and back. Expected: all four positions work and the draft, conversation, cursor, focus, and usable editor viewport survive each move and resize.
  4. Set [agent] mode = "review", request a file edit, and inspect it with :AgentReview. Expected: the workspace remains unchanged until the proposed hunk is explicitly accepted. In native Agent mode, verify a completed change reloads a clean open buffer while an unsaved buffer is preserved and reported as a conflict; dismissing an approval must deny it.

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