Skip to content

Local engine model management: TUI - #488

Merged
rexlunae merged 5 commits into
mainfrom
feat/local-engines-tui
Aug 18, 2026
Merged

Local engine model management: TUI#488
rexlunae merged 5 commits into
mainfrom
feat/local-engines-tui

Conversation

@rexlunae

@rexlunae rexlunae commented Aug 18, 2026

Copy link
Copy Markdown
Owner

What & why

The /engines panel gets the same management depth as the desktop: keyboard-driven parameter editing and visible action feedback. Depends on #486 and #487 — merge in order (its diff is cumulative until the earlier PRs merge).

Changes

Parameter editing (components/engines_params.rs + engines_dialog.rs)

  • p toggles parameter-edit mode for the active engine. Left/right (or Tab) moves the focused field; +/- adjusts it (numeric fields step, selects cycle through their options, toggles flip, default model cycles through the local model list); x clears a field back to its default; Enter saves via EngineConfigSet and refreshes the engine + model lists; Esc discards.
  • The dialog renders each engine's parameter fields with current values, highlighting the focused field in edit mode, and the footer hints switch with the mode.

Action feedback

  • Load/Unload outcomes render as an inline Result/Error row in the dialog (the gateway's honest messages, e.g. "served by a joshua started outside RustyClaw (port 8080)").

Local-model pickers

  • Provider model fetches (provider selector, model selector, /models, autocomplete) now use provider_models_with_local_fallback, so local models show up even when the engine server isn't running — same lists the desktop pickers get.

Testing

  • cargo check --workspace, clippy clean; TUI (23) tests pass, including 5 new engines_params unit tests (field sets per engine, numeric stepping, select cycling, default-model cycling, clear).

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@rexlunae
rexlunae force-pushed the feat/local-engines-tui branch from b9be026 to ccd8919 Compare August 18, 2026 06:28
devin-ai-integration[bot]

This comment was marked as resolved.

@rexlunae

Copy link
Copy Markdown
Owner Author

Second-round Devin findings addressed in 85bf44f (all threads resolved):

  • Editor crash on selection change — parameter-edit mode clamps the focused-field index against the active engine's field list before every use, so a model-list reply for another engine (which moves the selection) can no longer panic the terminal app.
  • Stale result row — opening the engines dialog clears the previous Load/Unload result, so it no longer lingers after a close/reopen.
  • Const docs — the public engine-parameter constants now carry doc comments.

The core-file findings (non-Linux start/stop, ctx wiring, protocol frames, shell quoting) are fixed in the parent PRs of this stack; all threads here are resolved.

@rexlunae
rexlunae force-pushed the feat/local-engines-tui branch from 85bf44f to 234efd8 Compare August 18, 2026 06:42
devin-ai-integration[bot]

This comment was marked as resolved.

@rexlunae
rexlunae force-pushed the feat/local-engines-tui branch from 234efd8 to 7cac178 Compare August 18, 2026 07:10
devin-ai-integration[bot]

This comment was marked as resolved.

@rexlunae
rexlunae force-pushed the feat/local-engines-tui branch from 7cac178 to 279fb76 Compare August 18, 2026 07:51
devin-ai-integration[bot]

This comment was marked as resolved.

- Esc in parameter-edit mode now discards the draft for the active engine,
  so cancelling an edit no longer leaves the dialog showing the cancelled
  values (it rendered the draft even outside edit mode).
- Engine configs arrive in their own EngineConfigList frame (protocol
  change on the backend): the TUI surfaces it as a GwEvent and patches
  the engines panel's entries, instead of expecting the config inside
  EngineInfoDto.
- Formatting fix for a wrapped line in the desktop handler (parent
  branch).
- Parameter-edit mode clamps the focused-field index against the active
  engine's field list before every use, so the editor can no longer panic
  when a model-list reply for another engine moves the selection under it.
- Opening the engines dialog clears the previous Load/Unload result row,
  so a stale message no longer lingers after a close/reopen.
- The public engine-parameter field constants gain the doc comments the
  style guide requires.
- Changing the startup model (+/-) with an empty local model list no
  longer erases the saved choice: with nothing to pick from, the cycle
  previously landed on its None-only option and blanked default_model.
  It is now a no-op while the model list is empty.
@rexlunae
rexlunae force-pushed the feat/local-engines-tui branch from 279fb76 to 36cedea Compare August 18, 2026 08:29
devin-ai-integration[bot]

This comment was marked as resolved.

- The engines panel's loaded-model count no longer sums every server on
  the host: status() counts only servers on the engine's own configured
  port (joshua + llama.cpp), so an unrelated server elsewhere cannot
  inflate the count for an engine serving one model.
- Saving engine parameters from the terminal is gated on the
  EngineConfigList snapshot (new engines_configs_received state, reset on
  EngineListResult): until the real configs arrive, Enter refuses to save
  with an inline explanation and keeps the draft, instead of writing the
  placeholder config over the engine's stored endpoint/port/models_dir/
  extra_args.
- The default-model picker only cycles through the edited engine's own
  model list (the panel's models belong to whatever engine was last
  inspected), so a saved default can no longer be pointed at another
  engine's model.
devin-ai-integration[bot]

This comment was marked as resolved.

- Restore the expandable error detail for provider model-list failures:
  the error string (with its cause chain) is attached as the Warning's
  details again instead of dropping it, so the detail popup works.
- The engines panel now updates its local copy of an engine's config when
  parameters are saved, so a later unrelated setting change can no longer
  silently revert the earlier save (the EngineRefresh round-trip
  re-confirms it from the gateway).
@rexlunae
rexlunae merged commit 216757f into main Aug 18, 2026
17 checks passed
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