Skip to content

Comments

Revert "Revert "fix: scope sub_agent_skills unique constraint to tenant/project/agent""#2207

Merged
amikofalvy merged 1 commit intomainfrom
revert-2205-revert-2190-fix/sub-agent-skills-unique-constraint
Feb 20, 2026
Merged

Revert "Revert "fix: scope sub_agent_skills unique constraint to tenant/project/agent""#2207
amikofalvy merged 1 commit intomainfrom
revert-2205-revert-2190-fix/sub-agent-skills-unique-constraint

Conversation

@amikofalvy
Copy link
Collaborator

Reverts #2205

@vercel
Copy link

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 20, 2026 2:28am
agents-docs Ready Ready Preview, Comment Feb 20, 2026 2:28am
agents-manage-ui Ready Ready Preview, Comment Feb 20, 2026 2:28am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: 3bbcfa2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@inkeep/agents-core Patch
@inkeep/agents-api Patch
@inkeep/agents-manage-ui Patch
@inkeep/agents-cli Patch
@inkeep/agents-sdk Patch
@inkeep/agents-work-apps Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch
@inkeep/agents-mcp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@amikofalvy amikofalvy merged commit 56fd821 into main Feb 20, 2026
4 of 9 checks passed
@amikofalvy amikofalvy deleted the revert-2205-revert-2190-fix/sub-agent-skills-unique-constraint branch February 20, 2026 02:24
Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(0) Total Issues | Risk: Low

This PR re-applies the multi-tenant scoping fix for the sub_agent_skills unique constraint (originally from PR #2190, reverted in #2205). The change expands the constraint from (subAgentId, skillId) to (tenantId, projectId, agentId, subAgentId, skillId), properly aligning uniqueness enforcement with the existing FK scoping hierarchy.

🔴❗ Critical (0) ❗🔴

None

🟠⚠️ Major (0) 🟠⚠️

None

🟡 Minor (0) 🟡

None

💭 Consider (1) 💭

Inline Comments:

  • 💭 Consider: subAgentSkills.cross-tenant.test.ts:174 Additional constraint boundary tests for cross-project/cross-agent isolation

✅ APPROVE

Summary: Clean implementation of a multi-tenant isolation fix. The migration safely relaxes the constraint (allows more combinations rather than restricting), the schema change aligns with established patterns in similar join tables, and the tests verify both the fix (cross-tenant isolation) and preserved behavior (same-scope deduplication). The one "Consider" suggestion is for expanded test coverage depth but is not blocking — current tests adequately validate the fix. 🎉

Discarded (0)

No findings were discarded.

Reviewers (4)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-standards 0 0 0 0 0 0 0
pr-review-breaking-changes 4 0 0 0 0 0 4
pr-review-tests 3 0 0 0 1 0 2
pr-review-types 0 0 0 0 0 0 0
Total 7 0 0 0 1 0 6

Note: pr-review-breaking-changes returned 4 INFO-level confirmations that the migration is safe (all assessed as not issues). pr-review-tests returned 2 additional MINOR suggestions that were consolidated into the single inline comment.

})
).rejects.toThrow();
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 Consider Additional constraint boundary tests

Issue: The tests validate cross-tenant isolation and same-scope deduplication, but don't explicitly test cross-project (same tenant) or cross-agent (same tenant/project) isolation at the constraint level.

Why: The unique constraint includes 5 columns: (tenantId, projectId, agentId, subAgentId, skillId). While the cross-tenant test implicitly covers different projects, explicit tests for same-tenant-different-project and same-project-different-agent scenarios would catch subtle constraint regressions (e.g., if projectId or agentId were accidentally removed from the constraint).

Fix: Consider adding tests like:

  • it('should allow same tenant with different projects to use identical sub_agent_id + skill_id')
  • it('should allow different agents in same project to use identical sub_agent_id + skill_id')

This is optional since the existing subAgentSkills.scoping.test.ts tests query-level isolation, but explicit constraint-level tests would provide defense-in-depth.

Refs:

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