Skip to content

perf(workspace): eliminate global personal-thread membership scans - #883

Merged
zomux merged 1 commit into
developfrom
codex/scoped-personal-membership
Oct 28, 2026
Merged

zomux merged 1 commit into
developfrom
codex/scoped-personal-membership

Conversation

@zomux

@zomux zomux commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Workspace discovery and visibility checks repeatedly built a global exclusion set from channel_members when identifying personal Yumi threads. Under production load this scanned roughly 37,500 non-Yumi memberships per invocation, even for workspaces with only one channel.

Use channel-correlated EXISTS/NOT EXISTS probes so PostgreSQL can use the existing (channel_id, agent_name) primary key. Personal-thread classification and access boundaries are preserved, including mixed-agent threads, the no-response sentinel, ownerless channels, and workspace isolation. No schema or data changes.

Validation:

  • Bounded read-only PostgreSQL EXPLAIN ANALYZE on three production workspaces: old query 197–327 ms; new query 0.085–0.157 ms, using index-only membership probes. Old/new result sets matched within repeatable-read snapshots. These are query timings, not end-to-end API timings.
  • 103 tests passed across personal-assistant, access-model, visibility, stream privacy, personal files, personalization and Yumi coverage. Two existing Yumi tool tests fail identically with the unchanged production implementation (pairing now requires sign-in; master mode has been removed).
  • Added classification coverage and an indexed-query regression test; verified the latter fails on the old implementation's membership scans and passes on this change.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openagents-workspace Ready Ready Preview Oct 28, 2026 8:05am UTC

Request Review

@zomux
zomux merged commit 7db18e6 into develop Oct 28, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 62037b22 Deployed Oct 28, 2026 by vercel[bot]
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