## Summary
- Fixes React rule violation in Socket.IO handler in TUI app
- The original code called (a side effect) inside a state updater, which violates React's requirement that state updaters be pure functions
- Fix: use a to track current stream text so can read the final value and update state outside any updater callback
## Changes
- : Added to mirror state; refactored , , and handlers to use ref-based approach; now performs all state updates at the top level without nesting
## Test plan
- [ ] TUI connects to gateway and streams agent responses correctly
- [ ] Streaming text accumulates and is committed to messages list on
- [ ] Model switching () and provider switching () work as before
- [ ] Session management (conversationId tracking) works as before
Closes #133
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Use a ref to track current stream text so agent:end can commit the
final message without calling setMessages inside a setCurrentStreamText
updater function, which violates React's rule that state updaters must
be pure.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Changes
Test plan
Closes #133
🤖 Generated with Claude Code