Redesign New run tab + add Model settings view#15
Conversation
- New run tab is now a minimal box: just the goal input and a Start run button. The selected repository shows top-right of the box and the writer/reviewer models in use show bottom-right. - Move all model/runner selection and run options out of the run form into a dedicated Model settings tab with grouped model pickers for the writer (actor) and reviewer (critic) roles. - Replace the placeholder runner-profile presets/JSON editor with a real model catalog grouped by the environment key that unlocks each provider's models. - Secrets view now lists, per environment key, whether it is stored and which models it unlocks. - Persist run settings (repo, models, options) in localStorage and build the engine env from them at run start. Co-authored-by: Inzimam Ul Haq <27832433+inhaq@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a "Model settings" navigation view to the desktop app. A new ChangesModel Settings Feature
Sequence DiagramsequenceDiagram
participant User as User
participant nav as Navigation
participant renderModels as renderModels()
participant settings as settings.ts
participant Tauri as listSecretKeys()
participant startForm as Start Form
participant engine as startRun()
User->>nav: clicks "Model settings"
nav->>renderModels: renderModels()
renderModels->>settings: loadSettings()
settings-->>renderModels: RunSettings
renderModels->>Tauri: listSecretKeys()
Tauri-->>renderModels: storedKeys[]
renderModels->>renderModels: render provider/model selectors (available/unavailable)
User->>renderModels: selects writer/reviewer model
renderModels->>settings: saveSettings(updated)
User->>nav: navigates to Start
startForm->>settings: loadSettings()
settings-->>startForm: RunSettings
startForm->>startForm: display repository and model pills
User->>startForm: submits goal + repo
startForm->>settings: buildRunEnv(settings)
settings-->>startForm: LOOPWRIGHT_* env vars
startForm->>engine: startRun({ goal, env })
engine-->>startForm: sessionId
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@desktop/src/main.ts`:
- Around line 343-346: In the commitParallel function, the assignment to
settings.maxParallel uses Number(parallelInput.value || "1"), which can return
NaN for non-numeric input. Since Math.max(1, NaN) also results in NaN, this
invalid value gets persisted and breaks the startup config. Replace the
assignment logic with a check that ensures the parsed number is finite and valid
(using Number.isFinite() or similar) before assigning it to
settings.maxParallel. If the parsed value is not a valid finite number, assign a
safe default value like 1 instead of allowing NaN to be persisted.
In `@desktop/src/settings.ts`:
- Around line 142-153: Add validation and coercion logic in the `loadSettings()`
function to normalize persisted settings before returning `merged`. After the
existing findModel checks for writer and reviewer, add validation for the fields
`maxParallel`, `worktrees`, `mechanicalGate`, and `repo` to ensure they have
valid types and values (coercing them to their expected types or falling back to
defaults from DEFAULT_SETTINGS if they are invalid, null, or have unexpected
types like strings where numbers are expected). This prevents invalid persisted
values from propagating to `buildRunEnv()` and causing run start failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 05d480ad-9f9e-4f1d-989b-9df6f4e7f87d
📒 Files selected for processing (4)
desktop/index.htmldesktop/src/main.tsdesktop/src/settings.tsdesktop/src/styles.css
…publishing features Resolves the conflict in desktop/src/main.ts by combining both directions rather than dropping either side's work (Option A): - New run stays a minimal box (goal + Start run), with the selected repo shown top-right and the writer/reviewer models bottom-right. - The repo pill is backed by main's REAL picker: desktop opens the native folder browser + git validation; the run passes repoDir to the engine, remembers recents, and saves the run config for resume. - All of main's advanced controls move into the new Model settings tab: writer/reviewer model pickers (catalog grouped by API key / CLI command), run options, and the full Branch & publishing section (push, PR, dry run, branch prefix, safety override) + tool-readiness checks. - CLI file-editing agents (Codex, Kiro) are preserved as catalog providers, so runs can still make real changes; a power-user Advanced JSON override keeps arbitrary runner profiles possible. - Secrets view keeps the 'Models by environment key' summary. Engine/src changes from main merge cleanly. Verified: desktop tsc + build, root tsc, and full vitest suite (173 tests) all pass.
Addresses CodeRabbit review feedback on PR #15: - loadSettings(): coerce persisted scalars (repo, maxParallel, worktrees, mechanicalGate, publishing flags, advanced fields) to their expected types, falling back to defaults. Tampered/legacy localStorage can no longer flow bad values (e.g. maxParallel "abc", worktrees null) into buildRunEnv() and break run startup. - commitParallel(): guard the parsed number with Number.isFinite so a NaN can never be persisted or emitted into LOOPWRIGHT_MAX_PARALLEL.
This pull request was created by @kiro-agent on behalf of @inhaq 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro Web
Summary
Reworks the desktop app so the New run tab is minimal and model configuration lives in its own place.
Implementation notes
desktop/src/settings.ts: the model catalog,localStorage-backed run settings, andbuildRunEnv()which maps the writer/reviewer choice to the engine'sLOOPWRIGHT_RUNNERS+ role-binding env vars. The engine stays vendor-neutral — nothing changed server-side.Tested
npx tsc --noEmitpasses.npm run build(tsc + vite build) succeeds with no errors.Notes / limitations
Summary by CodeRabbit
Release Notes