fix(coding-agent): tear down extension UI before runner invalidation on shutdown (#3597)

Custom footers registered via ctx.ui.setFooter(...) whose render()
closure touched ctx would crash pi on /quit: runtimeHost.dispose()
invalidates the extension runner before the TUI stops rendering, so
any still-attached footer render tick hit assertActive() and threw.

Call resetExtensionUI() before runtimeHost.dispose() in the interactive
shutdown path, matching the rebindCurrentSession() pattern. This
disposes the custom footer (clearing its interval) and detaches it
from the TUI tree before the runner goes stale.

closes #3595

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
Vegard Stikbakke
2026-04-23 21:02:15 +02:00
committed by GitHub
parent ab744e216d
commit ff220fa41d
2 changed files with 2 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
### Fixed
- Fixed crash on `/quit` when an extension registers a custom footer whose `render()` accesses `ctx`, by tearing down extension-provided UI before invalidating the extension runner during shutdown ([#3595](https://github.com/badlogic/pi-mono/issues/3595))
- Fixed `pi-coding-agent` shipping `uuid@11`, which triggered `npm audit` moderate vulnerability reports for downstream installs; the package now depends on `uuid@14` ([#3577](https://github.com/badlogic/pi-mono/issues/3577))
- Fixed `ctx.ui.setWorkingMessage()` to persist across loader recreation, matching the behavior of `ctx.ui.setWorkingIndicator()` ([#3566](https://github.com/badlogic/pi-mono/issues/3566))
- Fixed coding-agent `fs.watch` error handling for theme and git-footer watchers to retry after transient watcher failures such as `EMFILE`, avoiding startup crashes in large repos ([#3564](https://github.com/badlogic/pi-mono/issues/3564))

View File

@@ -3182,6 +3182,7 @@ export class InteractiveMode {
if (this.isShuttingDown) return;
this.isShuttingDown = true;
this.unregisterSignalHandlers();
this.resetExtensionUI();
await this.runtimeHost.dispose();
// Wait for any pending renders to complete