@compilr-dev/sdk 0.10.37 → 0.10.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -181,8 +181,21 @@ export function createHandoffTool(config) {
181
181
  error: `Agent "${targetId}" not found in team. Available: ${available}`,
182
182
  };
183
183
  }
184
- // Enforce one-hop rule
185
- if (team.wasHandedTo(currentAgentId) && targetId !== 'default') {
184
+ // Enforce one-hop rule.
185
+ //
186
+ // Intent: prevent endless specialist chains ($arch → $dev → $qa → ...).
187
+ // A specialist that received a handoff can only hand back to the
188
+ // coordinator ($default) — completing one delegation cycle.
189
+ //
190
+ // The coordinator is exempt from the rule. When $default receives a
191
+ // handoff back from a specialist, the previous cycle is complete and
192
+ // the coordinator can route again freely. Without this exemption,
193
+ // group-chat usage breaks: $default hands to $dev, $dev hands back,
194
+ // $default tries to hand to $arch — and the rule wrongly fires
195
+ // because team.wasHandedTo('default') is now true.
196
+ if (currentAgentId !== 'default' &&
197
+ team.wasHandedTo(currentAgentId) &&
198
+ targetId !== 'default') {
186
199
  const source = team.getHandoffSource(currentAgentId);
187
200
  return {
188
201
  success: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.10.37",
3
+ "version": "0.10.38",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",