惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
B
Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Jina AI
Jina AI
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
L
LangChain Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(bonjour): harden DNS label truncation · openclaw/open...
vincentkoc · 2026-04-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -736,7 +736,7 @@ describe("gateway bonjour advertiser", () => {

736736

});

737737
738738

it("truncates service name exceeding 63-byte DNS label limit", async () => {

739-

const longHostname = "app-41627eae5842473f9e05f139ea307277-7f9477f4d6-lqqzf";

739+

const longHostname = "app-41627eae5842473f9e05f139ea307277-7f9477f4d6-lqqzf-abcdefghi";

740740

enableAdvertiserUnitMode(longHostname);

741741
742742

const destroy = vi.fn().mockResolvedValue(undefined);

@@ -755,6 +755,7 @@ describe("gateway bonjour advertiser", () => {

755755

// Both name and hostname must be within the 63-byte DNS label limit

756756

expect(new TextEncoder().encode(serviceName).byteLength).toBeLessThanOrEqual(63);

757757

expect(new TextEncoder().encode(hostname).byteLength).toBeLessThanOrEqual(63);

758+

expect(hostname).not.toMatch(/-$/);

758759
759760

await started.stop();

760761

});

Original file line numberDiff line numberDiff line change

@@ -185,7 +185,7 @@ function resolveSystemMdnsHostname(): string | null {

185185
186186

const MAX_DNS_LABEL_BYTES = 63;

187187
188-

function truncateToDnsLabel(name: string): string {

188+

function truncateToDnsLabel(name: string, fallback = "OpenClaw"): string {

189189

const encoder = new TextEncoder();

190190

const encoded = encoder.encode(name);

191191

if (encoded.byteLength <= MAX_DNS_LABEL_BYTES) {

@@ -195,7 +195,12 @@ function truncateToDnsLabel(name: string): string {

195195

const truncated = encoded.slice(0, MAX_DNS_LABEL_BYTES);

196196

const decoded = new TextDecoder("utf-8", { fatal: false }).decode(truncated);

197197

// Strip any replacement character from incomplete multi-byte sequence at the end

198-

return decoded.replace(/\uFFFD$/, "").trim() || "OpenClaw";

198+

return (

199+

decoded

200+

.replace(/\uFFFD$/, "")

201+

.replace(/-+$/, "")

202+

.trim() || fallback

203+

);

199204

}

200205
201206

function safeServiceName(name: string) {

@@ -373,6 +378,7 @@ export async function startGatewayBonjourAdvertiser(

373378

.replace(/\.local$/i, "")

374379

.split(".")[0]

375380

.trim() || "openclaw",

381+

"openclaw",

376382

);

377383

const instanceName =

378384

typeof opts.instanceName === "string" && opts.instanceName.trim()