Skip to content

fix: commands fail at once when nobody handles them - #6

Merged
mkotelnikov merged 1 commit into
mainfrom
fix/commands-fail-without-handler
Oct 6, 2026
Merged

mkotelnikov merged 1 commit into
mainfrom
fix/commands-fail-without-handler

Conversation

@mkotelnikov

Copy link
Copy Markdown
Contributor

All 34 kernel command declarations used the silent dispatch policy. A call with no handler registered neither resolved nor rejected, and a handler registered later never picked it up. So await cmd.promise hung forever with no error: the pickers or clipboard on Node, or any command called before its fragment started.

  • New policy: the declarations use async now. With no handler, the promise rejects immediately with CommandError { kind: "no-handlers", commandKey }.
  • Unchanged case: a listener that takes the call without settling it (observe-only) still leaves it pending, as before.
  • Tests: the ones that asserted the old "stays unsettled" behaviour now assert the rejection.
  • READMEs: they describe the new failure mode.

Possible impact on apps: code that calls these commands without awaiting or catching, where no handler exists, now gets an unhandled rejection instead of a silent hang.

Checked:

  • all kernel tests pass;
  • the statewalker-ai, statewalker-shell-react and statewalker-knowledge test suites pass against this kernel, built together in the umbrella workspace.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DAiZN6XrTAdQpNN3eXEz2U

All 34 kernel command declarations used the `silent` dispatch policy: a call
with no handler registered neither resolved nor rejected, and a handler
registered later never picked it up, so `await cmd.promise` hung forever
with no error (e.g. pickers or clipboard on Node, a command called before
its fragment started).

They use `async` now: with no handler the promise rejects immediately with
CommandError { kind: "no-handlers", commandKey }. A listener that takes the
call without settling it (observe-only) still leaves it pending, as before.

Tests that asserted the old "stays unsettled" behaviour now assert the
rejection. READMEs describe the new failure mode.

Checked: all kernel tests; statewalker-ai, statewalker-shell-react and
statewalker-knowledge tests against this kernel (umbrella workspace).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DAiZN6XrTAdQpNN3eXEz2U
@mkotelnikov
mkotelnikov merged commit fd2647f into main Oct 6, 2026
2 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.

1 participant