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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
小众软件
小众软件
美团技术团队
Martin Fowler
Martin Fowler
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
J
Java Code Geeks
B
Blog
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
博客园 - Franky

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
test(gateway): skip codex acp bind when auth is unavailab...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -43,6 +43,10 @@ const DEFAULT_LIVE_CODEX_MODEL = "gpt-5.5";

4343

const DEFAULT_LIVE_PARENT_MODEL = "openai/gpt-5.4";

4444

type LiveAcpAgent = "claude" | "codex" | "droid" | "gemini" | "opencode";

454546+

class AcpBindSkipError extends Error {

47+

readonly name = "AcpBindSkipError";

48+

}

49+4650

function createSlackCurrentConversationBindingRegistry() {

4751

return createTestRegistry([

4852

{

@@ -262,6 +266,16 @@ function isRetryableAcpBindWarmupText(texts: string[]): boolean {

262266

);

263267

}

264268269+

function isSkippableAcpBindText(params: { liveAgent: LiveAcpAgent; texts: string[] }): boolean {

270+

if (params.liveAgent !== "codex") {

271+

return false;

272+

}

273+

const combined = params.texts.join("\n\n").toLowerCase();

274+

return (

275+

combined.includes("acp_session_init_failed") && combined.includes("authentication required")

276+

);

277+

}

278+265279

describe("isRetryableAcpBindWarmupText", () => {

266280

it.each([

267281

{

@@ -280,6 +294,23 @@ describe("isRetryableAcpBindWarmupText", () => {

280294

});

281295

});

282296297+

describe("isSkippableAcpBindText", () => {

298+

it.each([

299+

{

300+

liveAgent: "codex" as const,

301+

texts: ["ACP error (ACP_SESSION_INIT_FAILED): Authentication required"],

302+

expected: true,

303+

},

304+

{

305+

liveAgent: "gemini" as const,

306+

texts: ["ACP error (ACP_SESSION_INIT_FAILED): Authentication required"],

307+

expected: false,

308+

},

309+

])("returns $expected for $liveAgent", ({ liveAgent, texts, expected }) => {

310+

expect(isSkippableAcpBindText({ liveAgent, texts })).toBe(expected);

311+

});

312+

});

313+283314

function formatAssistantTextPreview(texts: string[], maxChars = 600): string {

284315

const combined = texts.join("\n\n").trim();

285316

if (!combined) {

@@ -362,6 +393,13 @@ async function bindConversationAndWait(params: {

362393

return { mainAssistantTexts, spawnedSessionKey };

363394

}

364395

if (!isRetryableAcpBindWarmupText(mainAssistantTexts)) {

396+

if (isSkippableAcpBindText({ liveAgent: params.liveAgent, texts: mainAssistantTexts })) {

397+

throw new AcpBindSkipError(

398+

`SKIP: ${params.liveAgent} ACP bind unavailable: ${formatAssistantTextPreview(

399+

mainAssistantTexts,

400+

)}`,

401+

);

402+

}

365403

throw new Error(

366404

`bind command did not produce an ACP session: ${formatAssistantTextPreview(mainAssistantTexts)}`,

367405

);

@@ -662,14 +700,24 @@ describeLive("gateway live (ACP bind)", () => {

662700

pinActivePluginChannelRegistry(channelRegistry);

663701664702

try {

665-

const { mainAssistantTexts, spawnedSessionKey } = await bindConversationAndWait({

666-

client,

667-

sessionKey: originalSessionKey,

668-

liveAgent,

669-

originatingChannel: "slack",

670-

originatingTo: conversationId,

671-

originatingAccountId: accountId,

672-

});

703+

let bindResult: Awaited<ReturnType<typeof bindConversationAndWait>>;

704+

try {

705+

bindResult = await bindConversationAndWait({

706+

client,

707+

sessionKey: originalSessionKey,

708+

liveAgent,

709+

originatingChannel: "slack",

710+

originatingTo: conversationId,

711+

originatingAccountId: accountId,

712+

});

713+

} catch (error) {

714+

if (error instanceof AcpBindSkipError) {

715+

console.error(error.message);

716+

return;

717+

}

718+

throw error;

719+

}

720+

const { mainAssistantTexts, spawnedSessionKey } = bindResult;

673721

logLiveStep("bind command completed");

674722

expect(mainAssistantTexts.join("\n\n")).toContain("Bound this conversation to");

675723

expect(spawnedSessionKey).toMatch(new RegExp(`^agent:${liveAgent}:acp:`));