Commit Graph

6 Commits

  • feat(tui): route /diff through workspace commands (#21001)
    Stacked on #20892.
    
    ## Why
    
    #20892 adds the TUI workspace command abstraction so branch status
    metadata can run through app-server instead of assuming the CLI process
    has the active workspace locally. `/diff` still used direct local
    process execution, which means remote app-server sessions could compute
    the diff against the wrong machine or fail to see the active workspace
    at all.
    
    This PR moves `/diff` onto that same app-server-backed command path so
    Git runs wherever the active workspace lives.
    
    ## What Changed
    
    - Route `/diff` through the TUI `WorkspaceCommandExecutor` using the
    active chat cwd.
    - Replace direct `tokio::process::Command` usage in `get_git_diff` with
    argv-based workspace command requests.
    - Preserve the existing `/diff` behavior: tracked diff output, untracked
    file diffs, treating Git diff exit code `1` as success, and showing the
    existing non-git-repository message.
    - Extend `WorkspaceCommand` with caller-set timeouts and an explicit
    uncapped-output opt-out. Metadata probes remain capped by default;
    `/diff` opts out because its full output is the user-visible payload.
    
    ## How to Test
    
    Manual reviewer path:
    
    1. Start the Codex TUI from a Git worktree with one tracked file change
    and one untracked file.
    2. Run `/diff`.
    3. Confirm the rendered diff includes both the tracked diff and the
    untracked file diff.
    4. Start the TUI outside a Git worktree, or switch to a non-git cwd,
    then run `/diff`.
    5. Confirm it shows the existing `/diff` not-inside-a-git-repository
    message.
    
    Targeted tests run:
    
    - `cargo test -p codex-tui get_git_diff -- --nocapture`
    - `cargo test -p codex-tui branch_summary -- --nocapture`
    - `cargo test -p codex-tui`
  • Rename tui_app_server to tui (#16104)
    This is a follow-up to https://github.com/openai/codex/pull/15922. That
    previous PR deleted the old `tui` directory and left the new
    `tui_app_server` directory in place. This PR renames `tui_app_server` to
    `tui` and fixes up all references.
  • Remove the legacy TUI split (#15922)
    This is the part 1 of 2 PRs that will delete the `tui` /
    `tui_app_server` split. This part simply deletes the existing `tui`
    directory and marks the `tui_app_server` feature flag as removed. I left
    the `tui_app_server` feature flag in place for now so its presence
    doesn't result in an error. It is simply ignored.
    
    Part 2 will rename the `tui_app_server` directory `tui`. I did this as
    two parts to reduce visible code churn.
  • Show progress indicator for /diff command (#2245)
    ## Summary
    - Show a temporary Working on diff state in the bottom pan 
    - Add `DiffResult` app event and dispatch git diff asynchronously
    
    ## Testing
    - `just fmt`
    - `just fix` *(fails: `let` expressions in this position are unstable)*
    - `cargo test --all-features` *(fails: `let` expressions in this
    position are unstable)*
    
    ------
    https://chatgpt.com/codex/tasks/task_i_689a839f32b88321840a893551d5fbef
  • chore(rs): update dependencies (#1494)
    ### Chores
    - Update cargo dependencies
    - Remove unused cargo dependencies
    - Fix clippy warnings
    - Update Dockerfile (package.json requires node 22)
    - Let Dependabot update bun, cargo, devcontainers, docker,
    github-actions, npm (nix still not supported)
    
    ### TODO
    - Upgrade dependencies with breaking changes
    
    ```shell
    $ cargo update --verbose
       Unchanged crossterm v0.28.1 (available: v0.29.0)
       Unchanged schemars v0.8.22 (available: v1.0.4)
    ```
  • feat: add support for /diff command (#1389)
    Adds support for a `/diff` command comparable to the one available in
    the TypeScript CLI.
    
    <img width="1103" alt="Screenshot 2025-06-26 at 12 31 33 PM"
    src="https://github.com/user-attachments/assets/5dc646ca-301f-41ff-92a7-595c68db64b6"
    />
    
    While here, changed the `SlashCommand` enum so the declared variant
    order is the order the commands appear in the popup menu. This way,
    `/toggle-mouse-mode` is listed last, as it is the least likely to be
    used.
    
    Fixes https://github.com/openai/codex/issues/1253.