refactor: replace robot3 with local useReducer-based state machine - #2555
Draft
serikjensen wants to merge 2 commits into
Draft
refactor: replace robot3 with local useReducer-based state machine#2555serikjensen wants to merge 2 commits into
serikjensen wants to merge 2 commits into
Conversation
serikjensen
force-pushed
the
claude/sdk-state-machine-refactor-2c4e9d
branch
2 times, most recently
from
August 18, 2026 18:53
f2fff79 to
bbeb922
Compare
…e machine Replace the external robot3 (v1.2.0) and react-robot (v1.2.1) dependencies with a local state machine library built on React's useReducer. This resolves machine lifecycle issues causing partner bugs (AMEX, BQE) where robot3's interpreter mishandled machine identity changes and silently swallowed events. The new implementation at src/lib/state-machine/ provides the same DSL (state, transition, guard, reduce, createMachine) with: - useReducer as the React integration (no mutable service objects) - Dev-mode console.warn for unhandled events (robot3 swallowed silently) - Clean re-initialization when machine reference changes - Zero external dependencies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename single-letter loop variables in applyTransition for clarity (t→candidate, r→reducer, t→def). Rename ApplyResult→TransitionResult. Migrate 8 files added on main that still imported from robot3/react-robot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
serikjensen
force-pushed
the
claude/sdk-state-machine-refactor-2c4e9d
branch
from
August 24, 2026 15:28
bbeb922 to
dd18d31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
robot3(v1.2.0) andreact-robot(v1.2.1) with a local state machine library atsrc/lib/state-machine/useReducer, eliminating mutable service objects and manual re-render tricksconsole.warnfor unhandled events (robot3 swallowed silently)Test plan
🤖 Generated with Claude Code