Skip to content

test(think): completes #3447: the recovery-work wait is per callback and also wakes on Tasks' events - #3471

Merged
mattzcarey merged 1 commit into
mainfrom
slim/turn-task-fixture-tighten
Nov 27, 2026
Merged

mattzcarey merged 1 commit into
mainfrom
slim/turn-task-fixture-tighten

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Completes #3447. Test only: two tightenings of the fixture that #3447 carried for Think's recovery tests (recoveryAttemptOwedForTest in tests/agents/think-session.ts), both found in review of that PR.

  • Per callback. The wait said "there is work" when only the other callback's attempt was queued. runRecoveryWorkForTest(agent, callback) then found nothing to run for its own callback and waited until the test timed out. It now says so only when its own callback has work, and returns at once when only the other has.
  • Wakes on Tasks' events too. The "scheduled" recovery event is published just before the attempt's run is written or put to sleep, and that write publishes no recovery event. In that window the fixture waited through the real backoff. It now also wakes on the agent's agents:task events (a run accepted, a run waiting).

Neither could make a test pass wrongly: the first failed by timeout, the second cost a few seconds.

Checked: Think's "error handling" tests (68) and channel-recovery, origin-message-ids, action-pause-recovery, run-turn-recovery and submissions (160) pass on the class config.


Devin Review

@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@3471

@cloudflare/ai-chat

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

@cloudflare/codemode

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

hono-agents

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

@cloudflare/shell

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

@cloudflare/think

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

@cloudflare/voice

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

@cloudflare/worker-bundler

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

commit: 1118589

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

@agent-think

agent-think Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (d5a44252 → 1118589e, workflow run)

@mattzcarey
mattzcarey merged commit 5153f30 into main Nov 27, 2026
20 checks passed
@mattzcarey
mattzcarey deleted the slim/turn-task-fixture-tighten branch November 27, 2026 12:12
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