Skip to content

Fix: getExpertScope fails for versioned expert keys#614

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/expert-scope-versioned-keys
Feb 24, 2026
Merged

Fix: getExpertScope fails for versioned expert keys#614
FL4TLiN3 merged 2 commits intomainfrom
fix/expert-scope-versioned-keys

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • getExpertScope() returned the full key including @version/@tag suffix for coordinator experts, causing validateDelegation() to reject valid same-scope delegations
  • Production job executor was failing with ZodError: Expert "weather-reporter@draftRefId" cannot delegate to out-of-scope delegate "@weather-reporter/data-fetcher@draftRefId"
  • Fix getExpertScope() to strip @version/@tag suffix from coordinator keys
  • Fix getExpertShortName() to strip version suffixes from both coordinator and delegate keys
  • Fix validateDelegation() delegate-to-own-coordinator check to use getExpertScope() instead of direct string comparison

Test plan

  • Added unit tests for getExpertScope with versioned/tagged coordinator and delegate keys
  • Added unit tests for getExpertShortName with versioned keys
  • Added unit tests for validateDelegation with versioned keys (valid and invalid cases)
  • Added expertSchema.parse() tests for versioned and tagged key delegation
  • All existing tests pass (no regressions)
  • bun test, typecheck, biome check all pass

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits February 24, 2026 08:27
getExpertScope() returned the full key including @version/@tag suffix
for coordinator experts, causing validateDelegation() to reject valid
same-scope delegations when keys contain version suffixes (e.g.,
"weather-reporter@draftRefId" vs "@weather-reporter/data-fetcher@draftRefId").

Also fix getExpertShortName() to strip version suffixes from both
coordinator and delegate keys, and update validateDelegation() to use
getExpertScope() for the delegate-to-own-coordinator check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit 33bd794 into main Feb 24, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 24, 2026
@FL4TLiN3 FL4TLiN3 deleted the fix/expert-scope-versioned-keys branch February 25, 2026 13:37
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