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

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
G
Google Developers Blog
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42

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(agents): strip markdown code spans from IDENTITY.md v...
clawsweeper · 2026-05-26 · via Recent Commits to openclaw:main

@@ -31,14 +31,18 @@ const IDENTITY_PLACEHOLDER_VALUES = new Set([

31313232

function normalizeIdentityValue(value: string): string {

3333

let normalized = value.trim();

34-

normalized = normalized.replace(/^[*_]+|[*_]+$/g, "").trim();

34+

normalized = normalized.replace(/^[*_`\s]+|[*_`\s]+$/g, "").trim();

3535

if (normalized.startsWith("(") && normalized.endsWith(")")) {

3636

normalized = normalized.slice(1, -1).trim();

3737

}

3838

normalized = normalized.replace(/[\u2013\u2014]/g, "-");

3939

return normalizeLowercaseStringOrEmpty(normalized.replace(/\s+/g, " "));

4040

}

414142+

function normalizeIdentityLabel(label: string): string {

43+

return normalizeLowercaseStringOrEmpty(label.replace(/[*_`]/g, ""));

44+

}

45+4246

function isIdentityPlaceholder(value: string): boolean {

4347

const normalized = normalizeIdentityValue(value);

4448

return IDENTITY_PLACEHOLDER_VALUES.has(normalized);

@@ -53,12 +57,10 @@ export function parseIdentityMarkdown(content: string): AgentIdentityFile {

5357

if (colonIndex === -1) {

5458

continue;

5559

}

56-

const label = normalizeLowercaseStringOrEmpty(

57-

cleaned.slice(0, colonIndex).replace(/[*_]/g, ""),

58-

);

60+

const label = normalizeIdentityLabel(cleaned.slice(0, colonIndex));

5961

const value = cleaned

6062

.slice(colonIndex + 1)

61-

.replace(/^[*_]+|[*_]+$/g, "")

63+

.replace(/^[*_`\s]+|[*_`\s]+$/g, "")

6264

.trim();

6365

if (!value) {

6466

continue;

@@ -104,8 +106,16 @@ function buildIdentityLine(label: string, value: string): string {

104106

}

105107106108

function matchesIdentityLabel(line: string, label: string): boolean {

107-

const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

108-

return new RegExp(`^\\s*-\\s*(?:\\*\\*)?${escaped}(?:\\*\\*)?\\s*:`, "i").test(line.trim());

109+

const trimmed = line.trim();

110+

if (!trimmed.startsWith("-")) {

111+

return false;

112+

}

113+

const cleaned = trimmed.replace(/^\s*-\s*/, "");

114+

const colonIndex = cleaned.indexOf(":");

115+

if (colonIndex === -1) {

116+

return false;

117+

}

118+

return normalizeIdentityLabel(cleaned.slice(0, colonIndex)) === normalizeIdentityLabel(label);

109119

}

110120111121

function normalizeIdentityContent(content: string | undefined): string[] {

@@ -123,9 +133,7 @@ function resolveIdentityInsertIndex(lines: string[]): number {

123133

if (colonIndex === -1) {

124134

continue;

125135

}

126-

const label = normalizeLowercaseStringOrEmpty(

127-

cleaned.slice(0, colonIndex).replace(/[*_]/g, ""),

128-

);

136+

const label = normalizeIdentityLabel(cleaned.slice(0, colonIndex));

129137

if (RICH_IDENTITY_LABELS.has(label)) {

130138

lastIdentityIndex = index;

131139

}