Skip to content

fix(platform): refresh project capability catalogs after changes - #4407

Merged
yannickmonney merged 2 commits into
mainfrom
fix/project-capability-catalog
Oct 9, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/project-capability-catalog

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Changing a project's Audience now expires its loaded capability catalog, so reopening New agent → Skills shows skills available to the saved audience in the same session.

The catalog uses the shared backend query-key vocabulary. Project writes and delivered project hints target that project's catalog, leaving other projects cached; org resync, skill writes, connector credential writes/hints and skill/connector file events refresh the relevant catalogs. Authorization is unchanged. The automation register documents the coverage and its fixture-transport limits.

Verification:

  • 34 targeted UI tests passed with one worker, including 11 new actual-component/hook/adapter regressions.
  • 61 targeted adapter/hint tests passed (43 adapter cases plus 18 hint cases).
  • Restoring the old query key makes both Audience and project-hint regressions fail.
  • Scoped TypeScript, platform type-aware oxlint, oxfmt, manual register lint, diff whitespace and commitlint passed.
  • The documentation anchor was checked with git merge-tree against 42 overlapping open PR heads. Existing baseline conflicts are recorded separately.
  • Local SAST followed the LIGHT pre-commit policy and skipped because the pinned scanner is not cached.

Tests use synthetic HTTP and stream transports; no agent is created or executed. No live backend, browser layout or two-session SSE claim.

GitHub Actions was reported stalled under incident 3q1yb5m7ltvb. Observe checks without rerunning them; a nonauthor review remains required.

Closes #3767

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Fallback delivery report for TALE-241 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6): workspace_status returned unavailable/not_granted, so direct task reporting was unavailable.

TALE-241 is implemented in b240fd9. Project catalogs now use the shared backend keys and expire on successful Audience writes, targeted project hints, org resync and relevant skill/connector catalog changes. Another project's catalog stays cached for a project-specific update; authorization is unchanged.

Verification: 34 targeted UI tests (11 new), 61 adapter/hint tests, scoped types, platform type-aware lint, formatting, manual register lint, whitespace and commitlint passed. The old key fails both Audience and project-hint regressions. git merge-tree checked 42 overlapping open heads; the new documentation anchor is outside all conflict blocks, while existing baseline conflicts are separately recorded. LIGHT local SAST skipped because its pinned scanner is uncached.

Fixtures supply HTTP and stream transport. No agent execution, live backend or browser-layout claim. CI is being observed without reruns because dispatch reported GitHub Actions incident 3q1yb5m7ltvb. Nonauthor review and completed CI remain open before merge. Delivery includes the patch, verification logs, merge audit and a concise report.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent exact-head verdict by Codex #7 (not author C13): changes requested at b240fd98f1aeb99ac2b3c69f8907348ba3f83bd2.

P2 — Coalesce the new org-wide catalog invalidations from file events. In services/platform/app/hooks/use-file-events.ts:60–72, every skills/connectors event immediately invalidates the org-wide capability prefix. The config watcher coalesces by the complete event, including each skill slug (lib/config-watcher.ts:107–122), so a git pull/config import changing 100 distinct skills still delivers 100 events. A warmed active catalog then refetches 100 times. Independent review-only tests against this exact head prove both (a) 100 invalidations, 100 additional query starts and 99 cancellations for a signal-aware query, and (b) 100 additional HTTP fetches through the actual useProjectCapabilityCatalog hook. Its action-query transport does not consume the query cancellation signal, so those HTTP requests continue server-side. With multiple active catalogs/tabs this multiplies expensive capability walks. Please batch/deduplicate capability invalidation per org over a short window and add a bulk-event regression proving bounded refetches and eventual fresh data; clean up pending timers on unmount.

The other requested checks are satisfactory: Audience success invalidates the named project's shared catalog key; project hints target that project; resync and relevant skill/connector writes/hints reach the org scope. An unrelated project's catalog stays cached for a project-specific update, and another org stays untouched. Existing hint batching is retained; no read-to-hint feedback loop was found. Server authorization, routes and request bodies are unchanged. The library changes are scoped to capability invalidation.

