mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:10:44 +00:00
Merge branch 'main' of https://github.com/openclaw/openclaw
* 'main' of https://github.com/openclaw/openclaw: Wizard: bound hatch TUI timeout (#76241) fix(cli): reject codex simple-completion probes fix: memoize plugin descriptor config keys (#76240) fix(heartbeat): make phase scheduling active-hours-aware (#75487) (#75597)
This commit is contained in:
@@ -547,6 +547,48 @@ describe("capability cli", () => {
|
||||
expect(mocks.runtime.writeJson).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("rejects local Codex provider probes before simple-completion dispatch", async () => {
|
||||
mocks.prepareSimpleCompletionModelForAgent.mockResolvedValueOnce({
|
||||
selection: {
|
||||
provider: "codex",
|
||||
modelId: "gpt-5.4",
|
||||
agentDir: "/tmp/agent",
|
||||
},
|
||||
model: {
|
||||
provider: "codex",
|
||||
id: "gpt-5.4",
|
||||
api: "openai-codex-responses",
|
||||
},
|
||||
auth: {
|
||||
apiKey: "codex-app-server",
|
||||
source: "codex-app-server",
|
||||
mode: "token",
|
||||
},
|
||||
} as never);
|
||||
|
||||
await expect(
|
||||
runRegisteredCli({
|
||||
register: registerCapabilityCli as (program: Command) => void,
|
||||
argv: [
|
||||
"capability",
|
||||
"model",
|
||||
"run",
|
||||
"--model",
|
||||
"codex/gpt-5.4",
|
||||
"--prompt",
|
||||
"hello",
|
||||
"--json",
|
||||
],
|
||||
}),
|
||||
).rejects.toThrow("exit 1");
|
||||
|
||||
expect(mocks.runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Codex app-server agent runtime"),
|
||||
);
|
||||
expect(mocks.completeWithPreparedSimpleCompletionModel).not.toHaveBeenCalled();
|
||||
expect(mocks.runtime.writeJson).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each(["", " ", "\n\t"])(
|
||||
"rejects empty model run prompts before local dispatch (%j)",
|
||||
async (prompt) => {
|
||||
|
||||
@@ -654,6 +654,11 @@ async function runModelRun(params: {
|
||||
if ("error" in prepared) {
|
||||
throw new Error(prepared.error);
|
||||
}
|
||||
if (prepared.selection.provider === "codex") {
|
||||
throw new Error(
|
||||
'The codex provider is served by the Codex app-server agent runtime, not the local simple-completion transport. Use an openai/<model> ref with agents.defaults.agentRuntime.id: "codex", run through the gateway, or use /codex commands.',
|
||||
);
|
||||
}
|
||||
const result = await completeWithPreparedSimpleCompletionModel({
|
||||
model: prepared.model,
|
||||
auth: prepared.auth,
|
||||
|
||||
Reference in New Issue
Block a user