Skip to content

Add restart option after pipeline completion in CLI and Web UI#9

Merged
aonurakman merged 5 commits intomainfrom
copilot/add-restart-option-to-pipeline
Feb 6, 2026
Merged

Add restart option after pipeline completion in CLI and Web UI#9
aonurakman merged 5 commits intomainfrom
copilot/add-restart-option-to-pipeline

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

  • Headless CLI (cli.py): After pipeline completes (success, abort, or failure), prompt user with 🔄 Run another calibration? [y/N] to perform another calibration or end the session. Pipeline execution is wrapped in a loop; run_id is auto-cleared for each new iteration.
  • Web UI - JavaScript (app.js): When the pipeline completes, fails, or is aborted, status is detected via the /progress endpoint (no extra /status polling) and a restart bar is shown. resetUI() fully resets progress panel, stepper, logs, and restart bar.
  • Web UI - Template (index.html): Added restart bar card in the progress panel with event listener wired in JS (no inline onclick).
  • Backend (routes.py): /progress endpoint now includes status field to avoid separate /status polling.
  • Tests (test_restart.py): 6 tests for _prompt_restart() covering yes, Yes, no, empty, EOF, and 'yes'-word rejection.
  • PR review feedback addressed:
    • Handle aborted as terminal state alongside completed/failed
    • Eliminate separate /status polling by including status in /progress response
    • Remove inline onclick handler, wire restart button via addEventListener
    • Handle KeyboardInterrupt inside cmd_run() loop so Ctrl+C offers restart
  • Code review and security scan: No vulnerabilities found.
Original prompt

This section details on the original issue you should resolve

<issue_title>[RESTART?] option not implemented</issue_title>
<issue_description>Once the pipeline is finished, the user isn't given the option to perform another calibration or end the session. This should be implemented in both UI and headless modes.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 6, 2026 17:40
Co-authored-by: aonurakman <65921615+aonurakman@users.noreply.github.com>
Co-authored-by: aonurakman <65921615+aonurakman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add restart option for pipeline completion Add restart option after pipeline completion in CLI and Web UI Feb 6, 2026
Copilot AI requested a review from aonurakman February 6, 2026 17:44
@aonurakman aonurakman requested a review from Copilot February 6, 2026 17:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “restart calibration” flow so users can run multiple calibrations in the same session, both in the headless CLI and the Web UI.

Changes:

  • CLI: wraps cmd_run pipeline execution in a loop and prompts 🔄 Run another calibration? [y/N] after each run, clearing args.name between iterations.
  • Web UI: detects terminal run states during progress polling and displays a restart bar with a “Start New Calibration” action that calls resetUI().
  • Tests: adds unit tests for the CLI _prompt_restart() behavior across common inputs and EOF.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
demandify/cli.py Adds _prompt_restart() and loops cmd_run() to allow repeated headless runs.
demandify/static/js/app.js Adds status checks during progress updates and shows a restart option on completion/failure.
demandify/templates/index.html Adds a restart bar UI element and restart button.
tests/test_restart.py Adds unit tests for _prompt_restart().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread demandify/static/js/app.js Outdated
Comment thread demandify/static/js/app.js Outdated
Comment thread demandify/static/js/app.js Outdated
Comment thread demandify/templates/index.html Outdated
Comment thread demandify/cli.py
aonurakman and others added 2 commits February 6, 2026 18:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…move inline onclick, catch KeyboardInterrupt in loop

Co-authored-by: aonurakman <65921615+aonurakman@users.noreply.github.com>
@aonurakman aonurakman marked this pull request as ready for review February 6, 2026 18:03
@aonurakman aonurakman merged commit 1bbaff4 into main Feb 6, 2026
1 check passed
@aonurakman aonurakman deleted the copilot/add-restart-option-to-pipeline branch February 6, 2026 18:04
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.

[RESTART?] option not implemented

3 participants