Skip to content

Fix desktop tab event deadlock / 修复桌面多标签事件死锁#4389

Merged
esengine merged 3 commits into
main-v2from
fix/desktop-async-runtime-events
Jun 14, 2026
Merged

Fix desktop tab event deadlock / 修复桌面多标签事件死锁#4389
esengine merged 3 commits into
main-v2from
fix/desktop-async-runtime-events

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • decouple desktop tab runtime event forwarding from the synchronous agent event sink path
  • keep per-tab Wails event delivery ordered while avoiding blocked runtime.EventsEmit calls holding event.Sync locks
  • route project tree change notifications through the same async runtime event bridge

Fixes #4386.

Testing

  • go test . -run 'TestTabEventSinkDoesNotBlockOnRuntimeEventsEmit|TestEmitProjectTreeChangedDoesNotBlockOnRuntimeEventsEmit' (from desktop module)
  • go test . (from desktop module)
  • go test ./... (from repository root)
  • go test ./... (from desktop module)
  • git diff --check

Keep tab-scoped runtime events ordered while preventing a blocked Wails runtime.EventsEmit call from holding the agent event sink lock. Route project tree notifications through the same async bridge and clear queued tab events when a tab is closed.

Fixes #4386
@SivanCola SivanCola requested a review from esengine as a code owner June 14, 2026 14:08
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3063cc5932

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/tabs.go Outdated
Split the tab sink cleanup path into clearContext so staticcheck does not see nil passed as a context.Context argument while preserving queued event cleanup when tabs close.
Use a head-indexed async runtime event queue so recovering from a blocked Wails runtime event bridge preserves FIFO delivery without shifting the remaining backlog for every event.
@SivanCola SivanCola enabled auto-merge June 14, 2026 14:40
@esengine esengine merged commit f447770 into main-v2 Jun 14, 2026
13 checks passed
@esengine esengine deleted the fix/desktop-async-runtime-events branch June 14, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Multi-tab freeze: switching between concurrently running tabs causes both to deadlock

2 participants