Skip to content

fix: cleanup MITM hosts on exit#2216

Open
manhdzzz wants to merge 1 commit into
decolua:masterfrom
manhdzzz:fix/cli-cleanup-mitm-hosts-on-exit
Open

fix: cleanup MITM hosts on exit#2216
manhdzzz wants to merge 1 commit into
decolua:masterfrom
manhdzzz:fix/cli-cleanup-mitm-hosts-on-exit

Conversation

@manhdzzz

@manhdzzz manhdzzz commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Fix a shutdown bug where MITM hosts entries could remain after exiting 9Router.

Root cause

The CLI force-kills the Next.js process with SIGKILL before its cleanup handlers can run, so DNS/hosts cleanup may never execute.

Changes

  • Add cleanupMitmHosts.js for CLI-level hosts cleanup.
  • Run hosts cleanup before terminating child processes.
  • Gracefully send SIGTERM to the Next.js process before falling back to SIGKILL.
  • Ensure update/restart paths also clean up hosts entries.

Result

  • Temporary MITM hosts entries are reliably removed when exiting, restarting, or updating the CLI.
  • The Error:
    "There was an unexpected issue setting up your account."
    when launching Antigravity without 9router enabled has been fixed.

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