Skip to content

test(think): prompt-cache media successors with passes that run on their own (harness score J, 3) - #3434

Merged
mattzcarey merged 4 commits into
mainfrom
slim/harness-score-J-3
Nov 27, 2026
Merged

mattzcarey merged 4 commits into
mainfrom
slim/harness-score-J-3

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Harness score, group J, step 3. prompt-cache's two media tests run each eviction pass by hand through Think's private _evictAgedMediaBestEffort seam, so they become class-only. Each gets a successor through public behaviour on both configs.

  • Fixture: measurePromptCacheForTest takes evictOnItsOwn. With it, a pass runs on its own, as an app's does, and after each turn the fixture waits until no think-media-eviction:pass job is queued (bounded at 5 s; a pass that leaves a backlog queues the next one first). It doesn't call the seam.

  • Successors:

    • "rewrites the prefix once when media is evicted by passes that run on their own": exactly one prefix break, and the last request is under 10,000 chars.
    • "evicts media sent every turn once per truncation step, by passes that run on their own": breaks at [10, 14], the same bounds on the last request.

    Both assert what their old tests assert, and both fail if no pass runs, because the request keeps the image.

Score: prompt-cache on vitest.harness.config.ts goes from 4 of 10 to 6 of 12 passing, and the 2 old tests leave the denominator as class-only. The class suite is 12 of 12. Stacked on #3416 so the class-only list is edited in one order.

The other 4 prompt-cache failures are older-message truncation on the harness-backed Think. That's an open question with harness about where it goes (report-harness.md).


Included: #3416 test(think): two more mechanics-only rows (harness score K, J)

Two more mechanics-only rows (#3414's category, merged). Stacked on #3412, so the list is edited in one order. Each test asserts nothing an app can observe, so each is class-only with no successor. The reviewer confirms that in the verdict.

  • periphery-modules, "ThinkConfigStore > skips a write whose value matches the last value it saw": ThinkConfigStore doesn't write a value equal to the last one it saw. That's a skipped SQL write, reached through Think's private _cfConfig. Its module-level test is on a minimal Durable Object (test(think): ThinkConfigStore's tests on a minimal Durable Object, as successors #3392).
  • media-eviction, "a second pass is a cheap no-op": a second pass over unchanged rows reads and writes nothing. That's the pass's own bookkeeping, through the private _evictAgedMediaBestEffort seam.

Score: 38 class-only rows on this branch, 8 of them mechanics-only: 36 on main and these 2. Both rows fail on the harness, so only the class-only count moves, and readClassOnly reads the list with no problems.

"Keeps a request that lands while a pass is running" is not in this list (rv-6). It asserts that a message aged during a running pass still gets evicted, which an app can see. A successor would need a pass held open, which is the private seam, so the test stays counted as failing.

@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4409f19

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@3434

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@3434

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@3434

hono-agents

npm i https://pkg.pr.new/hono-agents@3434

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@3434

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@3434

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@3434

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@3434

commit: 4409f19

@agent-think

agent-think Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (03982fa4 → 4409f19a, workflow run)

@mattzcarey
mattzcarey marked this pull request as ready for review November 27, 2026 08:57
devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey
mattzcarey force-pushed the slim/harness-score-J-3 branch from fef743c to 4fb4ab3 Compare November 27, 2026 09:00
devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey
mattzcarey force-pushed the slim/harness-mechanics-only-rows branch from 18f682e to 9ab60bf Compare November 27, 2026 09:11
@mattzcarey
mattzcarey force-pushed the slim/harness-score-J-3 branch from 4fb4ab3 to a4ea3ba Compare November 27, 2026 09:11
@mattzcarey
mattzcarey force-pushed the slim/harness-mechanics-only-rows branch from 9ab60bf to 61e95b6 Compare November 27, 2026 09:21
@mattzcarey
mattzcarey force-pushed the slim/harness-score-J-3 branch from a4ea3ba to d538e94 Compare November 27, 2026 09:21
@mattzcarey
mattzcarey force-pushed the slim/harness-mechanics-only-rows branch from 61e95b6 to ec46b52 Compare November 27, 2026 10:53
@mattzcarey
mattzcarey force-pushed the slim/harness-score-J-3 branch from d538e94 to 01fb30a Compare November 27, 2026 10:53
@mattzcarey
mattzcarey force-pushed the slim/harness-mechanics-only-rows branch from ec46b52 to 254fd3c Compare November 27, 2026 11:14
@mattzcarey
mattzcarey force-pushed the slim/harness-score-J-3 branch from ad60d87 to 11084d1 Compare November 27, 2026 11:14
@mattzcarey
mattzcarey changed the base branch from slim/harness-mechanics-only-rows to main November 27, 2026 11:22
devin-ai-integration[bot]

This comment was marked as resolved.

…-eviction, so a rename can't make them return early
@mattzcarey
mattzcarey marked this pull request as draft November 27, 2026 11:37
@mattzcarey
mattzcarey marked this pull request as ready for review November 27, 2026 11:37
@mattzcarey
mattzcarey merged commit ff25001 into main Nov 27, 2026
18 checks passed
@mattzcarey
mattzcarey deleted the slim/harness-score-J-3 branch November 27, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant