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

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - 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
fix(cli): pass instructions for local openai-codex model ...
lilesjtu · 2026-05-06 · via Recent Commits to openclaw:main

@@ -406,16 +406,21 @@ describe("capability cli", () => {

406406

);

407407

expect(mocks.completeWithPreparedSimpleCompletionModel).toHaveBeenCalledWith(

408408

expect.objectContaining({

409-

context: {

409+

context: expect.objectContaining({

410410

messages: [

411411

expect.objectContaining({

412412

role: "user",

413413

content: "hello",

414414

}),

415415

],

416-

},

416+

}),

417417

}),

418418

);

419+

const calls = mocks.completeWithPreparedSimpleCompletionModel.mock.calls as unknown as Array<

420+

[{ context?: { systemPrompt?: string } }]

421+

>;

422+

const call = calls[0]?.[0];

423+

expect(call.context).not.toHaveProperty("systemPrompt");

419424

});

420425421426

it("passes image files to local model probes", async () => {

@@ -438,7 +443,7 @@ describe("capability cli", () => {

438443439444

expect(mocks.completeWithPreparedSimpleCompletionModel).toHaveBeenCalledWith(

440445

expect.objectContaining({

441-

context: {

446+

context: expect.objectContaining({

442447

messages: [

443448

expect.objectContaining({

444449

role: "user",

@@ -448,9 +453,14 @@ describe("capability cli", () => {

448453

],

449454

}),

450455

],

451-

},

456+

}),

452457

}),

453458

);

459+

const calls = mocks.completeWithPreparedSimpleCompletionModel.mock.calls as unknown as Array<

460+

[{ context?: { systemPrompt?: string } }]

461+

>;

462+

const call = calls[0]?.[0];

463+

expect(call.context).not.toHaveProperty("systemPrompt");

454464

expect(mocks.runtime.writeJson).toHaveBeenCalledWith(

455465

expect.objectContaining({

456466

inputs: [

@@ -463,6 +473,55 @@ describe("capability cli", () => {

463473

);

464474

});

465475476+

it("adds minimal instructions only for openai-codex local model probes", async () => {

477+

mocks.prepareSimpleCompletionModelForAgent.mockResolvedValueOnce({

478+

selection: {

479+

provider: "openai-codex",

480+

modelId: "gpt-5.5",

481+

agentDir: "/tmp/agent",

482+

},

483+

model: {

484+

provider: "openai-codex",

485+

id: "gpt-5.5",

486+

api: "openai-codex-responses",

487+

maxTokens: 128,

488+

},

489+

auth: {

490+

apiKey: "codex-app-server",

491+

source: "codex-app-server",

492+

mode: "token",

493+

},

494+

} as never);

495+496+

await runRegisteredCli({

497+

register: registerCapabilityCli as (program: Command) => void,

498+

argv: [

499+

"capability",

500+

"model",

501+

"run",

502+

"--model",

503+

"openai-codex/gpt-5.5",

504+

"--prompt",

505+

"hello",

506+

"--json",

507+

],

508+

});

509+510+

expect(mocks.completeWithPreparedSimpleCompletionModel).toHaveBeenCalledWith(

511+

expect.objectContaining({

512+

context: expect.objectContaining({

513+

systemPrompt: "You are a personal assistant running inside OpenClaw.",

514+

messages: [

515+

expect.objectContaining({

516+

role: "user",

517+

content: "hello",

518+

}),

519+

],

520+

}),

521+

}),

522+

);

523+

});

524+466525

it("passes image files to gateway model probes as attachments", async () => {

467526

const tempInput = path.join(os.tmpdir(), `openclaw-model-run-gateway-image-${Date.now()}.png`);

468527

await fs.writeFile(tempInput, Buffer.from(PNG_1X1_BASE64, "base64"));

@@ -547,6 +606,26 @@ describe("capability cli", () => {

547606

expect(mocks.runtime.writeJson).not.toHaveBeenCalled();

548607

});

549608609+

it("surfaces provider errors when local model probes return no text output", async () => {

610+

mocks.completeWithPreparedSimpleCompletionModel.mockResolvedValueOnce({

611+

content: [],

612+

stopReason: "error",

613+

errorMessage: '{"detail":"Instructions are required"}',

614+

} as never);

615+616+

await expect(

617+

runRegisteredCli({

618+

register: registerCapabilityCli as (program: Command) => void,

619+

argv: ["capability", "model", "run", "--prompt", "hello", "--json"],

620+

}),

621+

).rejects.toThrow("exit 1");

622+623+

expect(mocks.runtime.error).toHaveBeenCalledWith(

624+

expect.stringContaining('{"detail":"Instructions are required"}'),

625+

);

626+

expect(mocks.runtime.writeJson).not.toHaveBeenCalled();

627+

});

628+550629

it("rejects local Codex provider probes before simple-completion dispatch", async () => {

551630

mocks.prepareSimpleCompletionModelForAgent.mockResolvedValueOnce({

552631

selection: {