Skip to content

Fix thread entity brain split after container restart#17

Merged
lukemarsden merged 1 commit into
mainfrom
fix/thread-entity-brain-split
Mar 4, 2026
Merged

Fix thread entity brain split after container restart#17
lukemarsden merged 1 commit into
mainfrom
fix/thread-entity-brain-split

Conversation

@lukemarsden
Copy link
Copy Markdown

Summary

Test plan

  • build-zed releasebuild-ubuntu → start new session
  • Start a spectask, let it work, then resume the session (simulating container restart)
  • Verify the agent panel rebinds to the new entity (look for "entity changed, rebinding" log)
  • Verify Zed display updates in sync with Helix session after resume

🤖 Generated with Claude Code

After a container restart, the agent panel restores its thread from
persistent state (creating Entity #1), then load_thread_from_agent()
creates a NEW entity (Entity #2) for the same thread when a WebSocket
message arrives. The panel's notify_thread_display() compared session
IDs (identical for both entities) and returned early, never rebinding
to the live entity. Result: Helix saw live updates but the Zed display
was frozen on stale content.

Fix: compare Entity references instead of session IDs so the panel
detects the entity changed and rebinds via from_existing_thread().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lukemarsden lukemarsden merged commit ea6de76 into main Mar 4, 2026
19 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