Repository navigation
fix(irc): fallback nick exceeds 30 characters after repeat nick collisions - #196619
Conversation
…sions buildFallbackNick only truncated when the base nick was already at the 30-character cap. A 29-character nick on its second collision became 31 characters (base + "_2"), which servers truncate or reject with 432.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe PR includes the collision suffix when enforcing the existing 30-character fallback nickname limit. Example: A second collision requires suffix _2 for configured nick openclawproofnickabcdefghijkl.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current IRC registration bug with the smallest complete change; no actionable findings remain, and current-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe IRC plugin's shared TCP/TLS client handles registration collisions for Gateway accounts, outbound connections, and probes, producing fallback NICK commands for the server. flowchart LR
A[Gateway account] --> D[IRC client]
B[Outbound connection] --> D
C[Connection probe] --> D
D --> E[Fallback nickname builder]
E --> F[Bounded NICK command]
F --> G[IRC server]
Technical reviewBest possible solution: Merge the focused length-check correction and its existing socket-level regression case once required checks pass. Do we have a high-confidence way to reproduce the issue? Main deterministically produces 31 characters from a 29-character base plus _2; the contributor also supplies published-release Gateway failure logs, while this read-only review executed no target code. Is this the best way to solve the issue? This is the smallest complete fix: the existing nickname builder enforces the complete output length without changing sanitization, counter ownership, callers, configuration, or persisted state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d290127ec675. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests 0. Total 0 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 10, 2026, 9:27 AM ET / 14:27 UTC (Revision 3). |
|
Added real Gateway proof against a real IRC server (Ergo, nicklen 30) to the PR body. Published 2026.11.2 loops on @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Proof on a built Gateway (node:24.22.1, secretless Docker) against a real Ergo server with Bug case: configured nick
Controls (same result on main and on this PR):
I also merged current main, and replaced the over-limit test row with the 29-char row, so the net test-line change is 0. |
|
Landed in 9203388. Thanks @Mahdi-Hasan. Long IRC nicks now fall back within the server limit. |
…sions (openclaw#196619) fix(irc): keep fallback nicks within the server's nick length The IRC fallback nick was only shortened when the configured nick alone reached 30 characters. A 28- or 29-character nick plus a fallback suffix such as _2 or _10 went over the limit, so the server rejected it with 432 and the connection failed. The fallback is now trimmed so the nick plus its suffix stays within 30 characters. Evidence: a built Gateway on node:24.22.1 in secretless Docker talking to a real Ergo IRC server with NICKLEN=30. With a 29-character nick and its first fallback already taken, main got "IRC login failed (432): Erroneous nickname" on every restart and sends failed with 432, because the _2 and _3 fallbacks were 31 characters. With this change the bot joined as a 30-character nick and its message reached a watching client. A short taken nick, a 40-character configured nick and a 29-character nick without a collision behave the same on both. Details: openclaw#196619 (comment). Thanks @Mahdi-Hasan. Co-authored-by: Ayaan Zaidi <[email protected]>
…sions (openclaw#196619) fix(irc): keep fallback nicks within the server's nick length The IRC fallback nick was only shortened when the configured nick alone reached 30 characters. A 28- or 29-character nick plus a fallback suffix such as _2 or _10 went over the limit, so the server rejected it with 432 and the connection failed. The fallback is now trimmed so the nick plus its suffix stays within 30 characters. Evidence: a built Gateway on node:24.22.1 in secretless Docker talking to a real Ergo IRC server with NICKLEN=30. With a 29-character nick and its first fallback already taken, main got "IRC login failed (432): Erroneous nickname" on every restart and sends failed with 432, because the _2 and _3 fallbacks were 31 characters. With this change the bot joined as a 30-character nick and its message reached a watching client. A short taken nick, a 40-character configured nick and a 29-character nick without a collision behave the same on both. Details: openclaw#196619 (comment). Thanks @Mahdi-Hasan. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 9203388) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 17f3625cf8ae16ff77938e88de421ba8bd39dffe)
What Problem This Solves
Fixes: the IRC bot can send a fallback nick longer than 30 characters when its configured nick is 28–29 characters long and the nick is taken more than once in the same process.
User Impact
User impact: an IRC bot with a long nick now recovers from repeated nick collisions with a nick that stays within the 30-character cap, instead of sending an over-long
NICKthat the server truncates (and may collide again) or rejects with 432, which fails the connection.Why This Change Was Made
buildFallbackNickonly truncated when the base nick alone was already at the cap. The suffix grows with the collision counter (_,_2,_10, …), so a 29-character base plus_2produced 31 characters. The check now compares base plus suffix against the cap, so truncation kicks in whenever the suffix would push the nick past 30.Evidence
Real Gateway proof against a real IRC server
Setup, same for both runs:
limits.nicklen: 30.openclawproofnickabcdefghijkl(29 characters) and WHOISes the fallback nicks every 5 s.OPENCLAW_HOME,OPENCLAW_STATE_DIR,OPENCLAW_CONFIG_PATHin a temp dir), plaintext loopback, two IRC accountsfirstandsecondboth configured with that nick. Both connect at startup in one process, so the second collision gets the_2suffix.Before: published
[email protected]with@openclaw/[email protected](openclaw plugins install),openclaw gateway run:Holder WHOIS:
openclawproofnickabcdefghijkl_exists (second);openclawproofnickabcdefghijkl_2does not. Each auto-restart takes a new counter value (_3,_4, …), which is still 31 characters, sofirstnever connects.After: this branch from source (
pnpm build, thenpnpm openclaw gateway run):No 432 and no auto-restart in the Gateway log. Holder WHOIS from the server:
Both accounts are registered; the second uses the 30-character
openclawproofnickabcdefghijk_2.Unit test
Added a 29-character case to the existing "normalizes and bounds fallback" test in
extensions/irc/src/client.test.ts.pnpm test extensions/irc/src/client.test.ts --maxWorkers=1fails the new case withexpected 31 to be less than or equal to 30.pnpm format:checkandoxlinton both touched files: clean.