mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
fix(cli): explain empty capability listings (#128852)
This commit is contained in:
committed by
GitHub
parent
3a17d5993a
commit
5775cd3dfa
@@ -875,6 +875,16 @@ describe("capability cli", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("renders an explicit empty model list without changing JSON output", async () => {
|
||||
mocks.loadModelCatalog.mockResolvedValue([]);
|
||||
|
||||
await runCapability("model", "list", "--json");
|
||||
expect(mocks.runtime.writeJson).toHaveBeenCalledWith([]);
|
||||
|
||||
await runCapability("model", "list");
|
||||
expect(mocks.runtime.log).toHaveBeenCalledWith("No results found.");
|
||||
});
|
||||
|
||||
it("reports model providers configured through their environment key", async () => {
|
||||
vi.stubEnv("OPENAI_API_KEY", "test-openai-key");
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export function formatEnvelopeForText(value: unknown): string {
|
||||
|
||||
export function providerSummaryText(value: unknown): string {
|
||||
const providers = value as Array<Record<string, unknown>>;
|
||||
return providers.map((entry) => JSON.stringify(entry)).join("\n");
|
||||
return providers.map((entry) => JSON.stringify(entry)).join("\n") || "No results found.";
|
||||
}
|
||||
|
||||
function hasOwnKeys(value: unknown): boolean {
|
||||
|
||||
Reference in New Issue
Block a user