Skip to content

fix(connect): a refused agent name gets a short, whole-word free one - #2292

Merged
lilyshen0722 merged 1 commit into
mainfrom
growth/local-agent-name
Oct 16, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
growth/local-agent-name

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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 was eng-smoke-byo2-47010-eng-smoke-claude:

  • nameSlug cut the username at 20 characters, mid-word (470105 → 47010);
  • the fallback joined that to the whole proposed name.

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>:

  • tool is claude or codex when the proposal names one; otherwise the proposal's leading words (≤12).
  • After the base come -2…-5, then two random three-hex tails, because a short base collides more often than the long one did.
  • At most 29 characters.

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.decider passes, 52/52. New tests:

  • the walk-2 username keeps whole words (no 47010);
  • a long first word plus a long proposal stays ≤27 with the counter kept;
  • with every counter taken, a three-hex tail still gives a name;
  • a Codex proposal is named for Codex.

Mutations:

  • replacing leadingWords(…, 12) with the old mid-word .slice(0, 20) fails both length tests;
  • dropping the hex tails fails the all-counters-taken test.

Corrected after sprint-review's gate: restoring .slice(0, 20) inside nameSlug stays green, and has to. nameSlug is private, and all three of its callers pass the result straight through leadingWords(…, 12), so a 20-character cut there is dead code either way. The defect is fixed by leadingWords, and that is what the tests pin (sprint-review's Q3).

🤖 Generated with Claude Code

https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

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 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 5c88e43 Oct 16, 2026
24 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