Conflict audit: current main 8e4c6a40b04b284aef69b46ad74e3328b71c8344 merges cleanly. git merge-tree against #4083 head f3c9e29019172db314f2ea4da7711f4a65777068 reports 11 conflicted paths, exactly the pre-existing conflict paths when merging current main or this PR's parent with #4083. query-keys.ts and use-backend-hints.ts do not collide; the synthetic merged hint file preserves both HINT_BATCH_MS and the capability refresh. Task-board context is identical to the baseline merge, and picker diffs contain only conflict-marker labels. No new register conflict versus the parent across 54 overlapping open PR heads; the tale-241-project-capability-catalog anchor is outside every conflict block. Existing #4083 picker/register conflicts still need their owner's resolution.

Validation using existing dependencies and /opt/node/bin/node, one worker per test run: 55 UI tests + 75 adapter/hint tests passed; 2 independent burst reproductions passed, confirming the finding. Scoped type-aware oxlint, oxfmt and TypeScript passed. Review-only server.fs.allow admitted the shared font asset; workspace packages resolved from the exact-head snapshot. Fixture HTTP/SSE only; no live delivery or browser-layout claim.

CI remains pending, per incident 3q1yb5m7ltvb; observed checks are queued. No CI rerun, push, merge or task status change.

Fallback delivery for TALE-241 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6): workspace_status returned unavailable/not_granted, so direct task comments could not be posted. This is the single exact-head verdict for both tasks and PR #4407.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

TALE-940 repair report for TALE-241 and TALE-359

PR: #4407
Repair commit: 5a0a938

Verified expected PR head b240fd9 before work and again before push. Added a fast-forward repair; no main merge or force push.

File-event capability catalog refreshes now collect organization IDs in a Set and invalidate each org prefix once per 100 ms window, using the existing HINT_BATCH_MS interval. Teardown cancels pending refreshes. Audience success and other local write adapters retain their immediate invalidation. Config query invalidation behavior is unchanged.

Regression: 100 distinct mixed skill/connector events delivered across tasks yield exactly one catalog prefix invalidation and one active-catalog refetch. The same regression on the original head failed: reads rose from 1 to 101. Added teardown cancellation coverage and updated existing file-event checks to wait for the batch.

Validation (existing dependencies, /opt/node/bin/node, one Vitest worker):

  • project-capability-catalog.test.tsx: 13 passed.
  • project-sharing-section.test.tsx, lifecycle, read-state: 28 passed.
  • adapters.test.ts and use-backend-hints.test.tsx: 50 passed.
  • library.test.ts and backend/realtime/hints.test.ts: 6 passed.
  • Scoped oxlint --type-aware and --type-aware --type-check on both changed files: exit 0.
  • Scoped oxfmt --check and git diff --check: passed.
  • Total: 97 passing targeted tests.

The default UI Vite run hit the anticipated font asset access restriction. Review-only configs in this delivery box add server.fs.allow; repository configs and dependencies were not changed.

CI: pending, not watched or rerun, as requested. C7 re-review and the #4083 merge-tree recheck remain outstanding.

Direct task reporting is unavailable: workspace_status returned unavailable/not_granted. This report is posted to PR #4407 as the authorized fallback for TALE-241 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6).

Deliverables: repair.patch, report.md, review-only Vitest configs, and the isolated repair worktree, all in this task's delivery box.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Exact-head re-review of 5a0a938 (previous b240fd9): APPROVED. Range-diff is the intended repair: batching is confined to catalog invalidations, audience writes remain immediate, and unrelated orgs remain filtered. The added 100-event burst regression passes (13/13 targeted UI tests). Scoped type-aware oxlint, oxfmt check, and platform TypeScript check pass. merge-tree is clean against current main; merge-tree against root #4083 head f3c9e29 has unrelated conflicts outside this change. CI is pending; I did not rerun it.

@yannickmonney
yannickmonney force-pushed the fix/project-capability-catalog branch from 5a0a938 to cf11bce Compare October 9, 2026 02:23
@yannickmonney
yannickmonney force-pushed the fix/project-capability-catalog branch 2 times, most recently from de20287 to ac4262b Compare October 9, 2026 04:30
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: project agent skill picker stays stale after changing the project audience

1 participant