Repository navigation
Tests: move to @cloudflare/vitest-plugin - #3098
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 4d1f386 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Contributor
|
✅ agents import sizes: no significant changes ( |
mattzcarey
force-pushed
the
slim/limits-11
branch
from
November 24, 2026 05:57
d3b413b to
c91dd16
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 05:57
bebf955 to
a32571e
Compare
mattzcarey
force-pushed
the
slim/limits-11
branch
from
November 24, 2026 07:01
c91dd16 to
390d8b8
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 07:01
a32571e to
fdcb754
Compare
mattzcarey
force-pushed
the
slim/limits-11
branch
from
November 24, 2026 07:38
390d8b8 to
b0f0c91
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 07:38
fdcb754 to
3c8bdbc
Compare
mattzcarey
force-pushed
the
slim/limits-11
branch
from
November 24, 2026 07:53
b0f0c91 to
dd6ee17
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 07:53
3c8bdbc to
6e649c9
Compare
mattzcarey
force-pushed
the
slim/limits-11
branch
from
November 24, 2026 09:55
dd6ee17 to
f891a10
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 09:55
6e649c9 to
7c3d840
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
11 times, most recently
from
November 24, 2026 19:38
0fdb93e to
02dbe92
Compare
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
3 times, most recently
from
November 24, 2026 21:04
81b6fbe to
6ee9456
Compare
… and flags; do not upload wrangler config as a module
mattzcarey
force-pushed
the
slim/vitest-plugin
branch
from
November 24, 2026 21:32
6ee9456 to
74181a7
Compare
… from Pyodide 0.26.0a2; pi test retries an alarm that fired first; doc workerd version
…ag uses Pyodide 314.0.4
… with the early 3.14 flag
ben-reitz
added a commit
that referenced
this pull request
Nov 25, 2026
…0.34 (#3171) * chore(agents): bump Pi to 1.6.1 Pi packages to ~1.6.1 (pi-tui 1.6.1 exact) in agents, the Pi examples and experimental/pi-recovery, and the pi-agent-core>pi-ai override to ~1.6.1. Pi 1.6.1 is a patch, but it ships everything on Pi main since 1.6.0, including tagged tool parks, so a fresh install of a released agents already picks it up. It stores pi.tool v4 and pi.generation v3 as 1.6.0 does, so rolling back to 1.6.0 stays safe. * fix(agents): word an error finish reason as pi-ai does on the chat-completions wire A chat-completions stream that ends with `finish_reason: "error"` now fails with pi-ai's own message, "Provider finish_reason: <reason>", instead of our "The model stopped with finish_reason ...". pi-ai's retry classifier matches "provider finish_reason: error" since earendil-works/pi@a00a504, so PiHarness retries such a mid-stream vendor failure, as Pi 1.6.1 does with its own openai-completions API. * docs(agents): park Pi tools and read signals with Pi's tagged forms earendil-works/pi@32c71a6 tags tool parks ({ kind: "sleep", ... }, flat) and SignalState ({ kind: "value" } or { kind: "expired" }). Every result field is optional, so the old { sleep: { ... } } still type-checks and Pi takes it as an empty result: the harness's parked-tool tests failed that way. The test tools and the pi.md samples now use the tagged forms; a beforeTool gate keeps { sleep: { ... } }. * test(agents): use a Groq model pi-ai still lists in the chat-completions tests Pi main drops Groq models that models.dev marks deprecated, including llama-3.1-8b-instant, so the fixture lookup threw. openai/gpt-oss-20b is listed with the same compat in Pi 1.6.0 and on Pi main. * fix(agents): record OpenRouter's native finish reason as pi-ai does on the chat-completions wire Pi main's openai-completions records OpenRouter's native_finish_reason (the upstream provider's own reason) in rawStopReason, e.g. error.MALFORMED_FUNCTION_CALL, and appends it to error messages after pi-ai's "Provider finish_reason:" prefix, so retry matching is unchanged. Our wire assembles the message itself, so it now sets rawStopReason and uses pi-ai's own OpenRouter helpers for the native reason. Needs the Pi release that ships utils/openrouter-finish-reason. * fix(agents): report every response to onResponse, failures included, as pi-ai does earendil-works/pi@8a57d42 makes pi-ai's onResponse fire for HTTP error responses and each retried attempt. pi-ai's Anthropic implementation now reports a vendor's error response through the gateway too, but AI Gateway's own failures (a gateway envelope, or any non-2xx from /run) threw before onResponse on all three wires. sendGateway now awaits the callback before it throws, the chat-completions and Responses wires report through it, and the Anthropic wire reports a response the SDK never sees because sendGateway threw. * fix(agents): read a large streamed SSE event in linear time earendil-works/pi@da7e26c fixes pi-ai's SSE readers rescanning an incomplete event on every chunk. sseDataStream, which the pi-ai chat-completions and Responses wires and the AI SDK provider read streams with, had the same cost: it ran its line regex over the whole buffer on each chunk, so an 8 MB event in 512-byte chunks took about 6 s. It now scans only the new text and joins an incomplete line once, when it ends. * test(agents): send no disabled thinking to a catalog Claude that cannot turn it off earendil-works/pi@433c1fd marks "off" unsupported on Claude Opus 5.5 and Sonnet 5.5 in pi's Cloudflare AI Gateway catalog, which reject thinking: { type: "disabled" } with a 400. The Anthropic wire reads the catalog's thinkingLevelMap through pi-ai, so the fix reaches it unchanged; this pins that a streamSimple call without reasoning sends no disabled thinking to anthropic/claude-opus-5.5 and still disables it on Haiku 5.5. On Pi 1.6.0's catalog the Opus call sends disabled. * chore(changeset): name Pi 1.6.1 and link its changelog * test(agents): run a Pi wake's alarm once it is armed instead of racing it Backports the harness.test.ts part of #3098 (e44ff29) onto release/0.34. On agents 0.34.0 the restarted-root test read the alarm while the wake its startup pushed was still pending, and failed about 2 runs in 5. It now runs that wake's alarm itself and waits for the fallback alarm to clear.
ben-reitz
added a commit
that referenced
this pull request
Nov 26, 2026
* ci: release from release/** branches too Lets a fix ship from an earlier release's code while main carries unfinished work. A push runs the workflow file from the pushed branch, so this commit only has to be on the release branch. * fix(agents): support Pi 1.6.1, whose tool parks already reach agents 0.34 (#3171) * chore(agents): bump Pi to 1.6.1 Pi packages to ~1.6.1 (pi-tui 1.6.1 exact) in agents, the Pi examples and experimental/pi-recovery, and the pi-agent-core>pi-ai override to ~1.6.1. Pi 1.6.1 is a patch, but it ships everything on Pi main since 1.6.0, including tagged tool parks, so a fresh install of a released agents already picks it up. It stores pi.tool v4 and pi.generation v3 as 1.6.0 does, so rolling back to 1.6.0 stays safe. * fix(agents): word an error finish reason as pi-ai does on the chat-completions wire A chat-completions stream that ends with `finish_reason: "error"` now fails with pi-ai's own message, "Provider finish_reason: <reason>", instead of our "The model stopped with finish_reason ...". pi-ai's retry classifier matches "provider finish_reason: error" since earendil-works/pi@a00a504, so PiHarness retries such a mid-stream vendor failure, as Pi 1.6.1 does with its own openai-completions API. * docs(agents): park Pi tools and read signals with Pi's tagged forms earendil-works/pi@32c71a6 tags tool parks ({ kind: "sleep", ... }, flat) and SignalState ({ kind: "value" } or { kind: "expired" }). Every result field is optional, so the old { sleep: { ... } } still type-checks and Pi takes it as an empty result: the harness's parked-tool tests failed that way. The test tools and the pi.md samples now use the tagged forms; a beforeTool gate keeps { sleep: { ... } }. * test(agents): use a Groq model pi-ai still lists in the chat-completions tests Pi main drops Groq models that models.dev marks deprecated, including llama-3.1-8b-instant, so the fixture lookup threw. openai/gpt-oss-20b is listed with the same compat in Pi 1.6.0 and on Pi main. * fix(agents): record OpenRouter's native finish reason as pi-ai does on the chat-completions wire Pi main's openai-completions records OpenRouter's native_finish_reason (the upstream provider's own reason) in rawStopReason, e.g. error.MALFORMED_FUNCTION_CALL, and appends it to error messages after pi-ai's "Provider finish_reason:" prefix, so retry matching is unchanged. Our wire assembles the message itself, so it now sets rawStopReason and uses pi-ai's own OpenRouter helpers for the native reason. Needs the Pi release that ships utils/openrouter-finish-reason. * fix(agents): report every response to onResponse, failures included, as pi-ai does earendil-works/pi@8a57d42 makes pi-ai's onResponse fire for HTTP error responses and each retried attempt. pi-ai's Anthropic implementation now reports a vendor's error response through the gateway too, but AI Gateway's own failures (a gateway envelope, or any non-2xx from /run) threw before onResponse on all three wires. sendGateway now awaits the callback before it throws, the chat-completions and Responses wires report through it, and the Anthropic wire reports a response the SDK never sees because sendGateway threw. * fix(agents): read a large streamed SSE event in linear time earendil-works/pi@da7e26c fixes pi-ai's SSE readers rescanning an incomplete event on every chunk. sseDataStream, which the pi-ai chat-completions and Responses wires and the AI SDK provider read streams with, had the same cost: it ran its line regex over the whole buffer on each chunk, so an 8 MB event in 512-byte chunks took about 6 s. It now scans only the new text and joins an incomplete line once, when it ends. * test(agents): send no disabled thinking to a catalog Claude that cannot turn it off earendil-works/pi@433c1fd marks "off" unsupported on Claude Opus 5.5 and Sonnet 5.5 in pi's Cloudflare AI Gateway catalog, which reject thinking: { type: "disabled" } with a 400. The Anthropic wire reads the catalog's thinkingLevelMap through pi-ai, so the fix reaches it unchanged; this pins that a streamSimple call without reasoning sends no disabled thinking to anthropic/claude-opus-5.5 and still disables it on Haiku 5.5. On Pi 1.6.0's catalog the Opus call sends disabled. * chore(changeset): name Pi 1.6.1 and link its changelog * test(agents): run a Pi wake's alarm once it is armed instead of racing it Backports the harness.test.ts part of #3098 (e44ff29) onto release/0.34. On agents 0.34.0 the restarted-root test read the alarm while the wake its startup pushed was still pending, and failed about 2 runs in 5. It now runs that wake's alarm itself and waits for the fallback alarm to clear. * Version Packages (#3204) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo's Workers tests now run on
@cloudflare/vitest-plugin1.9.1 instead of the deprecated@cloudflare/vitest-pool-workers0.19.1. The package is renamed in 8 package.json files, every Vitest config import, and every testtypesentry; the lockfile is regenerated. The pool now runs workerd 1.20261123.1, and three things change with it:platform-limits.test.tsnow asserts that the pool holds 8 MB@cloudflare/worker-bundlerpicks the Pyodide lockfile from the Worker's compatibility date and flags: 3.12 before 2025-09-29, 3.13 until 2026-09-07, 3.14 from 2026-09-08. The new workerd runs the Python the date picks, as production does, so the fixed 3.12 wheels no longer import. Awrangler.toml/wrangler.jsoncin a Python project is also no longer uploaded as a module.Why:
@cloudflare/vitest-pool-workersis deprecated on npm ("renamed to @cloudflare/vitest-plugin; this package will not receive future updates"), and its last release still ships a 2.2 MB-row workerdcloudflareTest()from the package root); the codemod@cloudflare/codemods vitest:pool-workers-to-vitest-plugindid the renameminimumReleaseAgeslim-limits-pyver, deleted), Python by compatibility date: 3.12.1 up to 2025-09-28, 3.13.2 from 2025-09-29, 3.14.2 from 2026-09-08;python_workers_20250116andpython_workers_314override the date. The docs state 3.14 from 2026-09-08. So the bundler's fixed 3.12 wheels were already broken in production for every date from 2025-09-29.Tests that changed result on the new pool:
worker-bundler"createWorker with pyproject.toml" (6 tests): native wheels failed to import. Fixed in the bundler, not the tests. A new test per Python range (2025-09-01 → 3.12, 2026-01-01 → 3.13, 2026-09-08 → 3.14) imports pyyaml's C extension and checkssys.version_info. A unit test checks the date boundaries and flags.harness-pi, four tests ("seeds the root after the object restarts…", "schedules the wake before a signal…", "holds the object while a tool waits…", "resumes a replay-safe tool after an eviction…"): they read or ran the alarm at a moment when the wake's alarm can be mid-dispatch, and the new pool fires alarms sooner. They now wait for the alarm to be armed (or for the wake to drain) with onealarmArmedhelper, and assert the same end state. Each passed every isolated run (3 to 5 runs), and the pi suite passes in full (115).platform-limits.test.ts: flipped, as above.Locally: one full
nx run-many -t test, and thenagents,ai-chatandthinkthree times each. Runs 1 and 3 were green. Run 2 had two failures: the pi wake test above (fixed after that run) and an opencode test that timed out under machine load and passes 5 of 5 alone. The three Think tests that fail locally on main (#2014 aged tool output, truncated workspace text reads, action ledger sweep) passed in all three runs.pnpm run test:reactpassed (182 tests). Thetest:e2esuites startwrangler devor Vite, not this plugin. With an account set, Think's e2e passed (35 tests). pi-recovery's and tanstack-recovery's SIGKILL tests fail the same way on main. agent-think needs Docker, and agents-as-tools timed out starting its Vite server.Stacked on #3079. Test tooling only, so exempt from the deployment probe. The worker-bundler fix was measured on a deployed Worker (
slim-limits-pyver, deleted).