
























@@ -782,6 +782,51 @@ describe("capability cli", () => {
782782);
783783});
784784785+it("reports missing image understanding configuration for image describe", async () => {
786+mocks.describeImageFile.mockResolvedValueOnce({
787+text: undefined,
788+decision: {
789+capability: "image",
790+outcome: "skipped",
791+attachments: [{ attachmentIndex: 0, attempts: [] }],
792+},
793+} as never);
794+795+await expect(
796+runRegisteredCli({
797+register: registerCapabilityCli as (program: Command) => void,
798+argv: ["capability", "image", "describe", "--file", "photo.jpg", "--json"],
799+}),
800+).rejects.toThrow("exit 1");
801+expect(mocks.runtime.error).toHaveBeenCalledWith(
802+expect.stringContaining("No image understanding provider is configured or ready"),
803+);
804+expect(mocks.runtime.error).toHaveBeenCalledWith(
805+expect.stringContaining("agents.defaults.imageModel.primary"),
806+);
807+});
808+809+it("reports missing image understanding configuration for image describe-many", async () => {
810+mocks.describeImageFile.mockResolvedValueOnce({
811+text: undefined,
812+decision: {
813+capability: "image",
814+outcome: "skipped",
815+attachments: [{ attachmentIndex: 0, attempts: [] }],
816+},
817+} as never);
818+819+await expect(
820+runRegisteredCli({
821+register: registerCapabilityCli as (program: Command) => void,
822+argv: ["capability", "image", "describe-many", "--file", "photo.jpg", "--json"],
823+}),
824+).rejects.toThrow("exit 1");
825+expect(mocks.runtime.error).toHaveBeenCalledWith(
826+expect.stringContaining("No image understanding provider is configured or ready"),
827+);
828+});
829+785830it("rewrites mismatched explicit image output extensions to the detected file type", async () => {
786831const jpegBase64 =
787832"/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEBUQEBAVFRUVFRUVFRUVFRUVFRUVFRUXFhUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGi0fHyUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAAEAAQMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQID/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oADAMBAAIQAxAAAAH2AP/EABgQAQEAAwAAAAAAAAAAAAAAAAEAEQIS/9oACAEBAAEFAk1o7//EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAwEBPwGn/8QAFhEBAQEAAAAAAAAAAAAAAAAAABEB/9oACAECAQE/AYf/xAAaEAACAgMAAAAAAAAAAAAAAAABEQAhMUFh/9oACAEBAAY/AjK9cY2f/8QAGhABAQACAwAAAAAAAAAAAAAAAAERITFBUf/aAAgBAQABPyGQk7W5jVYkA//Z";
@@ -1278,6 +1323,30 @@ describe("capability cli", () => {
12781323);
12791324});
128013251326+it("reports missing audio transcription configuration for audio transcribe", async () => {
1327+mocks.transcribeAudioFile.mockResolvedValueOnce({
1328+text: undefined,
1329+decision: {
1330+capability: "audio",
1331+outcome: "skipped",
1332+attachments: [{ attachmentIndex: 0, attempts: [] }],
1333+},
1334+} as never);
1335+1336+await expect(
1337+runRegisteredCli({
1338+register: registerCapabilityCli as (program: Command) => void,
1339+argv: ["capability", "audio", "transcribe", "--file", "memo.m4a", "--json"],
1340+}),
1341+).rejects.toThrow("exit 1");
1342+expect(mocks.runtime.error).toHaveBeenCalledWith(
1343+expect.stringContaining("No audio transcription provider is configured or ready"),
1344+);
1345+expect(mocks.runtime.error).toHaveBeenCalledWith(
1346+expect.stringContaining("tools.media.audio.models"),
1347+);
1348+});
1349+12811350it("surfaces the underlying transcription failure for audio transcribe", async () => {
12821351mocks.transcribeAudioFile.mockRejectedValueOnce(
12831352new Error("Audio transcription response missing text"),
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。