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

推荐订阅源

博客园_首页
量子位
D
DataBreaches.Net
博客园 - 司徒正美
J
Java Code Geeks
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
B
Blog
The Cloudflare Blog
D
Docker
I
InfoQ
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
腾讯CDC
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
S
SegmentFault 最新的问题
GbyAI
GbyAI
有赞技术团队
有赞技术团队

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(setup): summarize gateway config · openclaw/openclaw@...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -45,30 +45,76 @@ export function summarizeExistingConfig(config: OpenClawConfig): string {

4545

const rows: string[] = [];

4646

const defaults = config.agents?.defaults;

4747

if (defaults?.workspace) {

48-

rows.push(shortenHomeInString(`workspace: ${defaults.workspace}`));

48+

rows.push(shortenHomeInString(`Workspace: ${defaults.workspace}`));

4949

}

5050

if (defaults?.model) {

5151

const model = resolveAgentModelPrimaryValue(defaults.model);

5252

if (model) {

53-

rows.push(shortenHomeInString(`model: ${model}`));

53+

rows.push(shortenHomeInString(`Model: ${model}`));

5454

}

5555

}

56-

if (config.gateway?.mode) {

57-

rows.push(shortenHomeInString(`gateway.mode: ${config.gateway.mode}`));

56+

const gatewaySummary = summarizeGatewayConfig(config);

57+

if (gatewaySummary) {

58+

rows.push(shortenHomeInString(gatewaySummary));

5859

}

59-

if (typeof config.gateway?.port === "number") {

60-

rows.push(shortenHomeInString(`gateway.port: ${config.gateway.port}`));

60+

if (config.skills?.install?.nodeManager) {

61+

rows.push(shortenHomeInString(`Node manager: ${config.skills.install.nodeManager}`));

6162

}

62-

if (config.gateway?.bind) {

63-

rows.push(shortenHomeInString(`gateway.bind: ${config.gateway.bind}`));

63+

return rows.length ? rows.join("\n") : "No key settings detected.";

64+

}

65+66+

function summarizeGatewayConfig(config: OpenClawConfig): string | null {

67+

const gateway = config.gateway;

68+

if (

69+

!gateway?.mode &&

70+

typeof gateway?.port !== "number" &&

71+

!gateway?.bind &&

72+

!gateway?.remote?.url

73+

) {

74+

return null;

6475

}

65-

if (config.gateway?.remote?.url) {

66-

rows.push(shortenHomeInString(`gateway.remote.url: ${config.gateway.remote.url}`));

76+

const mode = normalizeOptionalString(gateway.mode);

77+

const bind = formatGatewayBind(gateway.bind);

78+

const remoteUrl = normalizeOptionalString(gateway.remote?.url);

79+

const useRemoteUrl = remoteUrl !== undefined && mode !== "local";

80+

const endpoint =

81+

useRemoteUrl && remoteUrl

82+

? remoteUrl

83+

: typeof gateway.port === "number"

84+

? `:${gateway.port}`

85+

: undefined;

86+

const words: string[] = [];

87+

if (mode) {

88+

words.push(mode);

6789

}

68-

if (config.skills?.install?.nodeManager) {

69-

rows.push(shortenHomeInString(`skills.nodeManager: ${config.skills.install.nodeManager}`));

90+

if (bind) {

91+

words.push(mode ? `via ${bind}` : bind);

92+

}

93+

if (mode === "remote" && !remoteUrl) {

94+

words.push("(missing remote URL)");

95+

return `Gateway: ${words.join(" ")}`;

96+

}

97+

if (endpoint) {

98+

words.push(`${useRemoteUrl ? "at" : "on"} ${endpoint}`);

99+

}

100+

return `Gateway: ${words.length > 0 ? words.join(" ") : "configured"}`;

101+

}

102+103+

function formatGatewayBind(value: string | undefined): string | undefined {

104+

switch (value) {

105+

case "lan":

106+

return "LAN";

107+

case "loopback":

108+

return "loopback";

109+

case "tailnet":

110+

return "tailnet";

111+

case "auto":

112+

return "auto";

113+

case "custom":

114+

return "custom";

115+

default:

116+

return normalizeOptionalString(value);

70117

}

71-

return rows.length ? rows.join("\n") : "No key settings detected.";

72118

}

7311974120

export function normalizeGatewayTokenInput(value: unknown): string {