Skip to content

Return explicit unconfirmed restart result for missing adapter replies - #188

Merged
Oz Zafar (ozzafar) merged 1 commit into
mainfrom
fix/172-cortex-restart-completion
Oct 25, 2026
Merged

Oz Zafar (ozzafar) merged 1 commit into
mainfrom
fix/172-cortex-restart-completion

Conversation

@ozzafar

Copy link
Copy Markdown
Contributor

Summary

Fixes #172.

Cortex-Debug can emit continued/stopped events after restarting without sending a response to the original restart request. The existing #160 timeout bounds the wait but still blocks until the configured timeout.

  • Race the executor acknowledgement against a fresh stopped-event sequence in the same session.
  • Keep the existing successful response when restart is acknowledged.
  • Return promptly with an explicit completion-unconfirmed warning when a fresh stop is observed without acknowledgement. This does not claim that every restart command succeeded.
  • Preserve failures received before the result; log later failures after an unconfirmed result without unhandled rejections.
  • Keep the operation timeout when neither signal arrives, and stop observation polling when the call returns.
  • Do not treat an old paused state, UI-only changes, running state, or stops from another session as restart observation.
  • Do not cancel, retry, or terminate the underlying restart request/session.
  • Update tool guidance and handler architecture documentation.

The maintainer explicitly approved the unconfirmed-result behavior before implementation.

Validation

  • npm run compile, npm run lint, and npm run bundle passed.
  • 88 focused extension-host tests passed: restart, handler, status, and routing.
  • Fake DAP subprocess tests cover acknowledged success, explicit failure after a fresh stop, a missing acknowledgement, no new stop, and a logged late failure after returning unconfirmed.
  • Additional regressions cover other-session stops, unchanged stop sequences, running state, UI-only changes, and polling cleanup after timeout.
  • git diff --check passed.
  • Cortex-Debug/J-Link hardware was not available for live reproduction; tests reproduce the reported standard DAP event and missing-response sequence.

Existing PR check

No matching open PR was found. This branch is independent of #184, #185, #186, and #187.

Not merged; awaiting maintainer confirmation.

…knowledgement

Race restart acknowledgement against a fresh same-session stop. Return an explicit completion-unconfirmed result when execution is observed without acknowledgement, preserving real errors, bounded waits and late-failure logging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a882e001-7e0e-4256-8a20-8eaec9c947f4
@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 1a093fa into main Oct 25, 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

1 participant