From 1fb774909d8a1954cddbfcb54b97cc9eccf76ea2 Mon Sep 17 00:00:00 2001 From: "Rai (Michael Pokorny)" Date: Tue, 24 Jun 2025 20:32:13 -0700 Subject: [PATCH] wip --- .pre-commit-config.yaml | 2 +- agentydragon/README.md | 5 ++++- codex-rs/tui/src/bottom_pane/chat_composer.rs | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49df8a2460..bf9f87812a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: files: ^agentydragon/tasks/[0-9]{2}-.*\.md$ - id: cargo-build name: Check Rust workspace builds - entry: bash -lc 'cd codex-rs && cargo build --workspace --locked' + entry: bash -lc 'cd codex-rs && RUSTFLAGS="-D warnings" cargo build --workspace --locked' language: system pass_filenames: false require_serial: true diff --git a/agentydragon/README.md b/agentydragon/README.md index 9af997f688..8a501e4276 100644 --- a/agentydragon/README.md +++ b/agentydragon/README.md @@ -18,6 +18,9 @@ This file documents the changes introduced on the `agentydragon` branch ## Dependency updates - Added `uuid` crate to `codex-rs/cli` and `codex-rs/tui`. +## Pre-commit config changes +- Configured Rust build hook in `.pre-commit-config.yaml` to fail on warnings by setting `RUSTFLAGS="-D warnings"`. + ## codex-rs/tui: Undo feedback decision with Esc key - Pressing `Esc` in feedback-entry mode now cancels feedback entry and returns to the select menu, preserving the partially entered feedback text. - Added a unit test for the ESC cancellation behavior in `tui/src/user_approval_widget.rs`. @@ -51,4 +54,4 @@ Tasks live under `agentydragon/tasks/` as individual Markdown files. Please upda --- -*This README was autogenerated to summarize changes on the `agentydragon` branch.* \ No newline at end of file +*This README was autogenerated to summarize changes on the `agentydragon` branch.* diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index b62d6343f6..bcedd5ebcb 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -132,6 +132,27 @@ impl ChatComposer<'_> { } Input { key: Key::Enter, shift: false, alt: false, ctrl: false } => { if let Some(cmd) = popup.selected_command() { + // Inline DSL for mount-add/remove with args or dispatch other commands. + let first_line = self + .textarea + .lines() + .first() + .map(|s| s.as_str()) + .unwrap_or(""); + let stripped = first_line.trim_start().strip_prefix('/').unwrap_or(first_line); + let mut parts = stripped.splitn(2, char::is_whitespace); + let _cmd_token = parts.next().unwrap_or(""); + let args = parts.next().unwrap_or("").trim_start(); + if !args.is_empty() && (*cmd == SlashCommand::MountAdd || *cmd == SlashCommand::MountRemove) { + let ev = if *cmd == SlashCommand::MountAdd { + AppEvent::InlineMountAdd(args.to_string()) + } else { + AppEvent::InlineMountRemove(args.to_string()) + }; + self.app_event_tx.send(ev); + } else { + self.app_event_tx.send(AppEvent::DispatchCommand(*cmd)); + } self.textarea.select_all(); self.textarea.cut(); self.command_popup = None;