Skip to content

fix(platform): hide uninstalled app agents from assignee and mention pickers#2578

Closed
larryro wants to merge 2 commits into
mainfrom
tale/xx7aqp42vdrzprgjswbfrty7ks8a5833
Closed

fix(platform): hide uninstalled app agents from assignee and mention pickers#2578
larryro wants to merge 2 commits into
mainfrom
tale/xx7aqp42vdrzprgjswbfrty7ks8a5833

Conversation

@larryro

@larryro larryro commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • listAgents enumerated app-owned agents by scanning every bundle on disk under org/apps/, including uploaded-but-never-installed private apps.
  • Switched to listAppInstallationsInternal (the appInstallations DB table) so only installed apps contribute agents to the task assignee picker and comment @-mention picker.
  • Clarified listInstalledAppSlugsFromDisk doc comment: disk bundles ≠ installed apps.

Closes #2564

Test plan

  • convex/agents/file_actions.test.tslistAgents lists app agents only for installed apps; returns none when nothing is installed
  • convex/apps/install_mutations.test.tslistAppInstallationsInternal returns only slugs with an appInstallations row
  • Manual: upload a private app without installing → agents absent from assignee/@-mention pickers; install → appear; uninstall → gone

Definition of done

  • Green gate — regression tests pass locally (file_actions.test.ts 23/23)
  • Security gate — no boundary changes; read-only query swap
  • Tests — handler unit tests + query integration test added
  • Migration — N/A (no schema change)
  • Locales — N/A (backend-only)
  • Docs — N/A (internal behaviour fix)
  • Accessibility — N/A (no UI changes)
  • Sweepworkflows/file_actions.ts still uses disk scan for automations list (out of scope per issue)
  • Observed — unit tests verify installed-only enumeration
  • Commits — single atomic conventional commit on desk branch

Made with Cursor

…pickers

listAgents scanned every on-disk app bundle under org/apps/, so uploaded-but-
never-installed private apps leaked agents into assignee and @-mention pickers.
Use appInstallations rows via listAppInstallationsInternal instead.

Closes #2564

Co-authored-by: Cursor <cursoragent@cursor.com>
@larryro

larryro commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Desk reviewer grade — #2564

Code verdict: Approve — the fix correctly addresses the reported bug.

What works

  • Root cause confirmed: listAgents used listInstalledAppSlugsFromDisk, listing every bundle under org/apps/ including uploaded-but-never-installed private apps.
  • Fix is minimal and reuses the authoritative signal: listAppInstallationsInternal (appInstallations rows), already used by builtin_sync.ts.
  • Picker data path confirmed: useActorDirectoryuseListAgentsapi.agents.file_actions.listAgents feeds assignee and @-mention pickers.
  • Uninstall case covered: private bundles remain on disk, but DB row deletion correctly hides agents.
  • Doc comment on listInstalledAppSlugsFromDisk clarifies disk bundles ≠ installed apps.

Tests

bunx vitest --run --project server convex/agents/file_actions.test.ts23/23 passed. Regression tests lock the listAppInstallationsInternal query swap.

Nits (non-blocking):

  • issue-desk-qa/ exclusion assertion is tautological with current mocks.
  • listAppInstallationsInternal does not filter uninstalling: true rows.
  • Commit includes Co-authored-by: (repo discourages).

CI gate (blocking merge per desk rules)

Check Status
Unit, Lint, Type, Migrations, Opengrep
Playwright (platform 1–16) ModulesTooLarge (42.97 MiB > 42.92 MiB) — environmental; main is green
Validate images ❌ 39/40
Smoke test ⏳ pending at review

Overall desk verdict: NOT READY — CHANGES REQUIRED (code is sound; CI not green).

@larryro larryro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Desk reviewer grade — #2564 (rework 1/3)

Code verdict: Approve — the fix correctly addresses the reported bug. No code changes since prior review (db1a3de98).

What works

  • Root cause confirmed: listAgents used listInstalledAppSlugsFromDisk, listing every bundle under org/apps/ including uploaded-but-never-installed private apps.
  • Fix is minimal and reuses the authoritative signal: listAppInstallationsInternal (appInstallations rows), already used by builtin_sync.ts.
  • Picker data path confirmed: useActorDirectoryuseListAgentsapi.agents.file_actions.listAgents feeds assignee and @-mention pickers.
  • Uninstall case covered: private bundles remain on disk, but DB row deletion correctly hides agents.
  • Doc comment on listInstalledAppSlugsFromDisk clarifies disk bundles ≠ installed apps.

Tests

bunx vitest --run --project server convex/agents/file_actions.test.ts -t "listAgents app scope"2/2 passed (23/23 full file). Regression tests lock the listAppInstallationsInternal query swap.

Nits (non-blocking, unchanged from prior review):

  • issue-desk-qa/ exclusion assertion is tautological with current mocks — stub a second on-disk-only bundle to make the negative case meaningful.
  • listAppInstallationsInternal does not filter uninstalling: true rows (agents may linger briefly mid-uninstall; same pattern as builtin_sync.ts).
  • Commit includes Co-authored-by: (repo discourages).

Automated review rounds

  • Round 1 (adversarial): Correctness, security/boundaries, reuse, tests, blast radius — no blocking code defects.
  • Round 2 (confirmation): CI failures reproduced; confirmed unrelated to four-file backend diff. Main Build also fails Validate images; #2579 documents repo-wide ModulesTooLarge regression on main.
  • Bugbot / security-review: Could not compute branch diff in harness; manual read covered same axes. No security issues.

CI gate (blocking merge per desk rules)

