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

推荐订阅源

B
Blog
D
Docker
J
Java Code Geeks
腾讯CDC
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
博客园 - Franky
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
N
Netflix TechBlog - Medium
B
Blog RSS Feed
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News

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(config): preserve authored tilde paths on write · ope...
steipete · 2026-05-03 · via Recent Commits to openclaw:main

@@ -1089,6 +1089,71 @@ type ConfigReadResolution = {

10891089

envWarnings: EnvSubstitutionWarning[];

10901090

};

109110911092+

const TILDE_PATH_VALUE_RE = /^~(?=$|[\\/])/;

1093+

const PATH_LIKE_CONFIG_KEY_RE = /(dir|path|paths|file|root|workspace)$/i;

1094+

const PATH_LIKE_CONFIG_LIST_KEYS = new Set(["paths", "pathPrepend"]);

1095+1096+

function isPathLikeConfigKey(key: string | undefined): boolean {

1097+

return Boolean(key && (PATH_LIKE_CONFIG_KEY_RE.test(key) || PATH_LIKE_CONFIG_LIST_KEYS.has(key)));

1098+

}

1099+1100+

function expandAuthoredTildePath(value: string, home: string): string {

1101+

const suffix = value.slice(1);

1102+

if (!suffix) {

1103+

return home;

1104+

}

1105+

if (suffix.startsWith("/") || suffix.startsWith("\\")) {

1106+

return path.join(home, suffix.slice(1));

1107+

}

1108+

return value;

1109+

}

1110+1111+

function restoreAuthoredTildePathsForWrite(

1112+

next: unknown,

1113+

authored: unknown,

1114+

key: string | undefined,

1115+

home: string,

1116+

): unknown {

1117+

if (

1118+

typeof next === "string" &&

1119+

typeof authored === "string" &&

1120+

isPathLikeConfigKey(key) &&

1121+

TILDE_PATH_VALUE_RE.test(authored.trim()) &&

1122+

path.normalize(next) === path.normalize(expandAuthoredTildePath(authored.trim(), home))

1123+

) {

1124+

return authored;

1125+

}

1126+1127+

if (Array.isArray(next) && Array.isArray(authored)) {

1128+

const normalizeChildren = isPathLikeConfigKey(key);

1129+

return next.map((entry, index) =>

1130+

restoreAuthoredTildePathsForWrite(

1131+

entry,

1132+

authored[index],

1133+

normalizeChildren ? key : undefined,

1134+

home,

1135+

),

1136+

);

1137+

}

1138+1139+

if (!isRecord(next) || !isRecord(authored)) {

1140+

return next;

1141+

}

1142+1143+

const out: Record<string, unknown> = { ...next };

1144+

for (const [childKey, childValue] of Object.entries(out)) {

1145+

if (Object.prototype.hasOwnProperty.call(authored, childKey)) {

1146+

out[childKey] = restoreAuthoredTildePathsForWrite(

1147+

childValue,

1148+

authored[childKey],

1149+

childKey,

1150+

home,

1151+

);

1152+

}

1153+

}

1154+

return out;

1155+

}

1156+10921157

function resolveConfigIncludesForRead(

10931158

parsed: unknown,

10941159

configPath: string,

@@ -2069,7 +2134,13 @@ export function createConfigIO(

20692134

envRefMap && changedPaths

20702135

? (restoreEnvRefsFromMap(cfgToWrite, "", envRefMap, changedPaths) as OpenClawConfig)

20712136

: cfgToWrite;

2072-

const outputConfig = applyUnsetPathsForWrite(outputConfigBase, unsetPaths);

2137+

const tildeRestoredOutputConfig = restoreAuthoredTildePathsForWrite(

2138+

outputConfigBase,

2139+

snapshot.parsed,

2140+

undefined,

2141+

deps.homedir(),

2142+

) as OpenClawConfig;

2143+

const outputConfig = applyUnsetPathsForWrite(tildeRestoredOutputConfig, unsetPaths);

20732144

// Do NOT apply runtime defaults when writing - user config should only contain

20742145

// explicitly set values. Runtime defaults are applied when loading (issue #6070).

20752146

const stampedOutputConfig = stampConfigVersion(outputConfig);