Skip to content

Recover from completion panics#81

Open
M09Ic wants to merge 1 commit into
reeflective:mainfrom
M09Ic:pr/console-completion-panic-recover
Open

Recover from completion panics#81
M09Ic wants to merge 1 commit into
reeflective:mainfrom
M09Ic:pr/console-completion-panic-recover

Conversation

@M09Ic

@M09Ic M09Ic commented Jun 27, 2026

Copy link
Copy Markdown

Background

A panic during completion currently escapes the completion path and can bring down an interactive console. Completion is usually triggered while typing, so a single bad completer or transient command-tree state should degrade into a visible completion error instead of crashing the process.

Approach

  • Add a deferred recover around Console.complete.
  • Return a readline completion message containing the panic value.
  • Reset the menu command state after a recovered panic so the next completion starts from a clean command tree.

Tests

  • Added a regression test that forces a nil command-tree panic and verifies complete does not panic.
  • Ran go test ./...

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