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

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

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(qa): hide evidence artifact href paths · openclaw/ope...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main

@@ -97,7 +97,7 @@ function displayGalleryPath(

9797

for (const root of [params.repoRoot, ...(params.extraRoots ?? [])]) {

9898

const resolvedRoot = path.resolve(root);

9999

if (isInside(resolvedRoot, absolute)) {

100-

return toRepoPath(path.relative(resolvedRoot, absolute));

100+

return sanitizeGalleryText(toRepoPath(path.relative(resolvedRoot, absolute)), params);

101101

}

102102

}

103103

}

@@ -210,6 +210,40 @@ export async function resolveQaEvidenceArtifactFile(params: {

210210

throw evidenceError("Evidence artifact is not declared by this evidence summary.", 403);

211211

}

212212213+

export async function resolveQaEvidenceArtifactFileByIndex(params: {

214+

artifactIndex: number;

215+

entryIndex: number;

216+

evidencePath: string;

217+

repoRoot: string;

218+

}): Promise<string> {

219+

const repoRoot = await fs.realpath(path.resolve(params.repoRoot));

220+

const evidencePath = await resolveQaEvidenceFile({ inputPath: params.evidencePath, repoRoot });

221+

if (

222+

!Number.isSafeInteger(params.entryIndex) ||

223+

params.entryIndex < 0 ||

224+

!Number.isSafeInteger(params.artifactIndex) ||

225+

params.artifactIndex < 0

226+

) {

227+

throw evidenceError("Evidence artifact index is invalid.", 400);

228+

}

229+

const summary = validateQaEvidenceSummaryJson(

230+

JSON.parse(await fs.readFile(evidencePath, "utf8")) as unknown,

231+

);

232+

const artifact = summary.entries[params.entryIndex]?.execution?.artifacts[params.artifactIndex];

233+

if (!artifact) {

234+

throw evidenceError("Evidence artifact not found.", 404);

235+

}

236+

const artifactFile = await resolveArtifactFileWithinRoots({

237+

artifactPath: artifact.path,

238+

evidenceDir: path.dirname(evidencePath),

239+

repoRoot,

240+

});

241+

if (!artifactFile) {

242+

throw evidenceError("Evidence artifact not found.", 404);

243+

}

244+

return artifactFile;

245+

}

246+213247

function isExplicitRepoRootArtifactPath(raw: string): boolean {

214248

const normalized = raw.split(/[\\/]+/u).join("/");

215249

return normalized.startsWith(".artifacts/");

@@ -369,11 +403,24 @@ async function readJsonIfExists(

369403

}

370404

}

371405372-

function artifactHref(evidencePath: string, artifactPath: string) {

373-

const params = new URLSearchParams({

374-

evidencePath,

375-

artifactPath,

376-

});

406+

function artifactHref(

407+

evidencePath: string,

408+

artifact:

409+

| {

410+

artifactPath: string;

411+

}

412+

| {

413+

artifactIndex: number;

414+

entryIndex: number;

415+

},

416+

) {

417+

const params = new URLSearchParams({ evidencePath });

418+

if ("artifactPath" in artifact) {

419+

params.set("artifactPath", artifact.artifactPath);

420+

} else {

421+

params.set("entryIndex", String(artifact.entryIndex));

422+

params.set("artifactIndex", String(artifact.artifactIndex));

423+

}

377424

return `/api/evidence/artifact?${params.toString()}`;

378425

}

379426

@@ -392,7 +439,7 @@ async function buildProducerContextFile(params: {

392439

}

393440

const repoPath = toRepoRelativePath(params.repoRoot, params.filePath);

394441

return {

395-

href: artifactHref(params.hrefEvidencePath, params.artifactPath),

442+

href: artifactHref(params.hrefEvidencePath, { artifactPath: params.artifactPath }),

396443

path: repoPath,

397444

preview: await readPreview(realFile, params.previewKind)

398445

.then((preview) =>

@@ -407,8 +454,10 @@ async function buildProducerContextFile(params: {

407454408455

async function buildArtifactView(params: {

409456

allowedArtifactFiles: ReadonlySet<string>;

457+

artifactIndex: number;

410458

artifact: QaEvidenceArtifact;

411459

evidenceDir: string;

460+

entryIndex: number;

412461

extraRoots: readonly string[];

413462

hrefEvidencePath: string;

414463

repoRoot: string;

@@ -424,7 +473,7 @@ async function buildArtifactView(params: {

424473

? toRepoRelativePath(params.repoRoot, realFile)

425474

: null;

426475

const displayPath =

427-

realFileRepoPath ??

476+

(realFileRepoPath ? sanitizeGalleryText(realFileRepoPath, params) : null) ??

428477

sanitizeGalleryText(params.artifact.path, {

429478

extraRoots: params.extraRoots,

430479

repoRoot: params.repoRoot,

@@ -443,14 +492,13 @@ async function buildArtifactView(params: {

443492

source: sanitizeGalleryText(params.artifact.source, params),

444493

};

445494

}

446-

const hrefArtifactPath =

447-

realFileRepoPath && path.isAbsolute(params.artifact.path)

448-

? `${REPO_ROOT_ARTIFACT_PATH_PREFIX}${realFileRepoPath}`

449-

: params.artifact.path;

450495

return {

451496

exists: true,

452497

error: null,

453-

href: artifactHref(params.hrefEvidencePath, hrefArtifactPath),

498+

href: artifactHref(params.hrefEvidencePath, {

499+

artifactIndex: params.artifactIndex,

500+

entryIndex: params.entryIndex,

501+

}),

454502

kind: sanitizeGalleryText(params.artifact.kind, params),

455503

mediaKind,

456504

path: displayPath,

@@ -820,7 +868,7 @@ export async function buildQaEvidenceGalleryModel(params: {

820868

});

821869

const limitArtifactView = createConcurrencyLimit(ARTIFACT_VIEW_CONCURRENCY);

822870

const entries = await Promise.all(

823-

summary.entries.map(async (entry): Promise<QaEvidenceGalleryEntryView> => {

871+

summary.entries.map(async (entry, entryIndex): Promise<QaEvidenceGalleryEntryView> => {

824872

counts[entry.result.status] += 1;

825873

const sanitizeEntryText = (value: string) =>

826874

sanitizeGalleryText(value, {

@@ -829,12 +877,14 @@ export async function buildQaEvidenceGalleryModel(params: {

829877

});

830878

return {

831879

artifacts: await Promise.all(

832-

(entry.execution?.artifacts ?? []).map((artifact) =>

880+

(entry.execution?.artifacts ?? []).map((artifact, artifactIndex) =>

833881

limitArtifactView(() =>

834882

buildArtifactView({

835883

allowedArtifactFiles,

836884

artifact,

885+

artifactIndex,

837886

evidenceDir,

887+

entryIndex,

838888

extraRoots: [requestedRepoRoot],

839889

hrefEvidencePath,

840890

repoRoot,