Skip to content

fix: normalize selectors and ban conditional empty spreads - #31

Merged
K-Mistele merged 5 commits into
mainfrom
debug-grok-agent-tool-compatibility-issues
Sep 1, 2026
Merged

fix: normalize selectors and ban conditional empty spreads#31
K-Mistele merged 5 commits into
mainfrom
debug-grok-agent-tool-compatibility-issues

Conversation

@K-Mistele

@K-Mistele K-Mistele commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • normalize blank optional subagent selector strings before enforcing the exactly-one selector invariant
  • preserve dispatch, resume, and fork behavior for Grok-style empty-string / false placeholders
  • vendor and enable anti-slop/no-conditional-empty-object-spread from K-Mistele/anti-slop at cf9bad836a7ba5562f5167a3471c97a1849a9f5f
  • replace all 145 detected conditional empty-object spreads with typed local builders: create the stable object once, then assign optional properties only when present
  • retain direct control-flow branches only for genuinely distinct semantic or discriminated variants; never use a whole-object ternary merely to evade the rule

Context

Grok 4.6 emitted agent_id: "" for inactive selectors. The prior parser counted that as active, so even intended fork calls failed before a child agent launched. Codex omits these inactive fields.

Validation

  • bun run lint — 0 errors (existing warnings only)
  • bun run format:check
  • bun run typecheck
  • bun run test
  • git diff --check

Release

The selector normalization is a consumer-visible @humanlayer/fold-core bug fix. Fold uses tag-based releases (no Changesets); publish it in the next patch tag, v0.1.17, then bump Synclayer's Fold dependencies. The conditional-spread rule and migration are internal tooling/maintenance changes.

@K-Mistele K-Mistele changed the title fix: normalize blank subagent selectors fix: normalize selectors and ban conditional empty spreads Sep 1, 2026
@K-Mistele
K-Mistele merged commit f5e85a9 into main Sep 1, 2026
5 checks passed
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