pi-mono/packages/ai/test
Samwise Wang 279f53b098
fix(ai): use "(no tool output)" placeholder for empty tool results without images (#6290)
OpenAI Completions and Responses providers unconditionally replaced empty
tool result text with "(see attached image)", even when the result had no
image content. This caused the model to hallucinate image attachments for
commands that produce no output (e.g. curl -s with SSL errors, grep with
no matches, true/false).

Now matches the Google provider behavior: "(see attached image)" is only
used when images are actually present; empty results get "(no tool output)".

Co-authored-by: tzwm <tzwm@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-06 21:42:56 +02:00
..
data feat(ai): Add image input tests for vision-capable models 2025-08-30 18:37:17 +02:00
abort.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-adaptive-thinking-models.test.ts fix(ai): update generated model catalogue 2026-06-30 22:12:48 +02:00
anthropic-cache-write-1h-cost.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
anthropic-eager-tool-input-compat.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
anthropic-eager-tool-input-e2e.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-empty-thinking-signature-compat.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-force-adaptive-thinking.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-long-cache-retention-e2e.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-oauth.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
anthropic-opus-4-8-smoke.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-sse-parsing.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
anthropic-temperature-compat.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
anthropic-thinking-disable.test.ts fix(ai): update generated model catalogue 2026-06-30 22:12:48 +02:00
anthropic-tool-name-normalization.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
azure-openai-base-url.test.ts Support modern Microsoft Foundry Responses API endpoints: 2026-06-23 15:38:43 +02:00
azure-utils.ts add Azure deployment name map and refresh generated models 2026-01-24 12:04:34 +01:00
bedrock-convert-messages.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
bedrock-custom-headers.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
bedrock-endpoint-resolution.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
bedrock-models.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
bedrock-thinking-payload.test.ts fix(ai): update generated model catalogue 2026-06-30 22:12:48 +02:00
bedrock-utils.ts feat(ai): Add Amazon Bedrock provider (#494) 2026-01-13 00:32:59 +01:00
cache-retention.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
cloudflare-utils.ts fix(ai): finalize cloudflare gateway provider support 2026-05-01 00:56:05 +02:00
codex-websocket-cached-probe.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
compat-env.test.ts feat(ai): complete models runtime migration 2026-06-23 15:29:46 +02:00
context-overflow.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
cross-provider-handoff.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
empty.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
env-api-keys.test.ts feat(ai): add ZAI Coding Plan China provider 2026-06-02 23:39:56 +08:00
error-body.test.ts fix(ai): surface provider HTTP error body instead of opaque SDK message 2026-06-25 12:07:51 +02:00
faux-provider.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
fireworks-models.test.ts fix(ai): align Fireworks GLM 5.2 Fast with GLM 5.2 2026-07-01 10:34:46 +02:00
github-copilot-anthropic.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
github-copilot-oauth.test.ts fix(ai): honor server-provided slow_down interval in device-code polling 2026-07-03 22:26:12 +02:00
google-shared-convert-tools.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
google-shared-gemini3-unsigned-tool-call.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
google-shared-image-tool-result-routing.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
google-thinking-disable.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
google-thinking-signature.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
google-vertex-api-key-resolution.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
image-tool-result.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
images-models.test.ts feat(ai): pass provider-resolved env to APIs 2026-06-23 13:42:25 +02:00
images.test.ts chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
interleaved-thinking.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
lax-message-content.test.ts fix(ai,agent,coding-agent): normalize null message content at ingestion boundaries (#6343) 2026-07-06 20:47:08 +02:00
lazy-module-load.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
mistral-reasoning-mode.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
mistral-tool-schema.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
models-runtime.test.ts fix(ai): resolve request-scoped auth before provider calls 2026-06-23 23:27:00 +02:00
node-http-proxy.test.ts feat: add provider-scoped environment overrides (#5807) 2026-06-16 17:19:08 +02:00
oauth-auth.test.ts fix(ai): mock copilot models in oauth test 2026-06-22 17:49:18 +02:00
oauth-device-code.test.ts fix(ai): honor server-provided slow_down interval in device-code polling 2026-07-03 22:26:12 +02:00
oauth.ts chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
openai-codex-cache-affinity-e2e.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
openai-codex-oauth.test.ts feat(ai): add Codex device code login (#4911) 2026-05-28 11:09:33 +02:00
openai-codex-stream.test.ts fix(ai): rotate stale Codex websocket sessions 2026-07-03 15:30:41 +02:00
openai-completions-cache-control-format.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
openai-completions-empty-tools.test.ts fix(ai): clamp streamSimple max tokens 2026-06-25 14:10:28 +02:00
openai-completions-prompt-cache.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
openai-completions-reasoning-details.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
openai-completions-response-model.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
openai-completions-retry.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
openai-completions-thinking-as-text.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
openai-completions-tool-choice.test.ts fix(ai): preserve Z.AI thinking content 2026-06-29 08:40:20 +02:00
openai-completions-tool-result-images.test.ts fix(ai): use "(no tool output)" placeholder for empty tool results without images (#6290) 2026-07-06 21:42:56 +02:00
openai-responses-cache-affinity-e2e.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
openai-responses-copilot-provider.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
openai-responses-empty-tool-result.test.ts fix(ai): use "(no tool output)" placeholder for empty tool results without images (#6290) 2026-07-06 21:42:56 +02:00
openai-responses-foreign-toolcall-id.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
openai-responses-message-id.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
openai-responses-partial-json-cleanup.test.ts fix(ai): require OpenAI Responses terminal events 2026-06-23 16:35:45 +02:00
openai-responses-reasoning-replay-e2e.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
openai-responses-terminal-event.test.ts fix(ai): require OpenAI Responses terminal events 2026-06-23 16:35:45 +02:00
openai-responses-tool-result-images.test.ts fix: remove redundant record guards 2026-07-05 18:55:09 +02:00
openrouter-cache-write-repro.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
openrouter-images.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
overflow.test.ts fix(ai): detect DS4 context overflow errors 2026-07-02 20:39:49 +02:00
provider-error-body-passthrough.test.ts fix(ai): surface provider HTTP error body instead of opaque SDK message 2026-06-25 12:07:51 +02:00
provider-error-body-regression.test.ts fix(ai): surface provider HTTP error body instead of opaque SDK message 2026-06-25 12:07:51 +02:00
providers.test.ts fix(ai): align api key credentials with auth json 2026-06-23 22:29:46 +02:00
responseid.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
retry.test.ts fix(ai): retry Cloudflare 524 timeouts 2026-07-03 23:03:35 +02:00
scratch.ts feat(ai): sync model reads, explicit async refresh 2026-06-10 23:30:04 +02:00
stream.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
supports-xhigh.test.ts Merge main into model-registry 2026-06-22 14:00:18 +02:00
together-models.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
tokens.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
tool-call-id-normalization.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
tool-call-without-result.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
total-tokens.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
transform-messages-copilot-openai-to-anthropic.test.ts feat(ai): move API implementations to src/api with lazy wrappers (phase 2) 2026-06-10 20:08:59 +02:00
unicode-surrogate.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
validation.test.ts chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
xhigh.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
xiaomi-models.test.ts feat(ai): compat entrypoint, core-only root barrel (phase 5) 2026-06-10 21:17:12 +02:00
xiaomi-token-plan-ams-anthropic-empty-signature-smoke.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
zen.test.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00