Skip to content

Keep SWARM form values between runs of the same script - #381

Merged
neich merged 1 commit into
mainfrom
feat/keep-swarm-params
Nov 16, 2026
Merged

neich merged 1 commit into
mainfrom
feat/keep-swarm-params

Conversation

@neich

@neich neich commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

Starting a SWARM run no longer discards the input form. The form is kept per script (this session only), so opening the same script again restores every value and puts focus on Run. Pressing r on a finished or stopped run reopens the form directly.

Changes

  • SwarmDashboardState gains last_forms (keyed by script path) and last_script. Starting a run moves the form into last_forms (clearing its completion popup and error) instead of dropping it.
  • New SwarmForm::restore_from: restores the Folder / Workflow / Profile selectors by option name, rebuilds the agent/tier/effort rows from the previous profile info, and copies typed inputs the script still has. Inputs the script no longer has are dropped. Focus lands on Run.
  • open_form applies restore_from when a previous form exists for the script, so both r and picking the script from the picker restore values.
  • New r key on the run view (ignored while a run is going) reopens the last script's form. The footer hint now reads "r run again".
  • SwarmForm::rebuild keeps focus on the Run button if it was there, rather than clamping to an index.
  • Updated the SWARM panel description in crates/gaviero-tui/CLAUDE.md.
  • Added two tests in swarm_run.rs: values survive a finished run (via r and via the picker), and a stopped run keeps its values while r is ignored during the run.

Testing

  • git diff --check origin/main...HEAD
  • cargo test — skipped (only run with --run-tests); the two new tests have not been run as part of this PR description.

Risks / Notes

  • Saved forms live in memory only; they are lost when the TUI exits.
  • r is bound as Action::InsertChar('r') on the run view, only when no run is active.
  • The full test suite was not run, so the new behavior is unverified by CI-style results here.
  • No generated files are included in the diff.

Starting a run now stores the form by script path, and reopening that
script restores its selectors, agent, tier and effort rows and typed
inputs, with focus on Run. A new `r` key on a finished or stopped run
reopens the form, and the footer hint and TUI docs describe it.
@neich
neich merged commit a3b3199 into main Nov 16, 2026
@neich
neich deleted the feat/keep-swarm-params branch November 16, 2026 17:10
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