This commit is contained in:
Rai (Michael Pokorny)
2025-06-21 03:47:32 -07:00
parent e585e6c8cd
commit c37d82e3d5
8 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# Task 01: Dynamic Mount-Add and Mount-Remove Commands
## Goal
Implement the `/mount-add` and `/mount-remove` slash commands in the TUI, supporting two modes:
1. **Inline DSL**: e.g. `/mount-add host=/path/to/host container=/path/in/agent mode=rw`
2. **Interactive dialog**: if the user just types `/mount-add` or `/mount-remove` without args, pop up a prompt to fill in `host`, `container`, and optional `mode` fields.
These commands should:
- Create or remove symlinks (or real directories) under the current working directory.
- Update the in-memory `SandboxPolicy` to grant or revoke read/write permission for the host path.
- Emit confirmation or error messages into the TUI log pane.
## Acceptance Criteria
- Users can type `/mount-add host=... container=... mode=...` and the mount is created immediately.
- Users can type `/mount-add` alone to open a small TUI form prompting for the three fields.
- Symmetrically for `/mount-remove` by container path.
- The `sandbox_policy` is updated so subsequent shell commands can read/write the newly mounted folder.
## Notes
- This builds on the static `[[sandbox.mounts]]` support introduced earlier.

View File

@@ -0,0 +1,19 @@
# Task 02: Granular Auto-Approval Predicates
## Goal
Let users configure one or more scripts in `config.toml` that examine each proposed shell command and output exactly one of:
- `continue` => auto-approve and proceed under the sandbox
- `deny` => auto-reject (skip sandbox and do not run the command)
- `user-confirm` => pause execution and open the interactive approval dialog for manual decision
If the script exits non-zero or prints anything else, default to `user-confirm`.
## Acceptance Criteria
- New `[[auto_allow]]` table in `config.toml` supporting one or more `script = "..."` entries.
- Before running any shell/subprocess, Codex invokes each configured script in order, passing the candidate command as an argument.
- If a script prints `continue`/`deny`/`user-confirm`, take that action and skip remaining scripts.
- If all scripts return non-zero or invalid output, pause for manual approval (existing logic).
## Notes
- This pairs with the existing `approval_policy = "unless-allow-listed"` but adds custom logic before prompting.

View File

@@ -0,0 +1,13 @@
# Task 03: Live Config Reload and Prompt on Changes
## Goal
Detect changes to the user `config.toml` file while a session is running and prompt the user to apply or ignore the updated settings.
## Acceptance Criteria
- A background file watcher watches `$CODEX_HOME/config.toml` (or active user config path).
- On any write event, compute a unified diff between the in-memory config and the on-disk file.
- Pause the agent, display the diff in the TUI bottom pane, and offer two actions: `Apply new config now` or `Continue with old config`.
- If the user applies, re-parse the config, merge overrides, and resume using the new settings. Otherwise, discard changes and resume.
## Notes
- Leverage a crate such as `notify` for FS events and `similar` or `diff` for unified diff generation.

View File

@@ -0,0 +1,16 @@
# Task 04: Auto-Mount Entire Repo and Auto-CD to Subfolder
## Goal
Allow users to enable a flag so that each session:
1. Detects the Git repository root of the current working directory.
2. Bind-mounts the entire repository into `/workspace` in the session.
3. Changes directory to `/workspace/<relative-path-from-root>` to mirror the users original subfolder.
## Acceptance Criteria
- New `auto_mount_repo = true` and optional `mount_prefix = "/workspace"` in `config.toml`.
- Before any worktree or mount processing, detect the Git root, bind-mount it to `mount_prefix`, and set `cwd` to `mount_prefix + relative_path`.
- Existing worktree/session-worktree logic should operate relative to this new `cwd`.
## Notes
- This offloads the entire monorepo into the session, leaving the users original clone untouched.

View File

@@ -0,0 +1,13 @@
# Task 05: Multi-line Composer Support (Ctrl+J & Auto-Expand)
## Goal
Enable users to insert newlines in the chat prompt without submitting the message when they press `Ctrl+J`. The composer box should auto-expand vertically up to a configurable maximum height.
## Acceptance Criteria
- Pressing `Ctrl+J` when focused in the prompt adds a newline instead of submitting.
- The composer widget grows in height as lines wrap or newlines are inserted, up to a max height (e.g. 10 lines).
- Below the max height, the input box uses a scrollbar or stops expanding.
- Behavior is consistent across windows and respects TUI resize events.
## Notes
- This requires changes in `tui/src/bottom_pane/chat_composer.rs` logic and layout in `tui/src/bottom_pane/bottom_pane_view.rs`.

View File

@@ -0,0 +1,13 @@
# Task 06: External Editor Integration for Prompt Entry
## Goal
Allow users to spawn an external editor (e.g. Neovim) to compose or edit the chat prompt. The prompt box should update with the editor's contents when closed.
## Acceptance Criteria
- A slash command `/edit-prompt` (or `Ctrl+E`) launches the user's preferred editor on a temporary file pre-populated with the current draft.
- Upon editor exit, the draft is re-read into the composer widget.
- Configurable via `editor = "${VISUAL:-${EDITOR:-nvim}}"` setting in `config.toml`.
## Notes
- Leverage the existing file-opener machinery or spawn a subprocess directly.
Modify `tui/src/bottom_pane/chat_composer.rs` and command handling in `tui/src/app.rs`.

View File

@@ -0,0 +1,11 @@
# Task 07: Undo Feedback Decision with Esc Key
## Goal
Enhance the user-approval dialog so that if the user opted to leave feedback (“No, enter feedback”) they can press `Esc` to cancel the feedback flow and return to the previous approval choice menu (e.g. “Yes, proceed” vs. “No, enter feedback”).
## Acceptance Criteria
- While the feedback-entry textarea is active, pressing `Esc` closes the feedback editor and reopens the yes/no confirmation dialog.
- The cancellation must restore the dialog state without losing any partially entered feedback text.
## Notes
- Changes in `tui/src/bottom_pane/approval_modal_view.rs` and input handling in the approval modal.

View File

@@ -0,0 +1,11 @@
# Task 08: Clarify “Exact Command” Wording in Approval Prompts
## Goal
Refine the approval dialog wording to clearly explain what “this exact command” means: whether it matches the exact command string, the binary invocation, or the tool category.
## Acceptance Criteria
- Update the approval modal description in `tui/src/bottom_pane/approval_modal_view.rs` to specify that it matches the literal command line string.
- Adjust config docs in `codex-rs/docs/protocol_v1.md` and `config.md` to mirror the clarified definition.
## Notes
- This is purely a documentation and UI-text change; no logic modification required.