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.

lmata 2026-04-04 19:17 trunk
Commit 45a50366297ccd9e6605224c54e62b313d1fe16b4af8b339da0d52ba5f1434cf
1 file changed +1 -4
--- internal/api/ui/index.html
+++ internal/api/ui/index.html
@@ -1879,15 +1879,12 @@
18791879
}).join('');
18801880
}
18811881
// Nick colors — deterministic hash over a palette
18821882
const NICK_PALETTE = ['#58a6ff','#3fb950','#ffa657','#d2a8ff','#56d364','#79c0ff','#ff7b72','#a5d6ff','#f0883e','#39d353'];
18831883
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, '');
18871884
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;
18891886
return NICK_PALETTE[h % NICK_PALETTE.length];
18901887
}
18911888
18921889
let _lastMsgNick = null, _lastMsgAt = 0;
18931890
const GROUP_MS = 5 * 60 * 1000;
18941891
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button