Skip to content

feat(fleet): allow switching working directory for new runs in Fleet TUI - #479

Merged
Jason Robert (jrob5756) merged 2 commits into
mainfrom
feature/477-fleet-tui-cwd-switch
Aug 22, 2026
Merged

feat(fleet): allow switching working directory for new runs in Fleet TUI#479
Jason Robert (jrob5756) merged 2 commits into
mainfrom
feature/477-fleet-tui-cwd-switch

Conversation

@jrob5756

Copy link
Copy Markdown
Collaborator

Summary

Adds a working-directory field to the Fleet TUI's New Run screen so a launched run can target a different cwd than the TUI's own process.

  • Threads the resolved cwd through fleet/launch.py and cli/bg_runner.py
  • Surfaces the working directory in the Runs screen and theme/widgets presentation
  • Updates docs/fleet.md and AGENTS.md

Testing

Adds/updates tests in test_cli/test_bg_runner.py, test_fleet/test_launch.py, test_fleet/test_tui_actions.py, test_fleet/test_tui_new_run.py, test_fleet/test_tui_runs.py.

Closes#477

Jason Robertand others added 2 commits August 22, 2026 15:21
Adds a working-directory field to the New Run screen so a launched run
can target a different cwd than the TUI's own process. Threads the
resolved cwd through launch.py and cli/bg_runner.py, surfaces it in the
Runs screen and theme/widgets presentation, and covers the change with
new tests across bg_runner, launch, and the TUI actions/new_run/runs
screens.
Blocking:
- History screen's resume action now forwards FleetApp.launch_dir as
cwd to launch_resume, instead of silently ignoring the chosen launch
directory on resume.
- Replace the inherited PYTHONSAFEPATH=1 env var (which leaked into
workflow script-step subprocesses and broke sibling-module imports)
with an unconditional -P interpreter flag on the detached child's
argv, which is not inherited by descendants.
- DirectoryPickerModal._accept now rejects empty/whitespace-only input
instead of silently treating it as the process cwd.
Recommendations applied:
- Relative input in the directory picker now anchors on the tree's
root directory rather than the process cwd.
- _spawn_bg_child's cwd guard no longer lets a bare PermissionError
escape past its documented RuntimeError contract, and distinguishes
"not a directory" from "does not exist".
- fleet/launch.py's not-found error no longer claims an absolute
reference was resolved against base_dir.
- theme.shorten_home compares path components instead of a bare string
prefix, fixing a bug that rendered /home/jasonx as ~x under
HOME=/home/jason.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jrob5756
Jason Robert (jrob5756) marked this pull request as ready for review August 22, 2026 19:58
@jrob5756
Jason Robert (jrob5756) merged commit 3c07139 into mainAug 22, 2026
11 of 13 checks passed
Sign up for freeto 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.

fleet TUI: switch the working directory from a footer command

1 participant

@jrob5756