Skip to content

fix(integrations): a patch held by Pidgeon's recipient cooldown is told to reply - #1139

Merged
allisonmahmood merged 2 commits into
mainfrom
fix/pidgeon-recipient-cooldown
Oct 31, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
fix/pidgeon-recipient-cooldown

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

Pidgeon holds back new messages from an address to someone it has just written to: 429 with error.code recipient_cooldown. Replies always go. A patch that answers a customer and then sends them a new message hits it, and Patchy read every 429 as the account's request rate. So the patch was told "Pidgeon is limiting this account for now… Try again in 573 seconds", and its agent would wait and retry instead of replying in the conversation.

Now the patch hears which limit it hit and what to do instead. Closes #1117 with #1138, which this is stacked on.

Look at

  • Source.classify: reads Pidgeon's code on a 429 into limit: "recipient_cooldown"; anything else stays "requests".

  • Operations.RateLimited: the cooldown's message says nothing was sent and to reply in that conversation, or send again after retryAfter. Every Pidgeon limit now carries Pidgeon's explanation in details.message; a cooldown's names the recipient. The daily budget is Patchy's and carries none.

    Before, from the live tier on main:

    source_rate_limited: Pidgeon is limiting this account for now, so nothing was done. Try again in 573 seconds.
    details: { limit: "requests" }
    

    After:

    source_rate_limited: This address wrote to a recipient of this message recently, and Pidgeon holds a new message to them for a while, so nothing was sent. Reply in that conversation, or send it again in 573 seconds.
    details: { limit: "recipient_cooldown", message: "This address wrote to [email protected] in the last 10 minutes. Reply in that conversation, or send a new message in 10 minutes." }
    
  • Where the rule is stated: the client's PidgeonDetails type, the generated context's messages.send line, and the patchy-pidgeon skill. The skill and context also say dev doesn't apply the cooldown, since dev simulates writes.

  • The count isn't fixed. The runs that failed today were refused after one earlier message, and Pidgeon's docs now say three new messages in 10 minutes. So the live case sends new messages to the customer until one is held, at most four. It then checks the refusal and sends the held draft's key as a reply in her conversation; a 429 isn't kept, so the key still sends. The case uses the customer, one of the run's own addresses: in test mode, mail to outside addresses goes nowhere and doesn't count toward the cooldown, which a first version of this case found.

How it was verified

  • Offline, red then green. The new Source.test.ts and Operations.test.ts cases fail against the old mapping (expected … 'limit' of 'recipient_cooldown', but got 'requests') and pass with it. All Pidgeon offline suites pass (37 tests).

  • Live: the operations live file passed against Pidgeon's test mode with the test admin key, the new cooldown case included:

    Pidgeon live run lvd71a4b: 129 calls, 3 keys minted, at most 2 active at once; swept 0 stale keys and 0 stale addresses before, 1 keys and 2 addresses after.
          Tests  10 passed (10)
    

    An earlier attempt at 17:33 UTC failed in two cases this PR doesn't touch: a Pidgeon write passed the 15-second deadline, and test mode's drop didn't drop. The rerun passed.

  • pnpm check: format, lint, typecheck and synth pass. Its offline tests failed locally only in the CLI suites that record stray GET / requests from this machine's port probes, and one Supervisor timeout under load; none touch Pidgeon. CI runs them clean.

Release impact

  • Breaking — requires action from anyone already running this

  • Not breaking — a new details.limit value and a details.message on an existing refusal; patches already handle source_rate_limited

  • What does a revert leave behind? Nothing stored. A cooldown would read as "requests" again, with the old message.

  • Does the release before it still work with that? Yes.


Made by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:cli Touches the cli area area:docs Touches the docs area area:integrations Company connections and integration implementations size:m 100-500 changed lines labels Oct 31, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Independent review (GPT 6.1 Sol, xhigh) on c5b4ff0: no P1 findings. All three findings are fixed in the latest commit:

  • P2: the API text didn't name the new limit. packages/api now lists budget, requests, plan and recipient_cooldown, says a reply in their conversation avoids the cooldown, and notes Pidgeon's explanation in details.message. docs/API.md is re-rendered.
  • P3: the generated context read as if every send to a recent recipient fails. It now says the send can fail once Pidgeon's cooldown is reached, and only then suggests the reply.
  • P3: the glossary had no entry for the cooldown. packages/integrations/GLOSSARY.md now has Recipient cooldown, set apart from Held send: a cooldown refusal keeps no draft.

API, Pidgeon and SDK offline suites (123 tests), typecheck, lint and format pass on the new head.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 17d362f112b79224155b46bc1b700ee9693592d7 (base fix/pidgeon-live-cooldown at 7aa991ebb9f8c093f15e58357600c78351894f3e, on main at 9e176cb5818fc283064be15c8b49e8e5ce0a137e), by Claude Opus 5.5 in Claude Code, running in T3 Code. I did not write this change.

