Require meaningful slugs for spawned workers#4621
Merged
Merged
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4621 +/- ##
==========================================
+ Coverage 71.68% 71.70% +0.01%
==========================================
Files 84 84
Lines 10155 10162 +7
Branches 3252 3254 +2
==========================================
+ Hits 7280 7287 +7
Misses 2855 2855
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KyleAMathews
force-pushed
the
spawn-worker-slug
branch
from
June 17, 2026 22:59
2f86849 to
a20bc8e
Compare
Contributor
Electric Agents Mobile BuildLocal mobile checks ran for commit The EAS Android preview build was skipped because the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Require
spawn_workercalls to include a meaningful slug, then append a short random suffix so spawned worker URLs are readable and generally unique. This makes child worker paths easier to identify in wake messages, logs, and the UI.Root Cause
Workers previously used an opaque
nanoid(10)id, so spawned worker URLs were unique but not meaningful. When multiple workers were dispatched, agents and humans had to infer purpose from surrounding context instead of the worker path itself.Approach
slugparameter to thespawn_workertool schema.-spawn_workerid parameter.@electric-ax/agents.Key Invariants
ctx.spawn.runFinishedwake with response remains enabledNon-goals
Trade-offs
The implementation uses a small random suffix rather than UUID/nanoid-level entropy to keep worker URLs compact. That preserves readability while still avoiding collisions in normal use. Slugs are capped at 48 characters to avoid unwieldy URLs, at the cost of truncating very long model-provided labels.
Verification
pnpm --filter @electric-ax/agents typecheck pnpm --filter @electric-ax/agents exec vitest run test/spawn-worker-tool.test.ts GITHUB_BASE_REF=main node scripts/check-changeset.mjsFiles changed
.changeset/meaningful-worker-slugs.md@electric-ax/agents.packages/agents/src/tools/spawn-worker.tsslug.packages/agents/test/spawn-worker-tool.test.tspackages/agents/src/agents/horton.tspackages/agents/src/tools/fork.tsspawn_workerid behavior.