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

推荐订阅源

宝玉的分享
宝玉的分享
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
Y
Y Combinator Blog
月光博客
月光博客
IT之家
IT之家
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
L
LangChain Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
博客园 - Franky
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
V
Visual Studio Blog
小众软件
小众软件
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
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: repair managed service env install migration · openc...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -243,7 +243,7 @@ describe("buildGatewayInstallPlan", () => {

243243

expect(plan.environment.OPENCLAW_WRAPPER).toBe(wrapperPath);

244244

});

245245246-

it("merges safe config env while dropping unsafe values and keeping service precedence", async () => {

246+

it("tracks safe config env keys without embedding literal values", async () => {

247247

mockNodeGatewayPlanFixture({

248248

serviceEnvironment: {

249249

HOME: "/Users/service",

@@ -271,16 +271,16 @@ describe("buildGatewayInstallPlan", () => {

271271

},

272272

});

273273274-

expect(plan.environment.GOOGLE_API_KEY).toBe("test-key");

275-

expect(plan.environment.CUSTOM_VAR).toBe("custom-value");

276-

expect(plan.environment.SAFE_KEY).toBe("safe-value");

274+

expect(plan.environment.GOOGLE_API_KEY).toBeUndefined();

275+

expect(plan.environment.CUSTOM_VAR).toBeUndefined();

276+

expect(plan.environment.SAFE_KEY).toBeUndefined();

277277

expect(plan.environment.NODE_OPTIONS).toBeUndefined();

278278

expect(plan.environment.EMPTY_KEY).toBeUndefined();

279279

expect(plan.environment.TRIMMED_KEY).toBeUndefined();

280280

expect(plan.environment.HOME).toBe("/Users/service");

281281

expect(plan.environment.OPENCLAW_PORT).toBe("3000");

282282

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBe(

283-

"CUSTOM_VAR,GOOGLE_API_KEY,OPENCLAW_PORT,SAFE_KEY",

283+

"CUSTOM_VAR,GOOGLE_API_KEY,SAFE_KEY",

284284

);

285285

});

286286

@@ -328,6 +328,7 @@ describe("buildGatewayInstallPlan", () => {

328328

});

329329330330

expect(plan.environment.OPENAI_API_KEY).toBe("sk-openai-test");

331+

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBeUndefined();

331332

expect(mocks.hasAnyAuthProfileStoreSource).not.toHaveBeenCalled();

332333

expect(mocks.loadAuthProfileStoreForSecretsRuntime).not.toHaveBeenCalled();

333334

});

@@ -393,6 +394,7 @@ describe("buildGatewayInstallPlan", () => {

393394

expect(plan.environment.MISSING_TOKEN).toBeUndefined();

394395

expect(plan.environment.OPENAI_API_KEY).toBe("sk-openai-test");

395396

expect(plan.environment.ANTHROPIC_TOKEN).toBe("ant-test-token");

397+

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBeUndefined();

396398

expect(warn).toHaveBeenCalledWith(expect.stringContaining("NODE_OPTIONS"), "Auth profile");

397399

expect(warn).toHaveBeenCalledWith(expect.stringContaining("GIT_ASKPASS"), "Auth profile");

398400

});

@@ -409,7 +411,7 @@ describe("buildGatewayInstallPlan — dotenv merge", () => {

409411

fs.rmSync(tmpDir, { recursive: true, force: true });

410412

});

411413412-

it("merges .env vars with config and service precedence", async () => {

414+

it("tracks .env vars with config while preserving service precedence", async () => {

413415

await writeStateDirDotEnv(

414416

"BRAVE_API_KEY=BSA-from-env\nOPENROUTER_API_KEY=or-key\nMY_KEY=from-dotenv\nHOME=/from-dotenv\n",

415417

{

@@ -436,11 +438,14 @@ describe("buildGatewayInstallPlan — dotenv merge", () => {

436438

},

437439

});

438440439-

expect(plan.environment.BRAVE_API_KEY).toBe("BSA-from-env");

440-

expect(plan.environment.OPENROUTER_API_KEY).toBe("or-key");

441-

expect(plan.environment.MY_KEY).toBe("from-config");

441+

expect(plan.environment.BRAVE_API_KEY).toBeUndefined();

442+

expect(plan.environment.OPENROUTER_API_KEY).toBeUndefined();

443+

expect(plan.environment.MY_KEY).toBeUndefined();

442444

expect(plan.environment.HOME).toBe("/from-service");

443445

expect(plan.environment.OPENCLAW_PORT).toBe("3000");

446+

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBe(

447+

"BRAVE_API_KEY,MY_KEY,OPENROUTER_API_KEY",

448+

);

444449

});

445450446451

it("works when .env file does not exist", async () => {

@@ -515,6 +520,66 @@ describe("buildGatewayInstallPlan — dotenv merge", () => {

515520

expect(plan.environment.GOPATH).toBeUndefined();

516521

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBeUndefined();

517522

});

523+524+

it("drops legacy inline env values when the key is now managed by .env", async () => {

525+

await writeStateDirDotEnv("TAVILY_API_KEY=fresh-dotenv-value\n", {

526+

stateDir: path.join(tmpDir, ".openclaw"),

527+

});

528+

mockNodeGatewayPlanFixture({

529+

serviceEnvironment: {

530+

HOME: "/from-service",

531+

OPENCLAW_PORT: "3000",

532+

},

533+

});

534+535+

const plan = await buildGatewayInstallPlan({

536+

env: { HOME: tmpDir },

537+

port: 3000,

538+

runtime: "node",

539+

existingEnvironment: {

540+

TAVILY_API_KEY: "old-inline-value",

541+

CUSTOM_TOOL_HOME: "/Users/test/.custom-tool",

542+

},

543+

});

544+545+

expect(plan.environment.TAVILY_API_KEY).toBeUndefined();

546+

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBe("TAVILY_API_KEY");

547+

expect(plan.environment.CUSTOM_TOOL_HOME).toBe("/Users/test/.custom-tool");

548+

});

549+550+

it("does not embed auth-profile env refs when the key is already durable", async () => {

551+

await writeStateDirDotEnv("OPENAI_API_KEY=dotenv-openai\n", {

552+

stateDir: path.join(tmpDir, ".openclaw"),

553+

});

554+

mockNodeGatewayPlanFixture({

555+

serviceEnvironment: {

556+

HOME: "/from-service",

557+

OPENCLAW_PORT: "3000",

558+

},

559+

});

560+561+

const plan = await buildGatewayInstallPlan({

562+

env: {

563+

HOME: tmpDir,

564+

OPENAI_API_KEY: "shell-openai",

565+

},

566+

port: 3000,

567+

runtime: "node",

568+

authStore: {

569+

version: 1,

570+

profiles: {

571+

"openai:default": {

572+

type: "api_key",

573+

provider: "openai",

574+

keyRef: { source: "env", provider: "default", id: "OPENAI_API_KEY" },

575+

},

576+

},

577+

},

578+

});

579+580+

expect(plan.environment.OPENAI_API_KEY).toBeUndefined();

581+

expect(plan.environment.OPENCLAW_SERVICE_MANAGED_ENV_KEYS).toBe("OPENAI_API_KEY");

582+

});

518583

});

519584520585

describe("gatewayInstallErrorHint", () => {