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

推荐订阅源

Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
B
Blog
L
LangChain Blog
Y
Y Combinator Blog
美团技术团队
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
量子位
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
D
Docker
小众软件
小众软件
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
IT之家
IT之家

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
refactor(agents): trim session tool internals · openclaw/...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -35,7 +35,7 @@ export function restoreLineEndings(text: string, ending: "\r\n" | "\n"): string

3535

* - Normalize Unicode dashes/hyphens to ASCII hyphen

3636

* - Normalize special Unicode spaces to regular space

3737

*/

38-

export function normalizeForFuzzyMatch(text: string): string {

38+

function normalizeForFuzzyMatch(text: string): string {

3939

return (

4040

text

4141

.normalize("NFKC")

@@ -58,7 +58,7 @@ export function normalizeForFuzzyMatch(text: string): string {

5858

);

5959

}

606061-

export interface FuzzyMatchResult {

61+

interface FuzzyMatchResult {

6262

/** Whether a match was found */

6363

found: boolean;

6464

/** The index where the match starts (in the content that should be used for replacement) */

@@ -86,18 +86,13 @@ interface MatchedEdit {

8686

newText: string;

8787

}

888889-

export interface AppliedEditsResult {

90-

baseContent: string;

91-

newContent: string;

92-

}

93-9489

/**

9590

* Find oldText in content, trying exact match first, then fuzzy match.

9691

* When fuzzy matching is used, the returned contentForReplacement is the

9792

* fuzzy-normalized version of the content (trailing whitespace stripped,

9893

* Unicode quotes/dashes normalized to ASCII).

9994

*/

100-

export function fuzzyFindText(content: string, oldText: string): FuzzyMatchResult {

95+

function fuzzyFindText(content: string, oldText: string): FuzzyMatchResult {

10196

// Try exact match first

10297

const exactIndex = content.indexOf(oldText);

10398

if (exactIndex !== -1) {

@@ -205,7 +200,7 @@ export function applyEditsToNormalizedContent(

205200

normalizedContent: string,

206201

edits: Edit[],

207202

path: string,

208-

): AppliedEditsResult {

203+

): { baseContent: string; newContent: string } {

209204

const normalizedEdits = edits.map((edit) => ({

210205

oldText: normalizeToLF(edit.oldText),

211206

newText: normalizeToLF(edit.newText),

@@ -423,11 +418,6 @@ export interface EditDiffError {

423418

error: string;

424419

}

425420426-

export interface EditDiffOperations {

427-

readFile: (absolutePath: string) => Promise<Buffer | string>;

428-

access: (absolutePath: string) => Promise<void>;

429-

}

430-431421

/**

432422

* Compute the diff for one or more edit operations without applying them.

433423

* Used for preview rendering in the TUI before the tool executes.

@@ -436,7 +426,10 @@ export async function computeEditsDiff(

436426

path: string,

437427

edits: Edit[],

438428

cwd: string,

439-

operations?: EditDiffOperations,

429+

operations?: {

430+

readFile: (absolutePath: string) => Promise<Buffer | string>;

431+

access: (absolutePath: string) => Promise<void>;

432+

},

440433

): Promise<EditDiffResult | EditDiffError> {

441434

const absolutePath = resolveToCwd(path, cwd);

442435

@@ -478,16 +471,3 @@ export async function computeEditsDiff(

478471

return { error: err instanceof Error ? err.message : String(err) };

479472

}

480473

}

481-482-

/**

483-

* Compute the diff for a single edit operation without applying it.

484-

* Kept as a convenience wrapper for single-edit callers.

485-

*/

486-

export async function computeEditDiff(

487-

path: string,

488-

oldText: string,

489-

newText: string,

490-

cwd: string,

491-

): Promise<EditDiffResult | EditDiffError> {

492-

return computeEditsDiff(path, [{ oldText, newText }], cwd);

493-

}