GeezerVison is showing github.com — test: repair stale V2 baseline coverage (#45826) · jinhuang712/opencode@b73fb19
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/executor.test.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -574,6 +574,7 @@ describe("WebSocket channel execution", () => { | 574 | 574 | const model = configure({ baseURL: "https://api.openai.test/v1/", apiKey: "test" }).responses("gpt-4.1-mini") | 575 | 575 | const request = LLM.request({ model, prompt: "Say hello." }) | 576 | 576 | const frames = [ | | 577 | + JSON.stringify({ type: "response.output_item.added", item: { type: "message", id: "msg_1" } }), | 577 | 578 | JSON.stringify({ type: "response.output_text.delta", item_id: "msg_1", delta: "Hi" }), | 578 | 579 | JSON.stringify({ type: "response.completed", response: { id: "resp_1" } }), | 579 | 580 | ] | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/anthropic-messages-cache/keeps-a-long-tool-turn-inside-the-cache-lookback.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "transport": "http", | 11 | 11 | "request": { | 12 | 12 | "method": "POST", | 13 | | - "url": "https://api.anthropic.com/v1/messages", | | 13 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 14 | 14 | "headers": { | 15 | 15 | "anthropic-version": "2023-06-01", | 16 | 16 | "content-type": "application/json" | | 29 | 29 | "transport": "http", | 30 | 30 | "request": { | 31 | 31 | "method": "POST", | 32 | | - "url": "https://api.anthropic.com/v1/messages", | | 32 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 33 | 33 | "headers": { | 34 | 34 | "anthropic-version": "2023-06-01", | 35 | 35 | "content-type": "application/json" | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/anthropic-messages-cache/writes-then-reads-cache-control-on-identical-second-call.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "transport": "http", | 11 | 11 | "request": { | 12 | 12 | "method": "POST", | 13 | | - "url": "https://api.anthropic.com/v1/messages", | | 13 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 14 | 14 | "headers": { | 15 | 15 | "anthropic-version": "2023-06-01", | 16 | 16 | "content-type": "application/json" | | 29 | 29 | "transport": "http", | 30 | 30 | "request": { | 31 | 31 | "method": "POST", | 32 | | - "url": "https://api.anthropic.com/v1/messages", | | 32 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 33 | 33 | "headers": { | 34 | 34 | "anthropic-version": "2023-06-01", | 35 | 35 | "content-type": "application/json" | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/anthropic-messages/anthropic-opus-4-7-image-tool-result.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | "transport": "http", | 25 | 25 | "request": { | 26 | 26 | "method": "POST", | 27 | | - "url": "https://api.anthropic.com/v1/messages", | | 27 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 28 | 28 | "headers": { | 29 | 29 | "anthropic-version": "2023-06-01", | 30 | 30 | "content-type": "application/json" | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/openrouter-reasoning-tool-loop.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | "headers": { | 24 | 24 | "content-type": "application/json" | 25 | 25 | }, | 26 | | - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"reasoning\":{\"max_tokens\":1024}}" | | 26 | + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning\":{\"max_tokens\":1024},\"max_completion_tokens\":1536,\"store\":false,\"usage\":{\"include\":true}}" | 27 | 27 | }, | 28 | 28 | "response": { | 29 | 29 | "status": 200, | | 41 | 41 | "headers": { | 42 | 42 | "content-type": "application/json" | 43 | 43 | }, | 44 | | - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"Sure! Let me check the weather in Paris for you right now!\",\"tool_calls\":[{\"id\":\"toolu_01PaChhcyw3yu2P2bDS2bgAA\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"format\":\"anthropic-claude-v1\",\"index\":0,\"signature\":\"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDRjMGYwNDZmLTI1ZmQtNDVmYi1iZmIzLWEwOGE4ZTI0OWNhNxIMNFb5O6pb4nX0HojdGgyL5h+CAIpsxpdM1QgiMGm/i3ST6F5mAhxB+Uez0Cm95ra9yvQkrzHaA/AmWoXpdmPlczSn1S1RDk2IqeA57Spbf7JT44jygtLQt6yZmGzoTBHn3VkwaNZsuuAtbdo4B5QJXooa/AoKKs54QZ2kfS640vsv5flQVCg7CoQCFuLKjIeLMO7MnxVyuskXJr1DgesTa7I0ScF53U9JGhgB\"}]},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01PaChhcyw3yu2P2bDS2bgAA\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"reasoning\":{\"max_tokens\":1024}}" | | 44 | + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"Sure! Let me check the weather in Paris for you right now!\",\"tool_calls\":[{\"id\":\"toolu_01PaChhcyw3yu2P2bDS2bgAA\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"format\":\"anthropic-claude-v1\",\"index\":0,\"signature\":\"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDRjMGYwNDZmLTI1ZmQtNDVmYi1iZmIzLWEwOGE4ZTI0OWNhNxIMNFb5O6pb4nX0HojdGgyL5h+CAIpsxpdM1QgiMGm/i3ST6F5mAhxB+Uez0Cm95ra9yvQkrzHaA/AmWoXpdmPlczSn1S1RDk2IqeA57Spbf7JT44jygtLQt6yZmGzoTBHn3VkwaNZsuuAtbdo4B5QJXooa/AoKKs54QZ2kfS640vsv5flQVCg7CoQCFuLKjIeLMO7MnxVyuskXJr1DgesTa7I0ScF53U9JGhgB\"}]},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01PaChhcyw3yu2P2bDS2bgAA\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning\":{\"max_tokens\":1024},\"max_completion_tokens\":1536,\"store\":false,\"usage\":{\"include\":true}}" | 45 | 45 | }, | 46 | 46 | "response": { | 47 | 47 | "status": 200, | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/openrouter-reasoning.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | "headers": { | 16 | 16 | "content-type": "application/json" | 17 | 17 | }, | 18 | | - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Think through the arithmetic, then reply with only the final integer.\"},{\"role\":\"user\",\"content\":\"What is 173 multiplied by 219?\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"temperature\":0,\"reasoning\":{\"max_tokens\":1024}}" | | 18 | + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Think through the arithmetic, then reply with only the final integer.\"},{\"role\":\"user\",\"content\":\"What is 173 multiplied by 219?\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"temperature\":0,\"reasoning\":{\"max_tokens\":1024},\"max_completion_tokens\":1536,\"store\":false,\"usage\":{\"include\":true}}" | 19 | 19 | }, | 20 | 20 | "response": { | 21 | 21 | "status": 200, | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/pdf/anthropic-tool-result.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "transport": "http", | 11 | 11 | "request": { | 12 | 12 | "method": "POST", | 13 | | - "url": "https://api.anthropic.com/v1/messages", | | 13 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 14 | 14 | "headers": { | 15 | 15 | "content-type": "application/json" | 16 | 16 | }, | 17 | | - "body": "{\"model\":\"claude-haiku-4-5-20251001\",\"system\":[{\"type\":\"text\",\"text\":\"Read the PDF returned by the tool and follow the user's response format exactly.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Return only the verification code from the PDF.\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_pdf_1\",\"name\":\"read_pdf\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_pdf_1\",\"content\":[{\"type\":\"text\",\"text\":\"PDF read successfully\"},{\"type\":\"document\",\"source\":{\"type\":\"base64\",\"media_type\":\"application/pdf\",\"data\":\"JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA1IDAgUiA+PiA+PiAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCA3NSA+PgpzdHJlYW0KQlQKL0YxIDE4IFRmCjcyIDcyMCBUZAooUERGIGNhc3NldHRlIHZlcmlmaWNhdGlvbiBjb2RlOiBPUkNISUQtNzM5MSkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UeXBlMSAvQmFzZUZvbnQgL0hlbHZldGljYSA+PgplbmRvYmoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMDAwMCBuIAowMDAwMDAwMjQxIDAwMDAwIG4gCjAwMDAwMDAzNjUgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA2IC9Sb290IDEgMCBSID4+CnN0YXJ0eHJlZgo0MzUKJSVFT0YK\"}}]}]}],\"tools\":[{\"name\":\"read_pdf\",\"description\":\"Read the attached PDF.\",\"input_schema\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":40,\"temperature\":0}" | | 17 | + "body": "{\"model\":\"claude-haiku-4-5-20251001\",\"system\":[{\"type\":\"text\",\"text\":\"Read the PDF returned by the tool and follow the user's response format exactly.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Return only the verification code from the PDF.\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_pdf_1\",\"name\":\"read_pdf\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_pdf_1\",\"content\":[{\"type\":\"text\",\"text\":\"PDF read successfully\"},{\"type\":\"document\",\"source\":{\"type\":\"base64\",\"media_type\":\"application/pdf\",\"data\":\"JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA1IDAgUiA+PiA+PiAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCA3NSA+PgpzdHJlYW0KQlQKL0YxIDE4IFRmCjcyIDcyMCBUZAooUERGIGNhc3NldHRlIHZlcmlmaWNhdGlvbiBjb2RlOiBPUkNISUQtNzM5MSkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UeXBlMSAvQmFzZUZvbnQgL0hlbHZldGljYSA+PgplbmRvYmoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMDAwMCBuIAowMDAwMDAwMjQxIDAwMDAwIG4gCjAwMDAwMDAzNjUgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA2IC9Sb290IDEgMCBSID4+CnN0YXJ0eHJlZgo0MzUKJSVFT0YK\"},\"title\":\"verification.pdf\"}]}]}],\"tools\":[{\"name\":\"read_pdf\",\"description\":\"Read the attached PDF.\",\"input_schema\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":40,\"temperature\":0}" | 18 | 18 | }, | 19 | 19 | "response": { | 20 | 20 | "status": 200, | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/fixtures/recordings/pdf/anthropic-user-input.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "transport": "http", | 11 | 11 | "request": { | 12 | 12 | "method": "POST", | 13 | | - "url": "https://api.anthropic.com/v1/messages", | | 13 | + "url": "https://api.anthropic.com/v1/messages?beta=true", | 14 | 14 | "headers": { | 15 | 15 | "content-type": "application/json" | 16 | 16 | }, | 17 | | - "body": "{\"model\":\"claude-haiku-4-5-20251001\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"document\",\"source\":{\"type\":\"base64\",\"media_type\":\"application/pdf\",\"data\":\"JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA1IDAgUiA+PiA+PiAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCA3NSA+PgpzdHJlYW0KQlQKL0YxIDE4IFRmCjcyIDcyMCBUZAooUERGIGNhc3NldHRlIHZlcmlmaWNhdGlvbiBjb2RlOiBPUkNISUQtNzM5MSkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UeXBlMSAvQmFzZUZvbnQgL0hlbHZldGljYSA+PgplbmRvYmoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMDAwMCBuIAowMDAwMDAwMjQxIDAwMDAwIG4gCjAwMDAwMDAzNjUgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA2IC9Sb290IDEgMCBSID4+CnN0YXJ0eHJlZgo0MzUKJSVFT0YK\"}},{\"type\":\"text\",\"text\":\"Return only the verification code from the PDF.\"}]}],\"stream\":true,\"max_tokens\":40,\"temperature\":0}" | | 17 | + "body": "{\"model\":\"claude-haiku-4-5-20251001\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"document\",\"source\":{\"type\":\"base64\",\"media_type\":\"application/pdf\",\"data\":\"JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA1IDAgUiA+PiA+PiAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCA3NSA+PgpzdHJlYW0KQlQKL0YxIDE4IFRmCjcyIDcyMCBUZAooUERGIGNhc3NldHRlIHZlcmlmaWNhdGlvbiBjb2RlOiBPUkNISUQtNzM5MSkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UeXBlMSAvQmFzZUZvbnQgL0hlbHZldGljYSA+PgplbmRvYmoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMDAwMCBuIAowMDAwMDAwMjQxIDAwMDAwIG4gCjAwMDAwMDAzNjUgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA2IC9Sb290IDEgMCBSID4+CnN0YXJ0eHJlZgo0MzUKJSVFT0YK\"},\"title\":\"verification.pdf\"},{\"type\":\"text\",\"text\":\"Return only the verification code from the PDF.\"}]}],\"stream\":true,\"max_tokens\":40,\"temperature\":0}" | 18 | 18 | }, | 19 | 19 | "response": { | 20 | 20 | "status": 200, | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/provider-package.test.ts +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { describe, expect, test } from "bun:test" | 2 | 2 | import { model } from "@opencode-ai/ai/providers/openai" | | 3 | +import { LLM } from "../src/index.js" | | 4 | +import { Endpoint } from "../src/route/endpoint.js" | 3 | 5 |
| 4 | 6 | describe("provider package entrypoints", () => { | 5 | 7 | test("semantic API aliases expose the same contract", async () => { | @@ -36,7 +38,8 @@ describe("provider package entrypoints", () => { | 36 | 38 | expect(modules[0].model).toBe(modules[1].model) | 37 | 39 | expect(modules[8].model).toBe(modules[9].model) | 38 | 40 | expect(modules[12].model).toBe(modules[13].model) | 39 | | - expect(modules[19].model).toBe(modules[20].model) | | 41 | + expect(modules[19].model).toBe(modules[21].model) | | 42 | + expect(modules[19].model).not.toBe(modules[20].model) | 40 | 43 | }) | 41 | 44 |
| 42 | 45 | test("maps DeepInfra package settings onto its native executable model", async () => { | @@ -139,8 +142,10 @@ describe("provider package entrypoints", () => { | 139 | 142 | expect(selected.route.id).toBe("anthropic-messages") | 140 | 143 | expect(selected.route.endpoint).toMatchObject({ | 141 | 144 | baseURL: "https://messages.example.test/v1", | 142 | | - path: "/messages", | 143 | 145 | }) | | 146 | + expect( | | 147 | + Endpoint.render(selected.route.endpoint, { request: LLM.request({ model: selected }), body: {} }).toString(), | | 148 | + ).toBe("https://messages.example.test/v1/messages") | 144 | 149 | expect(selected.route.defaults.headers).toEqual({ "x-application": "opencode" }) | 145 | 150 | expect(selected.route.defaults.http?.body).toEqual({ metadata: { user_id: "user_1" } }) | 146 | 151 | expect(selected.route.defaults.providerOptions).toEqual({ effort: "low" }) | |
Collapse file Copy file name to clipboardExpand all lines: packages/ai/test/provider/openrouter.test.ts +29-4Lines changed: 29 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -305,9 +305,11 @@ describe("OpenRouter", () => { | 305 | 305 | expect(prepared.body.messages).toEqual([ | 306 | 306 | { | 307 | 307 | role: "assistant", | 308 | | - content: null, | | 308 | + content: "", | 309 | 309 | reasoning: "Thinking", | | 310 | + reasoning_content: undefined, | 310 | 311 | reasoning_details: details, | | 312 | + reasoning_text: undefined, | 311 | 313 | }, | 312 | 314 | ]) | 313 | 315 | }), | @@ -335,7 +337,14 @@ describe("OpenRouter", () => { | 335 | 337 | ) | 336 | 338 |
| 337 | 339 | expect(prepared.body.messages).toEqual([ | 338 | | - { role: "assistant", content: null, reasoning: "Thinking", reasoning_details: details }, | | 340 | + { | | 341 | + role: "assistant", | | 342 | + content: "", | | 343 | + reasoning: "Thinking", | | 344 | + reasoning_content: undefined, | | 345 | + reasoning_details: details, | | 346 | + reasoning_text: undefined, | | 347 | + }, | 339 | 348 | ]) | 340 | 349 | }), | 341 | 350 | ) | @@ -361,7 +370,14 @@ describe("OpenRouter", () => { | 361 | 370 | ) | 362 | 371 |
| 363 | 372 | expect(prepared.body.messages).toEqual([ | 364 | | - { role: "assistant", content: null, reasoning: "AB", reasoning_details: details }, | | 373 | + { | | 374 | + role: "assistant", | | 375 | + content: "", | | 376 | + reasoning: "AB", | | 377 | + reasoning_content: undefined, | | 378 | + reasoning_details: details, | | 379 | + reasoning_text: undefined, | | 380 | + }, | 365 | 381 | ]) | 366 | 382 | }), | 367 | 383 | ) | @@ -376,7 +392,16 @@ describe("OpenRouter", () => { | 376 | 392 | }), | 377 | 393 | ) | 378 | 394 |
| 379 | | - expect(prepared.body.messages).toEqual([{ role: "assistant", content: null }]) | | 395 | + expect(prepared.body.messages).toEqual([ | | 396 | + { | | 397 | + role: "assistant", | | 398 | + content: "", | | 399 | + reasoning: undefined, | | 400 | + reasoning_content: undefined, | | 401 | + reasoning_details: undefined, | | 402 | + reasoning_text: undefined, | | 403 | + }, | | 404 | + ]) | 380 | 405 | }), | 381 | 406 | ) | 382 | 407 | }) |
|