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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
月光博客
月光博客
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
Vercel News
Vercel News
量子位
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
腾讯CDC
有赞技术团队
有赞技术团队

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: log Gemini CLI runtime env activation · openclaw/ope...
shakkernerd · 2026-06-17 · via Recent Commits to openclaw:main

@@ -83,7 +83,7 @@ afterEach(() => {

8383

});

84848585

function buildPreparedCliRunContext(params: {

86-

provider: "claude-cli" | "codex-cli";

86+

provider: "claude-cli" | "codex-cli" | "google-gemini-cli";

8787

model: string;

8888

runId: string;

8989

prompt?: string;

@@ -106,33 +106,46 @@ function buildPreparedCliRunContext(params: {

106106

// Produces a prepared context without invoking prepare.runtime, keeping spawn

107107

// assertions focused on execute/runtime behavior.

108108

const workspaceDir = params.workspaceDir ?? "/tmp";

109-

const baseBackend =

110-

params.provider === "claude-cli"

111-

? {

112-

command: "claude",

113-

args: ["-p", "--output-format", "stream-json"],

114-

output: "jsonl" as const,

115-

input: "stdin" as const,

116-

modelArg: "--model",

117-

sessionArg: "--session-id",

118-

sessionMode: "always" as const,

119-

systemPromptFileArg: "--append-system-prompt-file",

120-

systemPromptWhen: "first" as const,

121-

serialize: true,

122-

}

123-

: {

124-

command: "codex",

125-

args: ["exec", "--json"],

126-

resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],

127-

output: "text" as const,

128-

input: "arg" as const,

129-

modelArg: "--model",

130-

sessionMode: "existing" as const,

131-

systemPromptFileConfigArg: "-c",

132-

systemPromptFileConfigKey: "model_instructions_file",

133-

systemPromptWhen: "first" as const,

134-

serialize: true,

135-

};

109+

const baseBackend = (() => {

110+

if (params.provider === "claude-cli") {

111+

return {

112+

command: "claude",

113+

args: ["-p", "--output-format", "stream-json"],

114+

output: "jsonl" as const,

115+

input: "stdin" as const,

116+

modelArg: "--model",

117+

sessionArg: "--session-id",

118+

sessionMode: "always" as const,

119+

systemPromptFileArg: "--append-system-prompt-file",

120+

systemPromptWhen: "first" as const,

121+

serialize: true,

122+

};

123+

}

124+

if (params.provider === "google-gemini-cli") {

125+

return {

126+

command: "gemini",

127+

args: ["--skip-trust", "--output-format", "json", "--prompt", "{prompt}"],

128+

output: "json" as const,

129+

input: "arg" as const,

130+

modelArg: "--model",

131+

sessionMode: "existing" as const,

132+

serialize: true,

133+

};

134+

}

135+

return {

136+

command: "codex",

137+

args: ["exec", "--json"],

138+

resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],

139+

output: "text" as const,

140+

input: "arg" as const,

141+

modelArg: "--model",

142+

sessionMode: "existing" as const,

143+

systemPromptFileConfigArg: "-c",

144+

systemPromptFileConfigKey: "model_instructions_file",

145+

systemPromptWhen: "first" as const,

146+

serialize: true,

147+

};

148+

})();

136149

const backend = { ...baseBackend, ...params.backend };

137150

return {

138151

params: {

@@ -158,7 +171,12 @@ function buildPreparedCliRunContext(params: {

158171

id: params.provider,

159172

config: backend,

160173

bundleMcp: params.provider === "claude-cli",

161-

pluginId: params.provider === "claude-cli" ? "anthropic" : "openai",

174+

pluginId:

175+

params.provider === "claude-cli"

176+

? "anthropic"

177+

: params.provider === "google-gemini-cli"

178+

? "google"

179+

: "openai",

162180

resolveExecutionArgs: params.resolveExecutionArgs,

163181

},

164182

preparedBackend: {

@@ -562,6 +580,30 @@ describe("runCliAgent spawn path", () => {

562580

);

563581

});

564582583+

it("logs Gemini CLI runtime env key diagnostics without debug output enabled", async () => {

584+

mockSuccessfulCliRun();

585+

const infoSpy = vi.spyOn(cliBackendLog, "info");

586+587+

await executePreparedCliRun(

588+

buildPreparedCliRunContext({

589+

provider: "google-gemini-cli",

590+

model: "gemini-3.1-pro-preview",

591+

runId: "run-gemini-env-diagnostics",

592+

preparedEnv: {

593+

GEMINI_CLI_HOME: "/tmp/openclaw-gemini-profile-home",

594+

GEMINI_CLI_SYSTEM_SETTINGS_PATH: "/tmp/openclaw-gemini-system-settings.json",

595+

},

596+

}),

597+

);

598+599+

const envLog = infoSpy.mock.calls

600+

.map((call) => String(call[0]))

601+

.find((line) => line.startsWith("cli env auth:"));

602+

expect(envLog).toContain("runtimeChild=GEMINI_CLI_HOME,GEMINI_CLI_SYSTEM_SETTINGS_PATH");

603+

expect(envLog).not.toContain("/tmp/openclaw-gemini-profile-home");

604+

expect(envLog).not.toContain("/tmp/openclaw-gemini-system-settings.json");

605+

});

606+565607

it("passes OpenClaw skills to Claude as a session plugin", async () => {

566608

const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-cli-skills-"));

567609

const skillDir = path.join(workspaceDir, "skills", "weather");