Skip to content

Retire legacy tui.rs: route rocm bootstrap setup to the dash onboarding, then delete the ~45k-line module - #67

Merged
michaelroy-amd merged 5 commits into
mainfrom
retire-legacy-tui
Jul 1, 2026
Merged

Retire legacy tui.rs: route rocm bootstrap setup to the dash onboarding, then delete the ~45k-line module#67
michaelroy-amd merged 5 commits into
mainfrom
retire-legacy-tui

Conversation

@michaelroy-amd

@michaelroy-amd michaelroy-amd commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

Retires the legacy ~45k-line monolith TUI (apps/rocm/src/tui.rs), which until
now was kept compiling only via the _RETAINED_TUI_ENTRY dead-code anchor. The
one live consumer — rocm bootstrap setup (via run_bootstrap_setup) — is
re-routed to the modern, App-free onboarding wizard that already lives in the
dash crate (rocm-dash-tui ui::onboarding over jobs/job_console).

Follows up @rominf's review on #62 ("legacy code isn't fully retired"), split
into its own change as requested so #62 didn't carry the giant delete.

Commit 1 — route rocm bootstrap setup to the dash onboarding

  • ResolvedArgs::start_onboarding; honored at app startup by opening the
    onboarding overlay.
  • dash::run_bootstrap (+ testable bootstrap_args helper) reusing the
    run/run_chat runtime path; bootstrap.rs calls it.

Commit 2 — delete tui.rs + prune the dead-code cascade

  • Delete apps/rocm/src/tui.rs (incl. its test module); drop mod tui;, the
    retention anchor, and its guard test.
  • Compiler/clippy-driven prune of helpers only tui.rs used (driver-install
    TUI-approval cluster, render_sidebar_text, friendly_provider_label,
    freeform_plan_uses_provider, the *_for_tui log renderers,
    logs_browser_page_count, tui_help_text); build_freeform_plan is now
    #[cfg(test)] over the live build_freeform_plan_with_recipes.
  • comfyui.rs: drop render_tui_status/render_tui_logs/is_installed/
    running_url (+ their tests); live render_logs/models_folder/
    render_models_path and the unmanaged-URL helpers stay.
  • docs/testing.md: remove the obsolete legacy-TUI navigability test list.