Check Status Notes
Unit, Lint, Type, Migrations, Opengrep, UI, Browser
Smoke test Cleared since prior review
Playwright (platform 1–16) ModulesTooLarge (42.97 MiB > 42.92 MiB) — repo-wide infra (#2579), not introduced by this PR
Validate images 39/40 — also fails on main@84384c25a

Overall desk verdict: NOT READY — CHANGES REQUIRED — implementation is merge-ready; CI gate is not green.

Simulate an on-disk-only issue-desk-qa bundle and assert readdir is never
called for it when only issue-desk is installed.

Co-authored-by: Cursor <cursoragent@cursor.com>

@larryro larryro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Desk reviewer grade — #2564 (rework 2/3)

Code verdict: Approve — fix is correct and complete; rework 2 addresses the prior test nit.

What works

  • Root cause fixed: listAgents no longer calls listInstalledAppSlugsFromDisk (every bundle under org/apps/). It now queries listAppInstallationsInternal, the authoritative appInstallations signal — same pattern as builtin_sync.ts.
  • Picker path confirmed: useActorDirectoryuseListAgentsapi.agents.file_actions.listAgents feeds both the task Assignee picker and comment @-mention picker.
  • Uninstall case covered: private bundles remain on disk after uninstall, but DB row deletion correctly hides agents.
  • Doc comment clarified: listInstalledAppSlugsFromDisk now documents disk bundles ≠ installed apps; hub listing still uses disk scan as intended.
  • Rework 2 test improvement: file_actions.test.ts now simulates an on-disk-only issue-desk-qa bundle and asserts readdir is never called for it when only issue-desk is installed — the negative case is no longer tautological.

Tests

bunx vitest --run --project server convex/agents/file_actions.test.ts -t "listAgents app scope"2/2 passed.

Automated review rounds

  • Round 1 (adversarial): Correctness ✓ — query swap fixes uploaded-but-uninstalled leak and post-uninstall disk retention. Security/boundaries ✓ — requireOrgMembershipById still gates the action; internal query uses the same organizationId. Reuse ✓ — no divergent install signal. Tests ✓ — handler + query regression. Blast radius swept ✓ — workflows/file_actions.ts disk scan acknowledged out of scope.
  • Round 2 (confirmation): Bugbot/security-review harness could not compute branch diff; manual read covered same axes. CI failures reproduced and confirmed unrelated to the four-file backend diff.
  • Non-blocking nits: listAppInstallationsInternal does not filter uninstalling: true rows (agents may linger briefly mid-uninstall; same as builtin_sync.ts). Commits include Co-authored-by: (repo discourages).

CI gate

Check Status Notes
Unit, Lint, Type, Migrations, Opengrep, UI, Browser, Smoke test
Playwright (platform 1–16) ModulesTooLarge (42.97 MiB > 42.92 MiB) on Convex deploy — repo-wide infra (#2579), not introduced by this PR
Validate images sandbox-runtime 4878 MB > 4400 MB budget — repo-wide infra, unrelated to #2564

Overall desk verdict: READY — infra CI red only

yannickmonney added a commit that referenced this pull request Jul 11, 2026
71 sub-issues of the Improvements/Bugs/Performance umbrella epics fixed
in one sweep: task-assignment liveness, automation install/readiness and
schedule validation, contacts-merge fallout incl. the customerId contract
phase, governance editors, server-side attachment caps on chat and
conversations, SVG/mermaid sanitization, discussion agent mentions, org
provisioning recovery, provider/SSO ergonomics, agent-editor validation,
metrics consolidation under Settings, cold-load auth-handshake collapse,
legacy-volume upgrade recovery, design/ + designs/ directory merge,
prompts, docs and guides, crawler linkedom swap, E2E boot probe — plus
same-class sweep siblings, absorbed PR #2578, a port of PR #2561, and
all adversarial-review findings, incl. a versioned migration upgrading
per-org run-assigned-task packs.

Squashed by request; per-issue detail in the PR description.
@yannickmonney

Copy link
Copy Markdown
Contributor

Absorbed into #2674 (merged with a semantic conflict resolution onto the automations-renamed module: installations-query-based listing, test mocks updated) — plus the same installed-only fix applied to the workflows surface, which had the identical uploaded-bundle bug. #2674 closes #2564's parent class; recommend closing this PR.

yannickmonney added a commit that referenced this pull request Jul 12, 2026
71 sub-issues of the Improvements/Bugs/Performance umbrella epics fixed
in one sweep: task-assignment liveness, automation install/readiness and
schedule validation, contacts-merge fallout incl. the customerId contract
phase, governance editors, server-side attachment caps on chat and
conversations, SVG/mermaid sanitization, discussion agent mentions, org
provisioning recovery, provider/SSO ergonomics, agent-editor validation,
metrics consolidation under Settings, cold-load auth-handshake collapse,
legacy-volume upgrade recovery, design/ + designs/ directory merge,
prompts, docs and guides, crawler linkedom swap, E2E boot probe — plus
same-class sweep siblings, absorbed PR #2578, a port of PR #2561, and
all adversarial-review findings, incl. a versioned migration upgrading
per-org run-assigned-task packs.

Squashed by request; per-issue detail in the PR description.
@larryro

larryro commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as superseded: absorbed into #2674 (merged 2026-07-12), which also applied the same installed-only fix on the workflows surface. See Yannick's comment above.

@larryro larryro closed this Jul 13, 2026
@yannickmonney
yannickmonney deleted the tale/xx7aqp42vdrzprgjswbfrty7ks8a5833 branch July 13, 2026 11:35
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.

Bug: agents from an uploaded-but-never-installed app appear in task assignee and @-mention pickers

2 participants