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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
博客园 - 叶小钗
V
V2EX
博客园 - Franky
博客园_首页
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 【当耐特】
D
Docker
N
Netflix TechBlog - Medium

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: scope compact skill path env · openclaw/openclaw@d6c...
shakkernerd · 2026-06-20 · via Recent Commits to openclaw:main
11

// Compact skill path tests cover short path formatting for skill prompt payloads.

22

import os from "node:os";

33

import path from "node:path";

4-

import { afterEach, describe, expect, it, vi } from "vitest";

4+

import { describe, expect, it } from "vitest";

5+

import { withEnv } from "../../test-utils/env.js";

56

import { createCanonicalFixtureSkill } from "../test-support/test-helpers.js";

67

import { testing as workspaceSkillsTesting, buildWorkspaceSkillsPrompt } from "./workspace.js";

7889

describe("compactSkillPaths", () => {

9-

afterEach(() => {

10-

vi.unstubAllEnvs();

11-

});

12-1310

function buildPromptForFixtureSkill(params: {

1411

workspaceRoot: string;

1512

skillDir: string;

@@ -63,17 +60,21 @@ describe("compactSkillPaths", () => {

6360

const skillDir = path.join(stateDir, "skills", "world-cup-soccer-openclaw-skill");

6461

const skillFile = path.join(skillDir, "SKILL.md");

656266-

vi.stubEnv("HOME", osHome);

67-

vi.stubEnv("OPENCLAW_HOME", osHome);

68-

vi.stubEnv("OPENCLAW_STATE_DIR", stateDir);

69-

vi.stubEnv("OPENCLAW_CONFIG_PATH", path.join(stateDir, "openclaw.json"));

70-71-

const prompt = buildPromptForFixtureSkill({

72-

workspaceRoot: path.join(root, "workspace"),

73-

skillDir,

74-

name: "world-cup-soccer-openclaw-skill",

75-

description: "World Cup standings lookup",

76-

});

63+

const prompt = withEnv(

64+

{

65+

HOME: osHome,

66+

OPENCLAW_HOME: osHome,

67+

OPENCLAW_STATE_DIR: stateDir,

68+

OPENCLAW_CONFIG_PATH: path.join(stateDir, "openclaw.json"),

69+

},

70+

() =>

71+

buildPromptForFixtureSkill({

72+

workspaceRoot: path.join(root, "workspace"),

73+

skillDir,

74+

name: "world-cup-soccer-openclaw-skill",

75+

description: "World Cup standings lookup",

76+

}),

77+

);

77787879

expect(prompt).toContain(`<location>${skillFile}</location>`);

7980

expect(prompt).not.toContain("~/.openclaw/skills/world-cup-soccer-openclaw-skill/SKILL.md");

@@ -86,17 +87,21 @@ describe("compactSkillPaths", () => {

8687

const skillDir = path.join(stateDir, "plugin-skills", "calendar-plugin-skill");

8788

const skillFile = path.join(skillDir, "SKILL.md");

888989-

vi.stubEnv("HOME", osHome);

90-

vi.stubEnv("OPENCLAW_HOME", osHome);

91-

vi.stubEnv("OPENCLAW_STATE_DIR", stateDir);

92-

vi.stubEnv("OPENCLAW_CONFIG_PATH", path.join(stateDir, "openclaw.json"));

93-94-

const prompt = buildPromptForFixtureSkill({

95-

workspaceRoot: path.join(root, "workspace"),

96-

skillDir,

97-

name: "calendar-plugin-skill",

98-

description: "Calendar plugin skill",

99-

});

90+

const prompt = withEnv(

91+

{

92+

HOME: osHome,

93+

OPENCLAW_HOME: osHome,

94+

OPENCLAW_STATE_DIR: stateDir,

95+

OPENCLAW_CONFIG_PATH: path.join(stateDir, "openclaw.json"),

96+

},

97+

() =>

98+

buildPromptForFixtureSkill({

99+

workspaceRoot: path.join(root, "workspace"),

100+

skillDir,

101+

name: "calendar-plugin-skill",

102+

description: "Calendar plugin skill",

103+

}),

104+

);

100105101106

expect(prompt).toContain(`<location>${skillFile}</location>`);

102107

expect(prompt).not.toContain("~/.openclaw/plugin-skills/calendar-plugin-skill/SKILL.md");

@@ -107,16 +112,20 @@ describe("compactSkillPaths", () => {

107112

const stateDir = path.join(home, ".openclaw");

108113

const skillDir = path.join(stateDir, "skills", "home-managed-skill");

109114110-

vi.stubEnv("HOME", home);

111-

vi.stubEnv("OPENCLAW_STATE_DIR", stateDir);

112-

vi.stubEnv("OPENCLAW_HOME", undefined);

113-114-

const prompt = buildPromptForFixtureSkill({

115-

workspaceRoot: path.join(home, "workspace"),

116-

skillDir,

117-

name: "home-managed-skill",

118-

description: "Home managed skill",

119-

});

115+

const prompt = withEnv(

116+

{

117+

HOME: home,

118+

OPENCLAW_STATE_DIR: stateDir,

119+

OPENCLAW_HOME: undefined,

120+

},

121+

() =>

122+

buildPromptForFixtureSkill({

123+

workspaceRoot: path.join(home, "workspace"),

124+

skillDir,

125+

name: "home-managed-skill",

126+

description: "Home managed skill",

127+

}),

128+

);

120129121130

expect(prompt).toContain("<location>~/.openclaw/skills/home-managed-skill/SKILL.md</location>");

122131

expect(prompt).not.toContain(`<location>${path.join(skillDir, "SKILL.md")}</location>`);