This is a delta acceptance. The earlier verdict (PASS with notes, by GPT-6.1 Sol) checked e17f708, before the stack was rebased onto 9e176cb. This run confirms the rebase changed none of the PR's own content, checks that main's overlapping edits read coherently next to it, and re-runs the checks at the new head. The earlier verdict's behavioural findings carry over: the red-then-green offline cases, the cooldown refusal and its reply recovery, and the decoder probe for both refusal shapes.

The rebase

  • PR content unchanged: passed. git range-diff c69769b..e17f708 9e176cb..17d362f reports commits 1–3 =. Commit 4 is ! in a single place: the POST /api/runtime/call paragraph of docs/API.md, which main also edited. Its other hunks (api.ts, GLOSSARY.md, Generate.ts) differ at most in index hashes and line offsets. In that paragraph, the PR's word-level change is identical before and after the rebase. It replaces `details.limit`. with the budget/requests/plan/recipient_cooldown sentence. Main's word-level change to the paragraph (the guest text in members.get) is also identical in both.
  • Generated docs current: passed. At 17d362f, after pnpm install --frozen-lockfile, pnpm --filter @patchy/api render-docs rewrote docs/API.md and git status --short printed nothing.
  • The tree delta e17f708 → 17d362f equals main's c69769b → 9e176cb delta. Every file's patch-id matches except docs/API.md, whose difference is the single regenerated line above.

Main's overlapping changes

Main touched four files this stack also edits, all for guest blocking. Main changed none of the stack's code: pidgeon/Operations.ts, Source.ts, Generate.ts, packages/patchy/src/clientError.ts and the live tests are untouched since c69769b. At 17d362f the merged text reads coherently:

  • packages/api/src/api.ts: main added the guest routes in PatchesGroup and the guest sentences about members.get. The PR's sentence is in the Pidgeon part of the runtime description. They are separate sentences in separate places.
  • docs/API.md: the rendered runtime paragraph carries both, the guest: true member text and details.limit: budget, requests or plan, or recipient_cooldown ….
  • packages/integrations/GLOSSARY.md: main's Block guests entry sits among the connection terms. The PR's Recipient cooldown entry sits after Daily send budget. Neither refers to the other.
  • packages/sdk/skills/patchy-pidgeon/SKILL.md: main added a guest-blocking sentence to "Declare an address" step 1. The PR's lines are in "In patchy dev" and "Bounds and refusals". No contradiction.

Done means (carried from e17f708, re-run at this head)

  • Live sends and existing protections: passed. Pidgeon live at 17d362f: pidgeon-suite passed 20 tests in 3 files. That includes the send policy, held sends, replays and rejected@, and the Pidgeon sweep step passed. pidgeon-live passed.
  • Cooldown refusal and recovery: passed. Live case in the same run: "new messages to the customer the desk just answered are held for the address's cooldown, naming her, and the held draft goes as a reply in her conversation".
  • Error text and builder guidance: passed. The offline Operations and Source cases for recipient_cooldown (complete reply-or-wait error, details.message, retryAfter: 573) pass at this head. The PR's own skill, glossary, API text and generated-context changes are the same as at the earlier verdict.

Evidence

CI at 17d362f (Pidgeon live, run 41228782937):
PidgeonOperations.live.ts  10 passed
Pidgeon.live.ts             7 passed
PidgeonDev.live.ts          3 passed
Test Files  3 passed (3)
Tests      20 passed (20)
Sweep what this run left in Pidgeon: success

Local at 17d362f:
pnpm exec vitest run --config test/vitest.config.ts packages/integrations/src/pidgeon packages/api packages/sdk/src/SdkApi.test.ts
Test Files  14 passed (14)
Tests      123 passed (123)
pnpm typecheck: 24 successful, 24 total; exit 0
pnpm lint: exit 0
pnpm --filter @patchy/api render-docs; git status --short: (empty)

Every other check on this head passed, including CI (Node 22/24/26 tests, browser, tier2-smoke, clerk-live, cli-smoke, install on Linux, macOS and Windows, lint, release-tarball, rollback-rehearsal). attio-live was skipped because this PR has no Attio changes.

Golden journeys

  • Not touched: Sign in, Log a machine in, Publish a page, Share and unshare, Find and open a tool, Use a tool live, Use a tier 2 tool, Invite and join. Main's guest sharing journeys aren't affected either: the stack changes only Pidgeon's refusal mapping and its text. CI's browser and tier2-smoke jobs passed at this head.

Rollback answers: match the diff, as the earlier verdict found, and the diff hasn't changed. The new details.limit value and details.message enrich an existing source_rate_limited refusal. Nothing is stored and no migration is added. The rollback-rehearsal check passed at this head. No one-way label is needed.

Not run

  • A local live Pidgeon run, a key sweep or a revocation: CI ran the full live tier at this head, and this run was told not to use the shared account.
  • A local full verify, manual browser/portal journeys and local live Clerk: CI's broader suites passed at this head. Dev simulates Pidgeon writes, so it can't show the cooldown.

Notes

  • The earlier verdict's open item is closed: the full Pidgeon CI tier, queued at e17f708 then, passed there and passed again at 17d362f.

Base automatically changed from fix/pidgeon-live-cooldown to main October 31, 2026 19:25
allisonmahmood and others added 2 commits October 31, 2026 20:25
…ld to reply

Pidgeon holds back new messages from an address to someone it has just
written to (429 recipient_cooldown); replies always go. Patchy read
every 429 as the account's request rate, so a patch was told "Pidgeon
is limiting this account for now" and its agent would wait and retry
instead of replying in the conversation.

Source now reads Pidgeon's code into limit "recipient_cooldown", and the
operation's refusal says nothing was sent and to reply in that
conversation or send again after retryAfter. Pidgeon's own limits carry
its explanation in details.message, which names the recipient a
cooldown holds. The client's error types, the generated context and
the patchy-pidgeon skill state the rule, and the live tier checks it
against Pidgeon's test mode.

Refs #1117

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ient cooldown

The API reference now names the source_rate_limited limits, the
recipient cooldown among them, and Pidgeon's explanation in
details.message. The glossary gains Recipient cooldown, distinct from a
held send. The generated context says a send can be refused once the
cooldown is reached, not that it always is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/pidgeon-recipient-cooldown branch from 17d362f to 3bbdf43 Compare October 31, 2026 19:25
@allisonmahmood

Copy link
Copy Markdown
Owner Author

#1138 merged as 327c8b6. This PR now targets main, rebased with git rebase --onto origin/main 7aa991e. The new head 3bbdf43 has the same tree as the accepted and CI-tested head 17d362f (e729ded), so the acceptance verdict carries over. Merging once CI is green on 3bbdf43.

@allisonmahmood
allisonmahmood merged commit 3489c17 into main Oct 31, 2026
23 checks passed
@allisonmahmood
allisonmahmood deleted the fix/pidgeon-recipient-cooldown branch October 31, 2026 19:37
allisonmahmood added a commit that referenced this pull request Oct 31, 2026
## What changed

This adds release 32's What's new entry, written from `58d94b3`. It
covers everything merged since release 31's `through` (`5888411`). It
also sets the `patchy` release to `0.32.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| Fixed: a patch has the keyboard as soon as it opens, so its shortcuts
work, and Space and Page Down scroll it, without a click first | #1097 |
| Improved: agents give a patch pages of its own, each view at its own
address under the patch, with back and forward working; repos pick it up
at their next refresh | #1095 |
| Fixed: a patch that hits Pidgeon's hold on a new message is told
nothing was sent and to reply in the conversation, not to wait and retry
| #1139 |
| Behind the scenes: refresh and `patchy dev` keep working when a repo
holds a skill the instance's release doesn't ship, so a rollback can't
break them | #1099 |

#1138 is a live test tier change with nothing that ships. #1140 is
release 31's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- **Rollback safety, from the live commit `9e176cb` (release 31) to
`58d94b3`:** #1138, #1139, #1097, #1095 and #1099. None is labelled
`one-way`, and their Release impact answers agree:
  - #1097 changes only the shell's script.
  - #1095 changes only skill text.
- #1139 adds a `details.limit` value and a `details.message` on an
existing refusal.
- #1099 adds no skill, so a repo refreshed on this release holds only
skills release 31 also ships.
  - #1138 is tests only.
- **#1099 has to be live before #1092 (PR #1098, `patchy/hotkeys`)
ships.** That's why this release goes out alone. Once #1098 is live, a
rollback to release 32 or later keeps refresh and dev working for repos
that picked up the new `patchy-hotkeys` skill.

**Rollback line:** If this release misbehaves, roll back to `9e176cb`
(release 31).

## How it was verified

- **Tests.** `whatsNew.test.ts`, `schemas.test.ts` and
`WhatsNewPages.test.ts` pass (21 tests), and prettier passes on the
changed files.
- **The range.**
- #1097, #1095 and #1099 were each reviewed by GPT 6.1 Sol, with every
finding resolved. Each got a fresh acceptance PASS with notes after its
rebase onto Preact 11.
  - Each landed with all 12 required checks green on its final head.
  - #1138 and #1139 were merged from their own thread.
- **Deploy state.** The live commit, pinned from `/healthz/deep`, is
`9e176cb` (release 31). The Deploy run updated last succeeded, and none
is unfinished.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Text and version numbers only. The `0.32.0` bump tells CLIs and patch
repos installed before this deploy to upgrade, as every release does.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3
Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area area:docs Touches the docs area area:integrations Company connections and integration implementations area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(integrations): Pidgeon refuses a new message to someone written to in the last 10 minutes

1 participant