Commit 3 — correct the non-interactive setup guidance

  • bootstrap.rs: the non-interactive fallback previously told users to run bare
    rocm "to choose an install folder". Post-reroute that's wrong on both counts
    (bare rocm opens the dash chat; the wizard has no folder picker). Now points
    at rocm bootstrap setup and drops the folder-picker wording. (Addresses
    @rominf's review.)

Commit 4 — chat /v1 404 + Esc closes a running serve modal (#68)

UX note (decision + rationale)

Bootstrap adopts the dash onboarding UX (install release wheels to the default
location + adopt-existing-folder).

Test plan

  • cargo fmt --all --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo xtask manifest --check
  • hawkeye check --config licenserc.toml
  • cargo llvm-cov … --fail-under-lines 70 (78.53% lines)
  • cargo test --workspace --all-targets -- --test-threads=1
  • cargo test --workspace --all-targets (parallel)
  • cargo xtask verify-commits --base origin/main (linear onto main; all commits signed + signed-off)
  • Manual: rocm bootstrap setup launches the dash onboarding and installs / adopts (needs an interactive terminal + GPU host)

Note: rebased linearly onto main to drop a GitHub web merge commit that lacked a Signed-off-by trailer (the sole CI failure). #68's squash-merge commit was re-applied here as a signed + signed-off cherry-pick, so its fix is retained on the path to main; the final tree matches the pre-rebase merged state.

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retirement and the dead-code prune look clean — compiler/clippy-driven, no dangling references to the removed helpers, and the bootstrap reroute is wired correctly (the onboarding overlay renders and takes input regardless of the active tab, and nothing else shadows it on the bootstrap path). The split into reroute-then-delete makes a 45k-line removal reviewable. One thing holds me back from approving:

The dropped flags are asserted as intentional but not justified. The UX note says:

The legacy install-folder picker (--prefix) and Release/Nightly channel toggle are intentionally dropped.

"Intentionally dropped" tells us it wasn't an accident, but not why — and these are user-facing capabilities being removed. Could you record the reasoning, for reviewers now and readers later? Specifically:

  • Why drop them rather than carry them into the dash onboarding wizard — a current limitation of the wizard, a deliberate UX simplification, or deferred work?
  • Is losing the install-location choice and the nightly channel acceptable for the bootstrap setup audience, or is a follow-up planned to restore them?

A sentence or two of rationale (plus a tracking issue if it's deferred) would make this tradeoff reviewable rather than just declared.

Related concrete consequence: the non-interactive fallback in run_setup still tells users to "choose an install folder":

"ROCm setup needs an interactive terminal. Run `rocm` from a terminal to choose an install folder and set up ROCm/TheRock."

With the folder picker gone this is now inaccurate, and bare rocm opens the dash chat rather than the setup wizard — so the guidance points at the wrong command too. Worth updating in this PR to point at rocm bootstrap setup and drop the folder-picker wording.

@michaelroy-amd

Copy link
Copy Markdown
Member Author

It was intended but only until my next sprint. Restored in PR #73

…wizard

The legacy bootstrap onboarding lived in apps/rocm/src/tui.rs (fused to
the monolith App/run_loop). The dash crate already has a modern, App-free
onboarding wizard (rocm-dash-tui ui::onboarding over jobs/job_console), so
`rocm bootstrap setup` now launches the dashboard straight into that
overlay instead of the legacy TUI.

- Add ResolvedArgs::start_onboarding; honor it at app startup by opening
  the onboarding overlay.
- Add dash::run_bootstrap (+ testable bootstrap_args helper) mirroring the
  run/run_chat runtime path.
- Rewire bootstrap.rs to call dash::run_bootstrap.
- tui::run_bootstrap_setup is now unused; marked #[allow(dead_code)] for
  this commit only — tui.rs is deleted in the next commit.

UX note: per decision, bootstrap adopts the dash onboarding UX (install
release wheels to the default location + adopt-existing-folder); the legacy
install-folder picker (--prefix) and Release/Nightly toggle are dropped.

Signed-off-by: Michael Roy <michael.roy@amd.com>
`rocm bootstrap setup` now routes to the dash onboarding (previous
commit), so the ~45k-line monolith TUI module is fully unreferenced.

- Delete apps/rocm/src/tui.rs (incl. its test module).
- main.rs: drop `mod tui;`, the _RETAINED_TUI_ENTRY anchor + its guard
  test, and refresh the reroute prose comments.
- Prune helpers that only tui.rs used (compiler/clippy -D warnings driven):
  driver-install TUI-approval cluster (+test), render_sidebar_text +
  friendly_provider_label, freeform_plan_uses_provider, the *_for_tui log
  renderers + logs_browser_page_count, tui_help_text; gate build_freeform_plan
  #[cfg(test)] (now test-only over the live build_freeform_plan_with_recipes).
- comfyui.rs: drop render_tui_status/render_tui_logs/is_installed/running_url
  (+ their tests); keep render_logs/models_folder/render_models_path and the
  unmanaged-url helpers.
- docs/testing.md: remove the obsolete legacy-TUI navigability test list.

The reroute tests (launch_default / Command::Chat must not call tui::run)
are retained and still pass.

Signed-off-by: Michael Roy <michael.roy@amd.com>
Address review on #67: with the reroute to the dash onboarding wizard, the
non-interactive fallback message was inaccurate on two counts — bare `rocm`
now opens the dash chat (not setup), and the guided onboarding no longer has
an install-folder picker. Point users at `rocm bootstrap setup` and drop the
folder-picker wording.

Signed-off-by: Michael Roy <michael.roy@amd.com>
@michaelroy-amd

Copy link
Copy Markdown
Member Author

Thanks @rominf — both points addressed, plus a history cleanup.

  • Non-interactive message (concrete consequence): fixed in a new commit — the fallback now says Run \rocm bootstrap setup` from a terminal to set up ROCm/TheRock., dropping the folder-picker wording and the wrong bare-rocm` guidance.
  • Rationale for the dropped flags: recorded in the UX note.

Separately, this branch's CI was red only on Commit signatures + sign-off: a GitHub web merge commit (resolving conflicts) landed without a Signed-off-by trailer. I rebased the branch linearly onto main, so it's now three signed + signed-off commits with no merge commit — the local verify-commits / clippy / test hooks pass. One side effect worth flagging: that web merge had folded in #68's /v1 chat fix; I dropped it here so #67 is purely the tui.rs retirement, and the /v1 fix stays in #68 (with its review fixes). #68 will re-target main once this lands.

Re-review when you have a moment?

@michaelroy-amd
michaelroy-amd requested a review from rominf July 1, 2026 16:30
* fix(dash): add /v1 to default chat base url + let Esc leave a running job console

Two dash chat usability fixes surfaced when serving a model then chatting:

1. 404 on chat completions. The Rig OpenAI client builds the request URL as
   `base_url + "/" + "chat/completions"`, so `base_url` must end in `/v1`.
   Every endpoint carried it (VLLM_ENDPOINT, LEMONADE_ENDPOINT, managed
   `endpoint_url`) except the probed default `DEFAULT_CHAT_BASE_URL`, so a
   vLLM probed on :8000 was POSTed to `/chat/completions` and answered
   `404 {"detail":"Not Found"}`. Add the `/v1` suffix.

2. Serve modal felt stuck. A managed serve blocks for up to 45s in its HTTP
   readiness wait; during that window the job console is Running, where Esc/Enter
   were swallowed and only `q` closed — but the footer advertised only Ctrl+C, so
   the user had no visible exit. Esc now closes the overlay while a job runs (the
   job keeps running in the background); the footer says so. Finished-job Esc/Enter
   still dismiss back to the screen body. Enter stays inert while running to avoid
   accidental dismissal.

Signed-off-by: Michael Roy <michael.roy@amd.com>

* fix(dash): guard the /v1 default with a revert-proof test + soften doc

Address review on #68:
- probed_default_used_when_nothing_configured_but_reachable only asserted
  base_url == DEFAULT_CHAT_BASE_URL, which is tautological w.r.t. the /v1
  fix. Add an assertion that the *resolved* base_url ends in /v1 — it fails
  when the suffix is reverted (verified), so it actually guards the 404 fix.
- Soften the const doc: VLLM_ENDPOINT / LEMONADE_ENDPOINT share the /v1
  convention and port, not the host (they use localhost, this uses the
  unambiguous IPv4 loopback 127.0.0.1).

Signed-off-by: Michael Roy <michael.roy@amd.com>

---------

Signed-off-by: Michael Roy <michael.roy@amd.com>
@michaelroy-amd

Copy link
Copy Markdown
Member Author

Correction to my previous comment: I had it backwards on #68.

#68 was merged into this branch (retire-legacy-tui), not into main — so its fix reaches main through this PR. My initial rebase dropped that squash-merge commit; I've since re-applied it as a signed + signed-off cherry-pick, so #68's /v1 + Esc fix (with its review follow-ups) is retained here.

Final branch: 4 commits, linear on main, all signed + signed-off. Verified the resulting tree matches the pre-rebase merged state exactly (aside from the Commit 3 message fix). No functional change was lost.

Retiring apps/rocm/src/tui.rs removed its test module, which held ~40 of
the test names docs/testing.md invokes by exact name (onboarding/folder
validation, log pagination, proposal-approval, provider-key confirmation,
TUI mode-state, and the proposal_sandbox_args/*_cache_warm builders). Those
`cargo test <name>` filters now match zero tests silently, so the doc read
as covered when the coverage is gone. Remove the stale references, collapse
the now-single-entry blocks, and keep only the tests that still exist.

Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — this addresses my earlier review, and the split-out was the right call.

Verified during review:

  • The dead-code prune is complete and correct: every removed symbol (comfyui render_tui_status/render_tui_logs/is_installed/running_url, the driver-install TUI-approval cluster, render_sidebar_text, friendly_provider_label, freeform_plan_uses_provider, the *_for_tui renderers, logs_browser_page_count, tui_help_text, _RETAINED_TUI_ENTRY) has zero remaining references tree-wide, and every "kept" helper still has live callers. build_freeform_plan's #[cfg(test)] gate is correct (its only caller is also test-gated). cargo build + clippy -D warnings clean.
  • Surviving shipping logic kept its own tests, so no silent coverage regression — the coverage gate (78.53% > 70%) holds.
  • The chat /v1 fix is correct and the regression test is genuinely revert-proof (asserts the resolved probed default ends_with("/v1"), matching Rig's base_url + "/" + path join to .../v1/chat/completions).

I pushed one follow-up commit (docs cleanup): docs/testing.md still invoked ~40 test names by exact name that lived in the deleted tui.rs test module — cargo test <name> matches those silently with 0 tests, so the doc read as covered when it wasn't. Removed the stale references, keeping only tests that still exist.

Non-blocking, for a follow-up (not gating this PR):

  • The production run_setup -> dash::run_bootstrap dispatch has no test; only bootstrap_args is covered.
  • Esc-closes-console now fans out to the other manager screens with no regression test guarding that behavior.
  • Tradeoff worth noting: for an explicitly --foreground serve, Esc drops the wizard state with no in-TUI path back to that still-running job (fine for the default managed path via the Services tab). Consistent with the stated "keeps running in the background" intent — flagging so it's a conscious choice.

@michaelroy-amd
michaelroy-amd added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit df3f666 Jul 1, 2026
14 checks passed
@michaelroy-amd
michaelroy-amd deleted the retire-legacy-tui branch July 1, 2026 18:01
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.

2 participants