Commit 6cf779d
fix: scope sub_agent_skills unique constraint to tenant/project/agent (#2190)
* fix: scope sub_agent_skills unique constraint to tenant/project/agent
The unique constraint on sub_agent_skills was only on (sub_agent_id, skill_id),
causing cross-tenant collisions when different tenants use sub-agents with
the same ID and skill. Updated to include tenant_id, project_id, and agent_id.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add cross-tenant regression test for sub_agent_skills unique constraint
Addresses review feedback: verifies different tenants can use the same
(sub_agent_id, skill_id) combination, and same-tenant duplicates are
still blocked.
Also fixes trailing newline in migration SQL.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6dd0e8d commit 6cf779d
File tree
6 files changed
+3868
-1
lines changed- .changeset
- packages/agents-core
- drizzle/manage
- meta
- src
- __tests__/data-access
- db/manage
6 files changed
+3868
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments