Skip to content

Reduce desktop new session lookup overhead / 减少桌面新建会话查找开销#4395

Merged
esengine merged 1 commit into
main-v2from
fix/desktop-topic-session-index-cache
Jun 14, 2026
Merged

Reduce desktop new session lookup overhead / 减少桌面新建会话查找开销#4395
esengine merged 1 commit into
main-v2from
fix/desktop-topic-session-index-cache

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Avoid repeated full session scans when initializing new tabs by using a cached topic-session directory index.
  • Speed up legacy session migration with session-order metadata and lighter filtering before loading full session previews.
  • Invalidate the topic-session index on metadata updates and cover cache-refresh/title-propagation behavior with regression tests.

Fixes #4385

Validation

  • go test ./...
  • go test ./... (from desktop/ module)

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
@SivanCola SivanCola requested a review from esengine as a code owner June 14, 2026 14:57
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) agent Core agent loop (internal/agent, internal/control) labels Jun 14, 2026
@SivanCola

Copy link
Copy Markdown
Collaborator Author

Implemented the requested performance fix in this PR and verified the change addresses #4385.

Summary

  • Added a topic-session directory index and reused it in session bootstrap to avoid repeated full-session scans during new session creation.
  • Reworked legacy migration scan path to use session-order metadata first, then load full preview only for candidates.
  • Added index invalidation on metadata writes and regression coverage for index refresh and title propagation.

Validation

  • go test ./...
  • go test ./... (from desktop/ module)

If this is accepted, please review against main-v2 as is.

@esengine esengine merged commit d22a852 into main-v2 Jun 14, 2026
14 checks passed
@esengine esengine deleted the fix/desktop-topic-session-index-cache branch June 14, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) 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.

[Performance] Creating a new session hangs/freezes due to multiple full session-directory scans

2 participants