Skip to content

Bound restart acknowledgement waits and bump extension to 2.4.2 - #163

Merged
Oz Zafar (ozzafar) merged 1 commit into
mainfrom
fix/160-restart-hang
Sep 27, 2026
Merged

Oz Zafar (ozzafar) merged 1 commit into
mainfrom
fix/160-restart-hang

Conversation

@ozzafar

Copy link
Copy Markdown
Contributor

Summary

  • Bound restart completion by the configured operation timeout using the existing timeout helper.
  • Preserve restart errors and report unacknowledged completion explicitly. A timeout does not cancel the underlying request or automatically retry/reset the target.
  • Remove the fixed 300 ms sleep after acknowledged completion.
  • Add restart regressions and Cortex-Debug troubleshooting guidance.
  • Bump the VS Code extension from 2.4.1 to 2.4.2, including the lockfile and changelog. The standalone npm package remains 0.1.2.

Root cause and scope

Related to #160.

Cortex-Debug v1.12.1 advertises DAP restart support, but its successful restart handler resolves an internal promise without sending the DAP response. The target can reset and emit continued/stopped events while VS Code's restart command remains pending. Its error branch does send a response.

This PR is a client-side safeguard, not a repair of that upstream omission. It deliberately does not interpret an arbitrary stop event as successful restart completion, bypass VS Code's restart lifecycle, or automatically tear down an embedded session. The reporter's exact Cortex-Debug version and DAP trace still need confirmation; newer upstream Cortex-Debug uses a different teardown/relaunch path. This PR therefore does not automatically close #160.

Validation

  • 70 focused tests passed across restart completion, handler behavior, CLI lifecycle, and the timeout helper.
  • Persistent real-DAP regressions cover successful, failed, and missing acknowledgement after a fresh stopped event; handler regressions cover inactive sessions, delayed completion, timeout, and late rejection.
  • An isolated real VS Code/MCP fixture reproduced the missing-response wait. With a 1-second operation timeout, the updated tool returned an actionable error in 1,033 ms; acknowledged success returned in 111 ms and an explicit adapter error in 114 ms.
  • No physical Cortex target reproduction is claimed.

Mitigate #160 without treating target stop events as restart acknowledgement. Preserve adapter errors and document Cortex-Debug's missing-response behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e8c76249-e4b9-47a4-adee-0ef91ec3f978
@github-actions

Copy link
Copy Markdown

✅ Extension Build Successful!

📦 VSIX artifact is ready for download

👉 View artifacts

Scroll down to the "Artifacts" section and download extension-vsix

To install: In VS Code, run Extensions: Install from VSIX... and select the downloaded file.

@ozzafar
Oz Zafar (ozzafar) merged commit 53915b9 into main Sep 27, 2026
3 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.

restart_debugging hangs forever

1 participant