Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: strip all leading labels from MagicDNS/mDNS hosts + cover Windows home paths in redactFailureSnippet (#2442)

Adam Eivy15bf5e57145b
diff --git a/server/services/agentErrorAnalysis.js b/server/services/agentErrorAnalysis.js
index a1241a05cf..e22be9fe52 100644
--- a/server/services/agentErrorAnalysis.js
+++ b/server/services/agentErrorAnalysis.js
@@ -24,11 +24,13 @@ const SNIPPET_MAX_CHARS = 240;
// hostnames, paths, addresses, or secrets pulled off the running instance.
const SNIPPET_REDACTIONS = [
// Home-dir paths that embed an OS username → strip the user segment only.
- [/\/(Users|home)\/[^/\s"']+/gi, '/$1/<user>'],
+ // Handles both POSIX (`/Users/alice`) and Windows (`C:\Users\alice`) checkouts.
+ [/[\\/](Users|home)[\\/][^\\/\s"']+/gi, '/$1/<user>'],
// Email addresses.
[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g, '<email>'],
- // Tailscale MagicDNS / mDNS hostnames.
- [/\b[A-Za-z0-9-]+\.(?:ts\.net|local)\b/gi, '<host>'],
+ // Tailscale MagicDNS / mDNS hostnames — consume ALL leading labels so a
+ // multi-label name like `machine.tailnet.ts.net` doesn't leak `machine`.
+ [/\b[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.(?:ts\.net|local)\b/gi, '<host>'],
// IPv4 addresses (LAN / Tailscale / public alike).
[/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g, '<ip>'],
// Bearer tokens and common secret-key formats.
diff --git a/server/services/agentErrorAnalysis.test.js b/server/services/agentErrorAnalysis.test.js
index 6a2cb33be2..1477cdc700 100644
--- a/server/services/agentErrorAnalysis.test.js
+++ b/server/services/agentErrorAnalysis.test.js
@@ -239,14 +239,20 @@ describe('redactFailureSnippet', () => {
it('strips OS usernames, emails, IPs, hostnames, and secrets, collapsing to one line', () => {
const raw = [
'error at /Users/alice/github.com/app/index.js:42',
+ 'and windows path C:\\Users\\bob\\app\\index.js',
'contact [email protected] or reach host node-alpha.tailnet.ts.net',
+ 'also short-host printer.local timed out',
'connect ECONNREFUSED 192.0.2.10:5555',
'Authorization: Bearer abcdef0123456789abcdef',
].join('\n');
const out = redactFailureSnippet(raw);
expect(out).not.toContain('alice');
expect(out).not.toContain('[email protected]');
- expect(out).not.toContain('node-alpha.tailnet.ts.net');
+ // Assert the leading node-name label is gone, not just the full hostname —
+ // a single-label regex would leave `node-alpha.<host>` behind.
+ expect(out).not.toContain('node-alpha');
+ expect(out).not.toContain('printer'); // multi-label + short .local host label stripped
+ expect(out).not.toContain('bob'); // windows username stripped
expect(out).not.toContain('192.0.2.10');
expect(out).not.toContain('abcdef0123456789abcdef');
expect(out).toContain('/Users/<user>/github.com/app/index.js');