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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园_首页
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
V
V2EX
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队

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(acpx): surface Codex ACP diagnostics · openclaw/openc...
leoge007 · 2026-05-15 · via Recent Commits to openclaw:main

@@ -6,6 +6,7 @@ import { promisify } from "node:util";

66

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

77

import { prepareAcpxCodexAuthConfig } from "./codex-auth-bridge.js";

88

import { resolveAcpxPluginConfig } from "./config.js";

9+

import { OPENCLAW_ACPX_LEASE_ID_ARG, OPENCLAW_GATEWAY_INSTANCE_ID_ARG } from "./process-lease.js";

9101011

const execFileAsync = promisify(execFile);

1112

const tempDirs: string[] = [];

@@ -241,11 +242,14 @@ describe("prepareAcpxCodexAuthConfig", () => {

241242

expect(wrapper).toContain('killChildTree("SIGTERM")');

242243

expect(wrapper).toContain('killChildTree("SIGKILL", { force: true })');

243244

expect(wrapper).toMatch(

244-

/forceKillTimer = setTimeout\(\(\) => \{\s*killChildTree\("SIGKILL", \{ force: true \}\);\s*process\.exit\(1\);/s,

245+

/forceKillTimer = setTimeout\(\(\) => \{\s*killChildTree\("SIGKILL", \{ force: true \}\);\s*childExitCode = 1;/s,

245246

);

246247

expect(wrapper).toMatch(

247248

/child\.on\("exit", \(code, signal\) => \{\s*if \(parentWatcher\) \{\s*clearInterval\(parentWatcher\);\s*\}\s*if \(orphanCleanupStarted\) \{\s*return;\s*\}/s,

248249

);

250+

expect(wrapper).toMatch(

251+

/child\.on\("close", \(\) => \{\s*finishStderrLog\(\);\s*process\.exit\(childExitCode\);/s,

252+

);

249253

expect(wrapper).not.toMatch(

250254

/forceKillTimer = setTimeout\(\(\) => killChildTree\("SIGKILL"\), 1_500\);\s*forceKillTimer\.unref\?\.\(\);\s*process\.exit\(1\);/s,

251255

);

@@ -357,7 +361,33 @@ describe("prepareAcpxCodexAuthConfig", () => {

357361

);

358362

await fs.writeFile(

359363

path.join(sourceCodexHome, "config.toml"),

360-

'notify = ["SkyComputerUseClient", "turn-ended"]\n',

364+

[

365+

'model = "gpt-5.5-1"',

366+

'model_provider = "azure_foundry"',

367+

'model_reasoning_effort = "high"',

368+

'sandbox_mode = "workspace-write"',

369+

'notify = ["SkyComputerUseClient", "turn-ended"]',

370+

"",

371+

"[model_providers.azure_foundry]",

372+

'name = "Azure Foundry"',

373+

'base_url = "https://example.azure.com/openai/v1"',

374+

'wire_api = "responses"',

375+

'env_key = "AZURE_OPENAI_API_KEY"',

376+

'http_headers = { "api-key" = "inline-secret-key" }',

377+

'query_params = { "api-version" = "2026-01-01", "secret" = "inline-secret-param" }',

378+

'experimental_bearer_token = "inline-secret-bearer"',

379+

"",

380+

"[model_providers.azure_foundry.auth]",

381+

'command = "bash"',

382+

'args = ["-lc", "printf %s test-key"]',

383+

"",

384+

"[model_providers.secret_only]",

385+

'experimental_bearer_token = "secret-only-token"',

386+

"",

387+

`[projects.${JSON.stringify(path.join(root, "project-with-model-key"))}]`,

388+

'model = "nested-project-model"',

389+

"",

390+

].join("\n"),

361391

);

362392

process.env.CODEX_HOME = sourceCodexHome;

363393

process.env.OPENCLAW_AGENT_DIR = agentDir;

@@ -375,6 +405,21 @@ describe("prepareAcpxCodexAuthConfig", () => {

375405376406

expectCodexWrapperCommand(resolved.agents.codex, generated.wrapperPath);

377407

const isolatedConfig = await fs.readFile(generated.configPath, "utf8");

408+

expect(isolatedConfig).toContain('model = "gpt-5.5-1"');

409+

expect(isolatedConfig).toContain('model_provider = "azure_foundry"');

410+

expect(isolatedConfig).toContain('model_reasoning_effort = "high"');

411+

expect(isolatedConfig).toContain('sandbox_mode = "workspace-write"');

412+

expect(isolatedConfig).toContain("[model_providers.azure_foundry]");

413+

expect(isolatedConfig).toContain('base_url = "https://example.azure.com/openai/v1"');

414+

expect(isolatedConfig).toContain('env_key = "AZURE_OPENAI_API_KEY"');

415+

expect(isolatedConfig).not.toContain("http_headers");

416+

expect(isolatedConfig).not.toContain("query_params");

417+

expect(isolatedConfig).not.toContain("experimental_bearer_token");

418+

expect(isolatedConfig).not.toContain("[model_providers.azure_foundry.auth]");

419+

expect(isolatedConfig).not.toContain("[model_providers.secret_only]");

420+

expect(isolatedConfig).not.toContain("nested-project-model");

421+

expect(isolatedConfig).not.toContain("inline-secret");

422+

expect(isolatedConfig).not.toContain('args = ["-lc", "printf %s test-key"]');

378423

expect(isolatedConfig).not.toContain("notify");

379424

expect(isolatedConfig).not.toContain("SkyComputerUseClient");

380425

expect(isolatedConfig).toContain(`[projects.${JSON.stringify(path.resolve(root))}]`);

@@ -498,6 +543,101 @@ describe("prepareAcpxCodexAuthConfig", () => {

498543

expect(resolved.agents.claude).toContain("bypass");

499544

});

500545546+

it("captures Codex wrapper stderr in a stream-aware redacted per-lease log", async () => {

547+

const root = await makeTempDir();

548+

const stateDir = path.join(root, "state");

549+

const generated = generatedCodexPaths(stateDir);

550+

const stderrScript = path.join(root, "emit-stderr.mjs");

551+

await fs.writeFile(

552+

stderrScript,

553+

`const chunks = [

554+

"token=sk-test",

555+

"secret1234567890\\n",

556+

"Authorization: Bearer bearer-secret",

557+

"-token-1234567890\\n",

558+

'{"client_secret":"json-secret-1234567890","api_key":"json-api-key-1234567890"}\\n',

559+

"client-secret: kebab-secret-1234567890\\n",

560+

"standalone sk-live-secret",

561+

"1234567890\\n",

562+

"url=https://example.test/callback?token=query-secret",

563+

"-1234567890\\n",

564+

"github_pat_1234567890",

565+

"abcdefghijklmnopqrstuvwxyz\\n",

566+

"-----BEGIN PRIVATE KEY-----\\nprivate-secret-body\\n",

567+

"-----END PRIVATE KEY-----\\n",

568+

"tail-token=tail-secret-1234567890",

569+

"\\n-----BEGIN PRIVATE KEY-----\\ntruncated-private-secret",

570+

];

571+

let index = 0;

572+

function writeNext() {

573+

if (index >= chunks.length) {

574+

process.exit(1);

575+

return;

576+

}

577+

process.stderr.write(chunks[index]);

578+

index += 1;

579+

setTimeout(writeNext, 5);

580+

}

581+

writeNext();`,

582+

"utf8",

583+

);

584+

const pluginConfig = resolveAcpxPluginConfig({

585+

rawConfig: {

586+

agents: {

587+

codex: {

588+

command: `${process.execPath} ${stderrScript}`,

589+

},

590+

},

591+

},

592+

workspaceDir: root,

593+

});

594+595+

await prepareAcpxCodexAuthConfig({

596+

pluginConfig,

597+

stateDir,

598+

resolveInstalledCodexAcpBinPath: async () => path.join(root, "codex-acp.js"),

599+

});

600+601+

await expect(

602+

execFileAsync(process.execPath, [

603+

generated.wrapperPath,

604+

"--openclaw-run-configured",

605+

process.execPath,

606+

stderrScript,

607+

OPENCLAW_ACPX_LEASE_ID_ARG,

608+

"lease-secret",

609+

OPENCLAW_GATEWAY_INSTANCE_ID_ARG,

610+

"gateway-test",

611+

]),

612+

).rejects.toMatchObject({ code: 1 });

613+614+

const log = await fs.readFile(

615+

path.join(stateDir, "acpx", "codex-acp-wrapper.stderr.lease-secret.log"),

616+

"utf8",

617+

);

618+

expect(log).toContain("token=[REDACTED]");

619+

expect(log).toContain("Authorization: Bearer [REDACTED]");

620+

expect(log).toContain('"client_secret":"[REDACTED]"');

621+

expect(log).toContain('"api_key":"[REDACTED]"');

622+

expect(log).toContain("client-secret: [REDACTED]");

623+

expect(log).toContain("standalone [REDACTED_OPENAI_KEY]");

624+

expect(log).toContain("?token=[REDACTED]");

625+

expect(log).toContain("[REDACTED_GITHUB_TOKEN]");

626+

expect(log).toContain("[REDACTED_PRIVATE_KEY]");

627+

expect(log).toContain("tail-token=[REDACTED]");

628+

expect(log).not.toContain("sk-testsecret1234567890");

629+

expect(log).not.toContain("bearer-secret-token-1234567890");

630+

expect(log).not.toContain("json-secret-1234567890");

631+

expect(log).not.toContain("json-api-key-1234567890");

632+

expect(log).not.toContain("kebab-secret-1234567890");

633+

expect(log).not.toContain("query-secret-1234567890");

634+

expect(log).not.toContain("github_pat_1234567890abcdefghijklmnopqrstuvwxyz");

635+

expect(log).not.toContain("private-secret-body");

636+

expect(log).not.toContain("truncated-private-secret");

637+

expect(log).not.toContain("tail-secret-1234567890");

638+

await expectPathMissing(path.join(stateDir, "acpx", "codex-acp-wrapper.stderr.log"));

639+

});

640+501641

it("leaves a custom Claude agent command alone", async () => {

502642

const root = await makeTempDir();

503643

const stateDir = path.join(root, "state");