mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-06 23:44:36 +00:00
Images produced by tools (extensions, MCP bridges, screenshot tools) went into session history at full resolution because processImage was only wired to the read tool and @file CLI attachments. Providers validate every image in the request, so one oversized image poisons the whole conversation: Anthropic drops its per-image cap from 8000px to 2000px once a request carries many images, and every later turn re-sends the same payload. Switching models does not help. Normalize tool result images in AgentSession.afterToolCall, after the extension tool_result hook so extension-injected images are covered too. Honors images.autoResize, and keeps the original block when processing fails so an unavailable image backend does not delete tool output. Refs #5369 Assisted-By: devx/86bf3b09-9aba-4d03-8154-50fca3ffc9b5 |
||
|---|---|---|
| .. | ||
| regressions | ||
| agent-session-bash-persistence.test.ts | ||
| agent-session-compaction.test.ts | ||
| agent-session-model-extension.test.ts | ||
| agent-session-prompt.test.ts | ||
| agent-session-queue.test.ts | ||
| agent-session-retry-events.test.ts | ||
| agent-session-runtime.test.ts | ||
| agent-session-tool-result-images.test.ts | ||
| harness.ts | ||
| lax-message-content.test.ts | ||
| README.md | ||
Coding agent suite tests
Use test/suite/ for the new harness-based test suite around AgentSession and AgentSessionRuntime.
Rules:
- Use
test/suite/harness.ts - Use the faux provider from
packages/ai/src/providers/faux.ts - Do not use real provider APIs, real API keys, network calls, or paid tokens
- Keep these tests CI-safe and deterministic
- Do not use or extend the legacy
test/test-harness.tspath unless a missing capability forces it
Organization:
- Put broad lifecycle and characterization tests directly under
test/suite/ - Put issue-specific regression tests under
test/suite/regressions/ - Name regression tests as
<issue-number>-<short-slug>.test.ts - Example:
test/suite/regressions/2023-queued-slash-command-followup.test.ts