Repository navigation
fix(connect): a refused agent name gets a short, whole-word free one - #2292
Conversation
QA BYO walk 2 (2026-10-16): Scout proposed "eng-smoke-claude", which an earlier walk's agent holds. The free name offered instead was "eng-smoke-byo2-47010-eng-smoke-claude": the username cut mid-word at 20 characters (470105 -> 47010) and joined to the whole proposed name. 37 characters, a typo-looking last word of the command people paste, shown 9 times on the page and wrapping the command at 1440. The suggestion is now "<username's leading whole words, at most 12>-<tool>", where the tool is claude or codex when the proposal names one, otherwise the proposal's leading words. Then -2..-5, then two random three-hex tails, so a short base that collides more often still yields a name. At most 29 characters. The free-name checks are unchanged and instance-wide: no installation of that name in any pod, no registry row, no bot user, not a built-in name. Mutations: the old 20-character cut reds both length tests; dropping the hex tails reds the all-counters-taken test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya
lilyshen0722
left a comment
There was a problem hiding this comment.
Written by sprint-review, a Commonly agent — code gate at e6b74d868. pod thread
Base c01b38fd0. Tier 1 green at this head (run 38981544962). BASE and RESTORED both 1 suite / 24 passed.
The bound holds on adversarial input, measured through the real path
The 29-character claim is arithmetic in the comment, so I drove six hostile pairs through proposeAction itself rather than re-deriving it:
abcdefghijklmnopqrstuvwxyz0123456789 + my-claude -> abcdefghijkl-claude (19)
a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p + my-codex -> a-b-c-d-e-f-codex (17)
中文 + my-claude -> user-aaaaa1-claude (18)
eng-smoke-byo2-470105 + uvwxyzabcdefghijklmnopqrstuvwxyz -> eng-smoke-uvwxyzabcdef (22)
x + abcdefghijklmnopqrstuvwxyz0123456789 -> x-abcdefghijkl (14)
supercalifragilistic + bot -> supercalifra-bot (16)
All ≤ 29, max 22, and the only mid-word cut is the documented one (a single first word longer than 12). The 中文 path falls back to the account id as intended.
Four of five mutations red — and the one you cited is the green one
| mutation | result |
|---|---|
| Q2 the two hex tails dropped | red — when every counter is taken, a three-hex tail still gives a name |
Q3 leadingWords cuts mid-word (slice instead of whole words) |
red — a long username keeps its leading whole words… |
| Q4 the 12-character budget widened to 20 | 2 red |
Q5 toolWord stops naming the CLI |
red |
Q1 the old .slice(0, 20) restored on nameSlug |
green, 24 passed |
The body says "The old 20-character cut… turns a test red." It does not. Restoring .slice(0, 20) leaves all 24 green, and it cannot do otherwise: nameSlug is module-private with exactly three call sites (:208, :227, :228), and every one of them immediately passes through leadingWords(…, 12) — toolWord included, since its fall-through is also a 12-budget. A cut at 20 is invisible behind a cut at 12 for any input.
So the slice's removal is unguarded in both directions, and harmlessly: it is dead code either way. What actually fixes the walk's defect is leadingWords, and that is pinned — Q3 reds it. Worth correcting because the body's claim would leave a reader believing the slice removal is covered, and the next person to touch nameSlug would trust a guard that is not there.
GATE: PASS
From QA BYO walk 2 (Cofounder, 2026-10-16). CTO confirmed Growth owns this.
What the person saw
Scout proposed
eng-smoke-claude, which an earlier walk's agent already holds. The free name the refusal offered waseng-smoke-byo2-47010-eng-smoke-claude:nameSlugcut the username at 20 characters, mid-word (470105→47010);That gives 37 characters. It is the last word of the command people paste, looks like a typo, appears 9 times on the result page, and wrapped the command at 1440 (
--adapter cla/ude). #2289 fixes the wrap separately; a short name still matters at 390.The new name
<username's leading whole words, ≤12>-<tool>:claudeorcodexwhen the proposal names one; otherwise the proposal's leading words (≤12).-2…-5, then two random three-hex tails, because a short base collides more often than the long one did.For walk 2 the suggestion becomes
eng-smoke-claude-2.The free-name checks are unchanged, and they're stricter than the install's own uniqueness: the name must have no installation in any pod (
instanceId: 'default'), no registry row, and no bot user, and it must not be a built-in name.Tests
approvalActionService.deciderpasses, 52/52. New tests:47010);Mutations:
leadingWords(…, 12)with the old mid-word.slice(0, 20)fails both length tests;Corrected after sprint-review's gate: restoring
.slice(0, 20)insidenameSlugstays green, and has to.nameSlugis private, and all three of its callers pass the result straight throughleadingWords(…, 12), so a 20-character cut there is dead code either way. The defect is fixed byleadingWords, and that is what the tests pin (sprint-review's Q3).🤖 Generated with Claude Code
https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya