ScuttleBot
revert: keep nick color by full nick — stripping suffix makes concurrent agents same color The real fix needs session-ID-based coloring, not nick-based. Filed as a separate concern. Current behavior (color by full nick) is correct for concurrent agents, changes on relay restart are caused by nick suffix change.
Commit
45a50366297ccd9e6605224c54e62b313d1fe16b4af8b339da0d52ba5f1434cf
Parent
dc1fa0ea0a991d9…
1 file changed
+1
-4
+1
-4
| --- internal/api/ui/index.html | ||
| +++ internal/api/ui/index.html | ||
| @@ -1879,15 +1879,12 @@ | ||
| 1879 | 1879 | }).join(''); |
| 1880 | 1880 | } |
| 1881 | 1881 | // Nick colors — deterministic hash over a palette |
| 1882 | 1882 | const NICK_PALETTE = ['#58a6ff','#3fb950','#ffa657','#d2a8ff','#56d364','#79c0ff','#ff7b72','#a5d6ff','#f0883e','#39d353']; |
| 1883 | 1883 | function nickColor(nick) { |
| 1884 | - // Strip session hash suffix (e.g. claude-scuttlebot-87d771ed → claude-scuttlebot) | |
| 1885 | - // so the same agent keeps a stable color across relay restarts. | |
| 1886 | - const base = nick.replace(/-[0-9a-f]{6,}$/i, ''); | |
| 1887 | 1884 | let h = 0; |
| 1888 | - for (let i = 0; i < base.length; i++) h = (h * 31 + base.charCodeAt(i)) & 0xffff; | |
| 1885 | + for (let i = 0; i < nick.length; i++) h = (h * 31 + nick.charCodeAt(i)) & 0xffff; | |
| 1889 | 1886 | return NICK_PALETTE[h % NICK_PALETTE.length]; |
| 1890 | 1887 | } |
| 1891 | 1888 | |
| 1892 | 1889 | let _lastMsgNick = null, _lastMsgAt = 0; |
| 1893 | 1890 | const GROUP_MS = 5 * 60 * 1000; |
| 1894 | 1891 |
| --- internal/api/ui/index.html | |
| +++ internal/api/ui/index.html | |
| @@ -1879,15 +1879,12 @@ | |
| 1879 | }).join(''); |
| 1880 | } |
| 1881 | // Nick colors — deterministic hash over a palette |
| 1882 | const NICK_PALETTE = ['#58a6ff','#3fb950','#ffa657','#d2a8ff','#56d364','#79c0ff','#ff7b72','#a5d6ff','#f0883e','#39d353']; |
| 1883 | function nickColor(nick) { |
| 1884 | // Strip session hash suffix (e.g. claude-scuttlebot-87d771ed → claude-scuttlebot) |
| 1885 | // so the same agent keeps a stable color across relay restarts. |
| 1886 | const base = nick.replace(/-[0-9a-f]{6,}$/i, ''); |
| 1887 | let h = 0; |
| 1888 | for (let i = 0; i < base.length; i++) h = (h * 31 + base.charCodeAt(i)) & 0xffff; |
| 1889 | return NICK_PALETTE[h % NICK_PALETTE.length]; |
| 1890 | } |
| 1891 | |
| 1892 | let _lastMsgNick = null, _lastMsgAt = 0; |
| 1893 | const GROUP_MS = 5 * 60 * 1000; |
| 1894 |
| --- internal/api/ui/index.html | |
| +++ internal/api/ui/index.html | |
| @@ -1879,15 +1879,12 @@ | |
| 1879 | }).join(''); |
| 1880 | } |
| 1881 | // Nick colors — deterministic hash over a palette |
| 1882 | const NICK_PALETTE = ['#58a6ff','#3fb950','#ffa657','#d2a8ff','#56d364','#79c0ff','#ff7b72','#a5d6ff','#f0883e','#39d353']; |
| 1883 | function nickColor(nick) { |
| 1884 | let h = 0; |
| 1885 | for (let i = 0; i < nick.length; i++) h = (h * 31 + nick.charCodeAt(i)) & 0xffff; |
| 1886 | return NICK_PALETTE[h % NICK_PALETTE.length]; |
| 1887 | } |
| 1888 | |
| 1889 | let _lastMsgNick = null, _lastMsgAt = 0; |
| 1890 | const GROUP_MS = 5 * 60 * 1000; |
| 1891 |