mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 06:00:43 +00:00
fix(cli): fail empty local model probes
This commit is contained in:
@@ -419,6 +419,24 @@ describe("capability cli", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("fails local model probes when the provider returns no text output", async () => {
|
||||
mocks.completeWithPreparedSimpleCompletionModel.mockResolvedValueOnce({
|
||||
content: [],
|
||||
} as never);
|
||||
|
||||
await expect(
|
||||
runRegisteredCli({
|
||||
register: registerCapabilityCli as (program: Command) => void,
|
||||
argv: ["capability", "model", "run", "--prompt", "hello", "--json"],
|
||||
}),
|
||||
).rejects.toThrow("exit 1");
|
||||
|
||||
expect(mocks.runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining('No text output returned for provider "openai" model "gpt-5.4"'),
|
||||
);
|
||||
expect(mocks.runtime.writeJson).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("runs gateway model probes without chat-agent prompt policy or tools", async () => {
|
||||
await runRegisteredCli({
|
||||
register: registerCapabilityCli as (program: Command) => void,
|
||||
|
||||
Reference in New Issue
Block a user