Ran test.sh to identify failing tests.
ReproduceAnalyzed failures in AI package tests related to tool stream support.
Understandrun test.sh, figure out the failing tests
Running tests concisely
I need to follow the user's instructions clearly since they've given a specific task about running test.sh. Alright, I think I should run it from the root of the repository using bash. It's essential not to use npm tests since the user has explicitly asked for this script to be executed. So, I’m getting prepared to run it now and aim to keep things concise as I do so.
>./test.shInspecting test outputs
I’m trying to understand why there are no failing tests, but the script still exited with 1. I think I need to check the full output near the end because there might be a hidden failure due to truncation. It’s possible that the important part got cut off, and reading the temporary file's full output might help clarify things. Let’s see what that reveals!
Identifying failing tests
I need to summarize the failing tests and focus on the file, package, and cause. It looks like the rest passed, but the script exits with 1 because the workspace for AI has failed. I might want to look for the relevant code. The user wants to figure out the failing tests, so I'll mention that the z.ai model might have some compatibility issues with missing or renamed metadata. I could inspect the tests or model data for more insights.
>rg -n "zaiToolStream|tool_stream|glm-5|glm-4\.7" packages/aiInspecting models for compatibility
I think I need to inspect the generated models to check for compatibility. It sounds like I might want to focus on reading specific relevant lines to help with that. I’m curious about what I might find there that could indicate potential issues or successes in compatibility. I'll take my time to ensure I’m thorough since this seems important.
Evaluating model generation issue
I need to mention a specific likely cause for the problem: it seems that the generated models lack compat.zaiToolStream. I could point out that the script for generate-models includes it, but the generated file doesn't, which could mean the generated file is stale or there's a logic mismatch. I should inspect the situation around glm-4.7 for further clarification. I'll keep considering these details as I go!
Checking implementation details
I think I need to check the implementation around line 398 to make sure everything’s working smoothly. If it's marked as "compat false" and "undefined," it might be alright since the explicit override in tests is passing. It seems like the issue is just with the metadata. I could mention the location too, but it might just be enough to keep it concise and avoid using an em dash. Let's finalize this!
./test.sh fails because packages/ai has 2 failing tests. Everything else passed.
Failing tests
packages/ai/test/openai-completions-tool-choice.test.ts:203
enables tool_stream for supported z.ai models with toolsparams.tool_stream === trueundefinedpackages/ai/test/openai-completions-tool-choice.test.ts:240
stores z.ai tool_stream support in model compat metadatagetModel("zai", "glm-5")?.compat?.zaiToolStream === trueundefinedWhat this points to
compat.zaiToolStream for supported models.packages/ai/src/providers/openai-completions.ts:398.packages/ai/src/models.generated.ts:13911 (glm-4.7)packages/ai/src/models.generated.ts:13929 (glm-4.7-flash)packages/ai/src/models.generated.ts:13965 (glm-5)compat: {"supportsDeveloperRole":false,"thinkingFormat":"zai"}zaiToolStream:trueLikely root cause
packages/ai/scripts/generate-models.ts:402 has logic to add zaiToolStream: true, but packages/ai/src/models.generated.ts looks stale or the generation path is not applying it for these models.High level result
1 failed | 24 passed | 19 skipped in packages/aitest.sh exits with code 1 because of that workspace failureIf you want, I can trace why the generated models missed zaiToolStream and fix it.