Skip to content

feat(integrations): Pidgeon runs on its new API - #1458

Merged
allisonmahmood merged 10 commits into
mainfrom
feat/pidgeon-new-api
Nov 18, 2026
Merged

allisonmahmood merged 10 commits into
mainfrom
feat/pidgeon-new-api

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

What changed

Pidgeon moved to a new platform and stops answering the API Patchy calls on 22 November 2026; connecting an address already fails, because calls it needs are gone. Patchy's Pidgeon integration now runs on Pidgeon's new API. An admin pastes a key from Pidgeon's dashboard, types the address of one inbox, chooses what patches may do, and patches list, read, label, triage and answer its mail as before.

The new API changed two things underneath us:

  • A dashboard key reaches the whole Pidgeon account, and Pidgeon makes no key for one inbox. So Patchy keeps the boundary itself: nothing is returned or changed unless Patchy has shown it belongs to the connection's inbox, and anything it can't show answers not_found, exactly as an unknown id does.
  • Pidgeon no longer dedupes sends (probed: the same Idempotency-Key three times sent three emails). So Patchy keeps a ledger: each draft key's email is written as a Pidgeon draft, recorded, and sent at most once. When Pidgeon hasn't said whether an email left, the answer says so instead of sending again.

Minting and revoking keys, creating addresses, domains and send policies are gone with the old API.

Closes #1457

Look at

1. The inbox boundary

packages/integrations/src/pidgeon/Operations.ts: lists and search always name the inbox and refuse a whole answer carrying another inbox's row (ours); a thread or message by id is shown only when it says it's the inbox's (ownThread, ownMessage); a held message by id, whose 403 held names no inbox, answers not_found; triage reads the thread first and checks a label against the inbox's own list (ownLabel); replies and sends are drafts in the connection's inbox only.

Operations.test.ts › answers not_found for everything of another inbox, as for an unknown id, changing nothing: one key, two inboxes in the scripted double. The other inbox's thread, message, held message (read and as a reply target), label (on a thread, off a thread, as a list filter) each answer the exact failure an unknown id gets, and afterwards nothing changed there and nothing was drafted or sent. With the inbox check taken out of ownMessage the test goes red:

× answers not_found for everything of another inbox, as for an unknown id, changing nothing
Tests  1 failed | 1 passed | 23 skipped (25)

The same test covers another inbox's label taken off the connection's own thread, which passes the thread check and is refused by the label's. Beside it, refuses a conversation carrying another one's message, and an answer about another id: a thread read whose embedded message belongs to another conversation of the inbox fails whole, and a thread or message answered under a different id than asked is not_found. The runtime journey (Runtime.test.ts) holds two inboxes under one key, one connection on each. The live tier does the same against Pidgeon with two inboxes the run makes (reads the desk's mail, and nothing of the other inbox).

2. Sending once

pidgeon/Ledger.ts (one row per hash of connection, patch and draft key, with a claim) and sendOnce in Operations.ts, by the state an attempt finds:

Found What the attempt does
no row inserts writing and charges the day's budget, in one transaction; budget spent inserts nothing. A claim whose acknowledgement was lost is read back, and carried on only when the row holds this attempt's token and email
writing reads a reply's target, writes the draft in the inbox, records drafted; a draft answered in another inbox is never touched, not even to delete it
drafted records sending, then issues the draft's one send: 201 → sent, 202 → held; a refusal Patchy read in Pidgeon's words (its error envelope: a 429 in any other shape, or a 422, which Pidgeon doesn't document, isn't one) → refused and the draft is deleted; a 401 → refused, that draft never sent again; anything else → stays sending, answers unconfirmed
sending / held never sends: looks at the draft (still held?) or the message by the draft's id (sent from this inbox?); otherwise unconfirmed
refused taken over, and the old draft deleted: a corrected email is charged again, the same email retried is not; after a 401 and Replace key, this writes a new draft and sends that
sent answers it, replayed: true

Every change after the claim is conditional on the claim's owner token, so a worker that lost its claim changes nothing. Offline tests cover a second worker arriving, a worker stopping after sending, lost answers to the write and to the send, lost acknowledgements of the claim and of each change, a stale worker's write and release after takeover, each documented status of the write and of the send and the undocumented ones above, recovery by a draft's id refusing a message that's incoming, not sent or another inbox's, a member approving and rejecting a held email, a key refused at the send then Replace key and Pause/Resume (two drafts, one send each, one email), expiry by state (sending and held never; sent from when it resolved, one approved late included; the rest from when they were made), a replay on a spent budget and the corrected email after a refusal. Each new check was taken out in turn and its test went red. Live: sent once though asked twice; a send carrying another conversation's text refused and its key freed.

3. Connecting

The connect page works like Attio's and the mailbox's: what to make in Pidgeon, three fields, Key, Inbox and Patches may (Read, or Read and send), then Name it, Once connected and one Test and connect. There is no Find inboxes step, no page script and no list of the account's inboxes. Every sentence is in one copy object in pidgeon/Page.ts.

Test and connect checks in this order, changing nothing in Pidgeon, and shows each refusal under the field it's about, as the mailbox page shows a bad login:

  • a key that isn't shaped like a Pidgeon key, or that Pidgeon rejects, under Key;
  • an address that no inbox the key reaches has (compared trimmed and ignoring case), or an events inbox, under Inbox. The refusal names none of the account's other inboxes;
  • Read and send with a key that can only read, under Patches may, saying to make a Send key or choose Read.

Nothing is saved unless every check passes, and the key is never written back: a refused submit asks for it again. Replace key asks for the new key only and checks it reaches the same inbox and can do the connection's access (a Read key for a sending connection is refused under Key). Change access is the same Patches may select, a local change that re-checks the stored key when it raises access to send. The page no longer tells an Admin key apart: keeping that hint would have meant storing the key's level and an extra call at each check, for a line the Get it step already covers.

Captured on a local instance in Pidgeon's test mode, as the scenario's admin, with scenario data only. The page lists no inboxes, so nothing of the account's other inbox can appear.

Empty Wrong address, under Inbox
The connect page, empty A wrong address refused under Inbox
A Read key with Read and send, under Patches may Filled in with the Send key, ready (the address in capitals still matches)
A Read key refused for Read and send The form filled in, ready to connect
Connected Replace key with a Read key, under Key Change access
The connection page Replace key refusing a Read key Change access

4. The scenario's patch, on the new contract

The Support desk lists the scenario's mail (the three-message conversation includes a customer follow-up, threaded by the first message's RFC Message-ID), and one reply sent through it shows once, and still once after a reload.

Inbox One reply, shown once
Support desk listing mail The conversation after one reply

5. What changed for patches

Builders' patches written for the old contract break where the new API forced a change. None exist in production. Every change, in packages/api/src/pidgeon.ts and mirrored in the handwritten client, generation and the patchy-pidgeon skill:

  • threads.list: takes folder (inbox, archive, spam, trash) and labelId. A thread drops from, preview and hasAttachments, and gains folder, labels and unreadCount. Its subject is null while every message in it is held.
  • threads.get: same shape, from one call; a held message appears with held: true and no content.
  • messages.get: delivery is gone; to and cc names are always null; a held message answers not_found (was access_denied with reason held).
  • messages.search: text is required, 1 to 200 characters (words, "phrases", or, -word), newest first; the from, to, labelId, hasAttachment and folder filters are gone; preview is the first 200 characters of the clean text.
  • attachments.text: removed. Messages still list attachments' names, types and sizes.
  • messages.reply / messages.send: same input. Output is { status: "sent" | "held", messageId, threadId, replayed }; rejected, test and the pending_approval shape are gone. A reply goes to a received message's sender, or to the recipients of one the inbox sent. A sent key is remembered for a day after it went (was Pidgeon's 24 hours from the first send).
  • Refusals: idempotency_conflict gains reason unconfirmed; access_denied reasons not_permitted, blocked and held are gone (exfiltration_blocked stays, now in Patchy's words); source_rate_limited loses recipient_cooldown; source_unavailable gains details.reason send_failed, unavailable or storage_full when Pidgeon said the mail couldn't go. No new codes.
  • Budget: pidgeon.sends.daily counts emails, once per draft key, not attempts. An email Pidgeon refused and that is retried as it was, as after Replace key, keeps its one charge; a corrected email under the same key is a new one.
  • Snapshot and generated context: version 2; address.sendPolicy and plan are gone, and with them the context's Send policy and Plan lines. The generated client drops the AttachmentText and Delivery types and adds Folder.

How it was verified

  • pnpm verify on this head: every step passed, All passed.: format, lint, typecheck, synth, test (336 files, 3723 tests), test (bun), postgres-concurrency, cli-smoke, install, tier2-smoke, browser (189) and browser-firefox (186).
  • Live tier against Pidgeon's new API, pnpm test:pidgeon with the account's test admin, Send and Read keys, and one PIDGEON_TEST_RUN_ID for all three files, as CI sets it:
    Pidgeon live run …: 52 calls; swept 0 stale inboxes before, 2 inboxes after.
    Pidgeon live run …: 70 calls; swept 0 stale inboxes before, 1 inboxes after.
    Pidgeon live run …: 38 calls; swept 0 stale inboxes before, 2 inboxes after.
    Pidgeon live run …: 17 calls; swept 0 stale inboxes before, 1 inboxes after.
     Test Files  3 passed (3)
          Tests  13 passed (13)
    
    It connects by address (typed in capitals with spaces around it), and refuses a key Pidgeon doesn't know, an address no inbox has, an events inbox and Read and send with a Read key, with no POST, PATCH or DELETE sent but the level check. The page test refuses a wrong address under Inbox without the key or another inbox in the page, then connects. The test account held only its one original inbox before the run and after it.
  • On a local instance: pnpm dev up pidgeon made a test inbox with the admin key, delivered 10 messages in 6 conversations, then connected pidgeon/support through the new page with the Send test key at Read and send, and built and published the Support desk. By hand, as the admin: a wrong address was refused under Inbox, a Read key with Read and send under Patches may, the right address typed in capitals connected pidgeon/desk, and Replace key with a Read key was refused under Key. pnpm dev down deleted the inbox.
  • A probe of the real API settled the plan's open questions: a customer follow-up threads when /email/test/inbound names the first message's rfc_message_id from the event log (not its message id); test inbound takes html, and hidden instructions in it are held; sending a draft that doesn't exist answers 403 below send and 404 from it up, which is how Patchy tells a Read key without changing anything.

Not verified:

  • Live-mode sending: every key here is a test key. Whether Pidgeon can hand one draft's send off more than once (three 201s for eight simultaneous sends in test mode) is still with Pidgeon; Patchy issues one send per draft whatever the answer.
  • A held send against Pidgeon: a test key is never held for reputation, so 202 held and approval are covered offline only.
  • CI's live run: the repository has only the admin key as a secret, so in CI the checks that need a Send or Read key skip. Adding PIDGEON_TEST_SEND_KEY and PIDGEON_TEST_READ_KEY as secrets turns them on; the workflow already passes them.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

The patch-facing Pidgeon contract changed (above), the stored credentials and display changed shape, and the snapshot is version 2. Migration 0044 removes the Pidgeon connections made by earlier releases, with what hangs off them, and every stored Pidgeon snapshot: they could not have worked on the new API, and left in place they made their company's whole connection list fail to read. An admin connects such an inbox again with a key from Pidgeon's dashboard. Production holds no Pidgeon connection and no patch version that declares Pidgeon, so nothing running breaks.

  • What does a revert leave behind? The pidgeon_drafts table (additive, migration 0044), the removal of Pidgeon connections and snapshots made by earlier releases (a revert doesn't bring them back), and any Pidgeon connection made on this release, whose credentials, display and snapshot are in the new shape.
  • Does the release before it still work with that? Yes, until someone connects Pidgeon on this release. After that, the release before can't decode that company's Pidgeon connection, and its own Pidgeon calls go to an API that no longer exists anyway: fix forward. Labelled one-way for that reason.

Hit every surface

  • The wire contract: yes. packages/api/src/pidgeon.ts and pidgeonSnapshot.ts → the server's operations, the shell broker (it validates with the same schemas), patchy list connections text and --json (the snapshot's fields), and docs/API.md, regenerated.
  • The CLI: no command, flag or exit code changed; packages/patchy/README.md and the global patchy skill updated where they described Pidgeon, with its hash in skills-lock.json. The patchy-pidgeon, patchy-loop and SDK capability text follow the new contract.
  • The dev loop: yes. scripts/dev makes the scenario's inbox with the admin key and delivers its mail, then connects it through the page with the Send key, filling in the key, the inbox's address and Read and send in one submit. The environment's record says whether an inbox's mail all arrived: a resumed up delivers nothing to one that finished, and replaces one that didn't with a new inbox filled from the start. One exception: an environment that an earlier build of this branch connected before its mail had all arrived keeps that inbox, says so, and is started over with pnpm dev reset. down deletes only the inboxes it recorded; docs/DEVELOPMENT.md, scenarios/README.md and the patchy-dev-loop skill follow. The seed and the vitest template are untouched.
  • Vocabulary and product shape: yes. packages/integrations/GLOSSARY.md (inbox, Pidgeon key, inbox boundary, send ledger; address key, admin key, send policy and recipient cooldown gone), GLOSSARY-MAP.md, the portal glossary, docs/product.md (Connect now describes the one submit and its refusals), the pidgeon.addresses.listed limit's wording (now the inboxes Patchy looks through for the address typed; docs/limits.md regenerated), docs/OPERATIONS.md and ADR-0013. What a tier reaches didn't change; the global skill's Building a tool section only rewords Pidgeon.
  • Migrations: yes, 0044_pidgeon_drafts in the integrations capability, the next id in landing order. It also deletes what the old integration left, with an upgrade test in apps/server/src/migrations.test.ts.
  • Company resources: no.
  • Served pages: yes, the connect page, built from the shared frame's own field kinds and core helpers only, per ui-consistency; the frame's script slot, which only Pidgeon used, is gone (GitHub still uses after, choose, ready and outside). Find inboxes' route and the page script's route are gone, and with them their entry in apps/server/src/Moved.ts. No bundle-check change.
  • Reverse states: connect ↔ delete (delete says to revoke the key in Pidgeon, which Patchy can't, and names emails still waiting on a member's approval); pause ↔ resume; access read ↔ send (raising checks the stored key can send). Ledger rows leave by expiry or with their connection.
  • The repo layout: no package added or removed.

Built with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Pidgeon retires the API Patchy called on 22 November 2026, and connecting
already fails there. Move the integration to Pidgeon's /v1 API:

- Connect takes a key made in Pidgeon's dashboard, lists the inboxes it
  reaches and keeps it with the one picked. Such a key reaches the whole
  account, so every operation keeps the inbox boundary itself: anything
  Patchy can't show is the inbox's answers not_found.
- Pidgeon no longer dedupes sends, so a ledger of draft keys writes each
  email as a draft and sends it at most once, answering `unconfirmed`
  when Pidgeon hasn't said whether it left.
- Minting, revoking and retiring keys, addresses, domains and send
  policies go; the patch-facing contract follows the new API.

Closes #1457

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood allisonmahmood added area:integrations Company connections and integration implementations one-way Rolling production back past this PR would break the release before it labels Nov 15, 2026
@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes labels Nov 15, 2026
allisonmahmood and others added 7 commits November 16, 2026 00:42
…an inbox

Connect's check of an Admin key asked Pidgeon to make an inbox with an
empty name. It now deletes an inbox by an id Pidgeon never issues: 403
below Admin, 404 for Admin. Any other answer leaves the key not shown to
be Admin, which only words the page's status line, so connect never fails
over it. Both level checks name the same id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A draft Patchy hasn't shown is the connection's inbox's is never
  deleted.
- A 429 is Pidgeon's word only in its error envelope, and a 422, which
  Pidgeon doesn't document, is unavailable: a send answered either way
  stays `sending` and is looked at, never sent again.
- A 401 on a draft's send records `refused`: that draft is never sent
  again, and after Replace key the next attempt writes a new draft,
  sends it once, and deletes the old one on takeover.
- A claim whose acknowledgement was lost is read back, and carried on
  only when the row holds the attempt's own token and email.

Tests for each, and for recovery by a draft's id, another inbox's label
off the connection's thread, a conversation carrying another one's
message, a stale owner's release, expiry by state, and the runtime
journey over two inboxes under one key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tion left

A Pidgeon connection stored by an earlier release keeps the old display
and credentials, which made its company's whole connection list fail to
decode, and Replace and Delete with it. Migration 0044 now deletes every
Pidgeon connection, with its day counts and team grants, and every
Pidgeon snapshot: neither can be read by this release or work on the new
API. An upgrade test shows the company's connections read again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and leftovers fail the run

CI gives every live file one run tag, and Pidgeon never gives a deleted
address out again, so the second file to ask for `desk` was refused.
Each file's inboxes now carry the file's name (`connect-desk`,
`ops-desk`, `dev-desk`), still fixed so a lost answer is found by name,
and a failed make says which refusal it got.

A sweep no longer hides a failed deletion: it deletes the rest, counts
the failures, and the file's cleanup and the CI sweep fail when any of
the run's own inboxes is left, saying how many. The three files share
one cleanup layer. The live check that listing and checking a key change
nothing now counts every POST, PATCH and DELETE but the two level checks.

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

A subject found in the inbox didn't show a whole conversation arrived,
and a held-only conversation has no subject to find. The environment's
record now says, per inbox, whether its mail all arrived. `up` makes and
fills an inbox before connecting it (so its snapshot holds the
scenario's labels): one recorded finished is used as it is with nothing
delivered, and one that didn't finish is deleted and replaced by a new
inbox, at a new address, filled from the start. Records from before name
inboxes alone, and `down` still takes those down.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ual revocation

Product, glossary, scenarios, the UI gallery and the dev runner still
said Patchy mints a key for one address, revokes it on delete, shows a
leftover key needing attention, tells an Admin key by making an inbox,
and that a resumed `up` skips conversations by subject. They now
describe a key from Pidgeon's dashboard that the admin revokes in
Pidgeon, the level check by delete, the seeding record, and the live
tier's per-file inbox names and leftover rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the area:core Touches the core area label Nov 16, 2026
allisonmahmood and others added 2 commits November 16, 2026 02:08
The connect page is the shared frame's one submit, as Attio's and the
mailbox's are: the key, the inbox's address and what patches may do, each
refusal under its own field. Find inboxes, its route, the page's script and
the frame's script slot are gone; Replace key and Change access draw the
same fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed once

After a key Pidgeon rejected mid-send, the same email retried under its draft key
took a second unit of the day's send budget, so the day's last email could be
refused though nothing had left. A refused row taken over with the same digest
keeps its one charge; a corrected email is still a new one.

The live sweep now fails on any deletion it meant and couldn't make, an earlier
run's stale inbox included. The connect frame's description and two comments no
longer describe Pidgeon's removed Find inboxes flow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review notes

Two rounds of review by GPT 6.1 Sol (xhigh), the first on 083ec99, the second on 17c07a5. Every finding and what became of it:

Round one

Finding Outcome
A draft answered in another inbox was deleted before being refused Fixed: a draft not shown to be the connection's is never deleted (2b0ccf13)
An undecodable 429, or a 422, on a draft's send freed its draft key Fixed: only a refusal read in Pidgeon's error envelope frees a key; these stay sending and answer unconfirmed (2b0ccf13)
A 401 on a send put the row back to drafted, so the same draft was sent again after Replace key Fixed: recorded refused; the retry writes a new draft, one send per draft ever (2b0ccf13)
A lost acknowledgement of the first claim left a live claim nobody held Fixed: the row is read back and carried on when it holds this attempt's token and email (2b0ccf13)
Missing boundary and expiry tests Added; each fails with its check removed (2b0ccf13)
Telling an Admin key by asking Pidgeon to make an inbox with an empty name Removed with the rest of the key-level hint when the connect page moved to the shared frame (17c07a5)
Rows stored by earlier releases broke a company's connection list Fixed: migration 0044 removes Pidgeon connections and snapshots earlier releases left (f33f2165)
Two live files made an inbox named desk under CI's shared run tag Fixed: names carry their file (1d36a636)
The live sweep hid failed deletions Fixed (1d36a636, completed in 1d213d0)
The dev scenario couldn't resume a half-finished seed Fixed: the environment's record says whether seeding finished (e1854b86)
Docs still described minted keys and the admin-key flow Fixed (b0317b28, 1d213d0)
fetch retries once on a 421 Not changed. 421 Misdirected Request means the server did not handle the request, and RFC 9110 allows retrying it whatever the method. Round two agreed

Round two: no blocker.

Finding Outcome
After a 401 and Replace key, the same email retried took a second unit of the day's send budget Fixed: a refused row taken over with the same digest keeps its one charge (1d213d0)
The sweep passed when an earlier run's stale inbox couldn't be deleted Fixed: any deletion the sweep meant and couldn't make fails it (1d213d0). The stale sweep at the start of a live file still doesn't fail that file: CI's sweep step does, and another run's leftover shouldn't stop this run's tests
An environment an earlier build of this branch connected with its mail half-arrived isn't rebuilt Kept: it says so and points at pnpm dev reset. The description now states the exception
The connect frame's description and two comments still named Pidgeon's removed Find inboxes flow Fixed (1d213d0)

Known and unchanged: a 401 is read as a rejected key whatever its body, which is right for a request that didn't authenticate at any layer; and a lost acknowledgement while taking over a refused row can leave that row's old draft at Pidgeon, unsent and never sent by Patchy.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

On the acceptance verdict above (FAIL on 1d213d0): its one failed line is #1457's Done means about connections made before the move. That line was written before production was checked. Production holds no Pidgeon connection, and the owner decided on that basis that the move is a clean cut, so the line asked for a page nobody would see. #1457 now says what this PR does (the migration removes what earlier releases left; Release impact says so), with the reason in a comment there. Everything else in the verdict passed. A new acceptance run on the same head follows, against the corrected line.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 1d213d00db386825c9aa55746e6aa9a15109ebb4 (base 1414f9f494d49a3f68a09935a6389144198eb406) on fresh pidgeon data and a disposable upgrade database, by GPT-6.1 Sol in the Codex harness through T3 Code. I did not write this PR. The head is unchanged from the first acceptance run.

Done means

  • Connect on the new API; list, read, label, triage and answer mail: passed. Fresh pnpm dev up pidgeon delivered 10 scenario messages in six conversations, connected through the page and published Support desk. I independently submitted a Read test key with Read and send: 422 beneath Patches may, with the key cleared. Submitting the Send test key with the same scenario inbox's address padded and capitalised connected successfully. The published desk sent one reply: the conversation went from three messages to four, with exactly one copy of the reply, still four and one after a full reload. Its ledger contained one sent draft. For label/status persistence, held-content protection and exact-request replay, I rely on the first run's recorded passes on this exact head.
  • Clean cut for connections made before the move, with deletion disclosed in Release impact and reconnection using a dashboard key: passed against the revised requirement. I built a separate database using the actual migration records extracted from origin/main (1–43), populated it with the previous release's Pidgeon display/credential format, version-1 current and orphan snapshots, a send count and team grant, and a Postgres control. Applying this head's migrations removed the Pidgeon connection, both Pidgeon snapshots, the count and grant. Postgres and its snapshot stayed intact; snapshot immutability was restored. The connections page returned 200, listing Postgres without Pidgeon; Postgres detail also returned 200. The old Pidgeon address returned 404, “This connection could not be found. connection_not_found”, with “All integrations” and no explanation of the move or reconnect instruction.
  • pidgeon-suite and pidgeon-live pass again: passed in CI. I read the suite log: three files, 13 tests passed, followed by successful cleanup. I did not rerun the live tier. For its checks requiring all three keys, I also rely on the first acceptance run's recorded 13/13 live pass with Admin, Send and Read keys present.

Assessment of the changed requirement

I read both the issue explanation and the PR explanation. The revised line is a fair statement of the owner's recorded decision: the reported empty production Pidgeon inventory supports choosing a clean cut, and the line explicitly acknowledges deletion and reconnection in other environments. This changes the acceptance requirement; it does not fix or conceal the earlier run's 404 finding. I reproduced that finding and no longer count it as a failure under the revised line. I have not independently verified the production inventory, because this run was expressly forbidden from touching production.

Golden journeys and other risks

  • Publish/open/use a tier 2 tool and connect/disconnect Pidgeon: passed freshly, including the reply/reload above. The additional test connection reused the scenario's one inbox and was disconnected afterwards.
  • Account-wide key's inbox boundary, management/access changes, permissions, simulated dev writes and the shared connect frame: passed by reliance on the first run's results on this identical head. That run recorded real foreign-inbox refusals with no changes there, Replace key, Read ↔ Read and send, Pause/Resume, Delete, member refusal, real dev reads with simulated writes, and unchanged rendered pages for the other providers. I am not claiming to have rerun those checks here.
  • Focused offline coverage: likewise relying on the first run's 105 tests in ten files, plus the current green CI checks, rather than repeating those suites.

Rollback answers: Match the diff and the fresh rehearsal. Migration 44 leaves the additive draft table and irreversibly removes old Pidgeon connections/snapshots; reverting does not recover them. I independently applied the previous release's schemas to a new connection's stored credentials, display and snapshot: all three reject the new shapes. Thus a new Pidgeon connection makes rollback unsafe for that company's connection list; fix forward as disclosed. The one-way label is present. I read the green rollback-rehearsal log: base → PR merge result → base → PR merge result passed. That generic seeded journey does not prove compatibility with a newly connected Pidgeon inbox.

Not run

  • Production requests/inventory, production databases, AWS, live-mode mail or real Clerk sign-in: outside this run; none touched.
  • A new live-tier or full pnpm verify run: intentionally reused this head's CI and the first acceptance run's recorded results. CI's Send/Read key settings were empty; the prior all-key run and fresh browser checks supply that evidence.
  • Real outbound hold/approval: test keys do not reproduce reputation holds; relying on the previously passed offline coverage.

Notes

  • The generic 404 is intentional under the revised requirement. Administrators of older non-production environments get the recovery instruction from the issue/Release impact, not the vanished connection's page.
  • The shared preview controller reported successful clicks without changing the patch. Local Chromium through Playwright then exercised the real page successfully. One harness wait also expected the wrong success-query spelling; the connection had succeeded, and the resumed checks verified it. Neither is counted as a product failure.
  • Cleanup checked: this run made exactly one Pidgeon test inbox and deleted it. The final account inventory exactly matched the initial inventory: only the account's one original inbox remained. Its contents were never read or changed. The extra Patchy connection was disconnected, browsers closed, and the local environment, upgrade database and servers removed; every recorded process was gone. PR code, branch, body and labels were left unchanged. Nothing was merged.
Fresh scenario evidence

Read key refused beneath Patches may; the key field is empty:

Read key refused beneath Patches may

One new reply after reload; the conversation has four messages:

One reply after a full reload

@allisonmahmood
allisonmahmood merged commit e31eaab into main Nov 18, 2026
32 checks passed
@allisonmahmood
allisonmahmood deleted the feat/pidgeon-new-api branch November 18, 2026 11:35
allisonmahmood added a commit that referenced this pull request Nov 18, 2026
## What changed

This adds release 45's What's new entry, written from `e31eaab`. It
covers everything merged since release 44's `through` (`b653816`), and
sets the `patchy` release to `0.45.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| Improved: Pidgeon works on its new platform | #1458 |
| Behind the scenes: Pidgeon connections made before this release are
removed | #1458 |
| Patch changes: Pidgeon's contract follows Pidgeon's new API | #1458 |

#1456 is release 44's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- **Why it ships now:** Pidgeon's old API stops on 22 November. Until
this deploys, production's Pidgeon integration calls that old API.
- **Patch changes:** the contract changes listed in #1458, for an agent
refreshing a patch repo built against the old one. Production has no
patch version that declares Pidgeon.
- **Rollback safety, from the live commit `1414f9f` (release 44) to this
PR's merge.** The only PR in the range is #1458, labelled `one-way`. Its
migration `0044` adds the `pidgeon_drafts` table, which release 44
ignores, and removes Pidgeon connections made before it; production has
none. Its rollback rehearsal passed.

If this release misbehaves, roll back to `1414f9f` (release 44) while no
company has connected Pidgeon on this release. Once one has, rolling
back past #1458 would break that connection, because release 44 can't
read the new Pidgeon credentials, and its own Pidgeon calls go to an API
that's being switched off; fix forward instead.

## How it was verified

`pnpm format:check`, the What's new tests and the API schema tests pass
locally.

## Release impact

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

- **What does a revert leave behind?** Nothing: the entry and the
version number are in the tree.
- **Does the release before it still work with that?** Yes.

Written by Claude Opus 5.5 in Claude Code, through T3 Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@allisonmahmood allisonmahmood mentioned this pull request Nov 18, 2026
1 of 2 tasks
allisonmahmood added a commit that referenced this pull request Nov 19, 2026
…1426)

## What changed

Effect moves from 4.0.5 to 4.1.4 (`effect`, `@effect/platform-node`,
`@effect/sql-pg`, `@effect/sql-pglite`, `@effect/vitest`). People using
Patchy see no difference. Nothing stored changes: tokens, digests, HMACs
and sealed values are still made and checked by the same `node:crypto`
code. This supersedes #1380, whose CI was red because 4.1 stores
`HttpApiSchema.status` where our `refuse()` didn't look, so every
refusal answered 400.

Beside the Effect group, the lockfile moves only ws, to 8.23.0, which
`@effect/platform-node-shared` 4.1.4 pins exactly. undici 8.12.4 and
PGlite 0.5.16, which the 4.1 packages need, are already on main from
#1424, so the workspace holds one PGlite again.

## Look at

**Crypto.** 4.1 replaces `effect/Crypto` with per-family services and
drops crypto from the runtime `*Services` bundles. The `Cryptography`
seam stays as it was. `NodeCryptography.layer` now also provides
Effect's `SecureRandom` and `Digest`, using Effect's own Web Crypto
layers: no new dependency, nothing at import time, and the same
behaviour on Node and Bun. Every entrypoint and test layer already
provides it, so "provide `NodeCryptography.layer`" stays the one rule.
The seven direct `effect/Crypto` users take `SecureRandom` or `Digest`
instead. `@patchy/limits` can't depend on core, so `Digest` is what it
uses. AGENTS.md, the service-conventions spec and the oxlint messages
say this now.

**Refusal statuses.** 4.1's `HttpApiSchema.status` writes a key
annotation, which `SchemaAST.resolveAt` doesn't read. HttpApi's own
reader, `getStatusErrorSchema`, is internal and missing from the
published types, so `respond.ts` follows its rules exactly:
1. The last check that sets a status wins, looking into check groups
too.
2. Otherwise the schema's own annotation counts, and an explicit
`undefined` clears the status.
3. Otherwise the key annotation counts.
4. With none of those, the status is 500.

`respond.test.ts` compares each case with HttpApi's own reader. One
consequence: a schema with no status now answers 500, where it used to
answer 400. No current refusal schema lacks one.

**Request targets.** 4.1's server adapter turns an absolute-form target
into its path, and sets `Host` to the target URL's host, which drops
userinfo and the scheme's default port. The door's `Host` gate then saw
a cleaned-up host, so `POST http://<public host>/mcp` and `POST
https://user@<public host>/mcp` reached the bearer check instead of
answering 421. `RequestTrust.requestAuthority` now reads the target and
the `Host` fields from the Node request as the client sent them
(`request.source`). Sources without raw fields, such as a web `Request`
or the in-memory test client, keep the old reading. I also checked
everything else that reads the target or `Host`:
- The API guard, serving and the portal resolve `request.url` against
the configured origin, and compare `Origin` rather than `Host`. They
don't trust the target's authority, and the rewrite makes an absolute
target reduce to its path.
- The CLI dev server's DNS-rebinding guard compares `Host`. Browsers
send origin-form, which the adapter leaves alone, so the guard still
does its job.
- Two private listeners now accept an absolute-form target where they
used to refuse it before authentication, and the behaviour stays as it
is. The callback gateway (`CallbackGatewayApi.ts`) used to answer `POST
https://anything/callback` with 200 `invalid_request`; now it reaches
the bearer and identity checks. The supervisor's callback proxy
(`supervisor.ts`) looks up its callback path from the rewritten target.
Neither grants anything the checks behind it don't already require.

**Oversized uploads.** Under 4.1, an undeclared (chunked) body over its
cap is answered instead of reset. But the adapter then keeps reading up
to 256 KiB more with no deadline, so a sender that stalled kept its
connection until the runtime's own timeout. A declared length over the
cap had the same problem below 256 KiB, on origin/main as well.

A size refusal now closes the connection, through one hook:
`closeAfterAnswer` in `@patchy/api`. It adds `Connection: close` to the
current request's answer, and the adapter then ends the socket and
destroys it within its 500 ms grace. Measured here, the server closed it
about 7 ms after answering, on Node and on Bun. Every capped reader runs
the hook, for a cap crossed mid-stream and for a declared length over
the cap. Each keeps its existing status and body:
- `readBody`, for every JSON API route that reads one: 400 "Malformed
request body." mid-stream, 413 declared.
- The 16 form readers in auth and portal, through `capBody(maxBytes)`:
beta links, device login, the OAuth token request and consent answer,
machines, shortcuts, logout, terms, What's new, patch pages, sharing,
home (two), feedback, user lifecycle, and pinning. Their declared-length
prechecks run the hook too.
- The runtime's call, file and stage readers (413), and the
subscriptions stream (413).
- The callback gateway: the file bound and the byte budget answer, as
before, with a 200 refusal body.
- The supervisor's callback proxy (413).

One reader is left out: the MCP door reads a chunked body to its end by
design, so its refusal is unchanged. The device start, device poll and
shortcuts descriptions, and `docs/API.md`, say what the code does.
Nothing is stored on any refusal.

**Row ids.** 4.1's `SecureRandom.uuidV7` counts within a millisecond: 42
counter bits and 32 random. #214's contract test pins 74 random bits per
id, and Effect's own docs say a monotonic id reveals the one minted
before it. So `TableOperations` builds the UUIDv7 itself from the Effect
clock and 16 bytes from `SecureRandom`, clamping the timestamp to the
48-bit field as 4.0 did.

**Other behaviour 4.1 changed that tests asserted:**
- A failed migration step is a typed `MigrationError` (`kind: "Failed"`)
instead of a defect. Startup still fails and the process exits.
- The CLI parser now splits `-json=true` into `-j -s -o -n`, so
`jsonRequested` stops treating it as `--json`. A global flag's bad value
(`--log-level loud`) now goes through Effect's usage path like any other
parse error. That made the entrypoint's `InvalidValue` catch dead, so it
is gone. Under `--json` stdout stays empty; without it, usage comes
before the one line, as ADR-0004 allows.

**Mechanical.** `SqlClient.make` takes a `driver`, and `sql.insert`
takes a non-empty array. `docs/API.md` drops the eight duplicate
`RuntimeFailure_N` components that differed only by status.

**On top of the GitHub integration.** Everything on main since #1427 was
written against 4.0.5: the GitHub App connection (#1448) and its reads
(#1451), workerd binding its own port (#1444), CLI refresh (#1446) and
sidebar pins (#1437). Checked against each 4.1 change:
- **Crypto.** None of it uses `effect/Crypto`. `Cryptography` gains
`rsaSha256Sign` for the App's JWT, which runs on `node:crypto` like the
rest, and `NodeCryptography.layer` still provides it beside
`SecureRandom` and `Digest`.
- **Statuses.** It adds no routes and no status-bearing refusal schemas.
GitHub's refusals reach clients through the existing connection pages,
`ConnectionsApi` (whose declared errors HttpApi encodes itself) and the
runtime, which takes its status from the error. The GitHub, connections
and dev-read suites assert those statuses over `HttpApiTest` and real
sockets, and pass on 4.1.
- **Body reads.** The one new body read is the pin form, which provided
`MaxBodySize` directly. It now goes through `capBody`. GitHub's connect
flow adds none: its filter is a GET, and its choices post through the
connection page's existing form read, which #1434 caps.
- **Targets and `Host`.** The GitHub sign-in's redirect URI is built
from the configured origin, and nothing new reads `Host`.
- **The rest.** Nothing new calls `SqlClient.make`, the Migrator,
`uuidV7` or `ws`, and no new flag uses a single-dash long spelling.

**On top of Pidgeon's new API.** #1458 rewrote the Pidgeon integration
against 4.0.5, and nothing in it needed a 4.1 change:
- Its crypto goes through `Cryptography`.
- It adds no routes, status-bearing refusal schemas, body reads or CLI
flags. Its connect page posts through the connection page's existing
form read, which #1434 caps.
- It doesn't call `SqlClient.make`, the Migrator or `uuidV7`.
- Its migration `0044_pidgeon_drafts` joins the record behind this
branch's, and the record and upgrade tests pass.

## How it was verified

**Red, then green, on Effect 4.1.4:**

| Case | At 8980889 | Now |
| --- | --- | --- |
| `RequestTrust.test.ts`, the gate behind the real `NodeHttpServer`
adapter: `POST http://cloud.patchyhq.com/mcp` | passed the gate | 421 |
| `McpDoor.test.ts`, the whole server: `POST http://user@<host>/mcp` |
400 (past the gate) | 421 |
| Same tests: origin form, the door's own absolute target (200), two
`Host` fields | — | unchanged |
| `AuthApi.socket.test.ts` (JSON) and `AuthPages.socket.test.ts` (form):
an unterminated 8 KiB chunked upload | 400, connection still open at 3
s, on Node and Bun | 400, then closed, on Node and Bun |
| `AuthApi.socket.test.ts`: `Content-Length: 8192` sent with no body
(open on origin/main too) | 413, still open at 3 s, on Node and Bun |
413, then closed |
| `RuntimeApi.test.ts`: a call streamed just past its cap, a stage
upload streamed past its cap, and a stage upload declared past it | 413,
still open at 3 s, on Node and Bun | 413, then closed |
| `RuntimeStreamApi.test.ts`: a subscriptions body streamed past its cap
| 413, still open at 3 s, on Node and Bun | 413, then closed |
| `CallbackGatewayApi.test.ts`: a callback file body streamed past its
bound | 200 refusal, still open at 3 s, on Node and Bun | 200 refusal,
then closed |
| `respond.test.ts`: a status set inside a check group | 409 | 403, as
HttpApi |
| UUIDv7 contract: a clock at −1 ms | timestamp field all ones | 0 |

**Suites:**
- On the head rebased onto main at 2a17d16, which now carries the
Effect checker at 0.68 (#1425), `pnpm check` passes in full (3741
offline tests).
- `pnpm verify` on the previous head, on main at 47deb91:
- Pass in the full run: format, lint, typecheck, synth, the offline
tests on Node (3732) and Bun (3405), postgres-concurrency and install.
- Pass rerun alone: cli-smoke, tier2-smoke and the Chromium browser
suite (189). In the full run they couldn't find the browser builds that
Playwright 1.65 (from #1424) asks for; once installed, all three pass.
- Could not start: the Firefox suite, because Firefox there lacks the
system libraries it needs. CI's required `browser-firefox` job covers
it, and it passed in an earlier round (186 tests).
- The suites the Pidgeon rewrite touches pass on Node and on Bun (646
tests across 72 files each): all of `packages/integrations` and
`packages/api`, the CLI's `pidgeon`, dev-resource and dev-preparation
tests, and the server's migration record test.
- The GitHub integration's suites, run alone on 4.1, pass on Node (361
tests across 27 files, with portal and the CLI's repo, global-CLI and
dev-resource files) and on Bun (286 tests across 24 files; the CLI files
run on Node only). They cover:
- `github/Connections.test.ts`: connecting through the App against a
stub GitHub on real sockets.
  - `github/Operations.test.ts`: the reads.
  - `github/Pages.test.ts`: the connect pages.
- `github/Source.test.ts` and `Generate.test.ts`: the source and
generated tables.
- `ConnectionsApi.test.ts`, `ConnectionPages.test.ts` and
`DevReads.test.ts`, with their status assertions.
  - `NodeCryptography.test.ts`, including RS256 signing.
- Each rebase took main's lockfile and regenerated it with `pnpm
install`; it differs from main's only in the Effect group and ws.
- `install.test.ts` builds its PATH from the running Node, so these runs
put the repo's pinned Node 24 first.
- The supervisor's callback proxy gets the same hook, but has no socket
test: reaching it needs a live workerd resident to register the callback
path and capability.
- Not checked: the server image (`server-image` needs Docker; CI runs
it), live Clerk, and a deploy.

## Release impact

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

This is a dependency bump, and the stored formats and the API's statuses
and bodies are unchanged. Three things a client could notice:
- An oversized chunked upload now gets its refusal and a closed
connection, where it used to get a reset.
- A declared length over a cap gets its 413 and a closed connection,
where the connection used to stay open.
- The undocumented single-dash `-json=<b>` spelling is no longer read as
`--json`. `--json` and `--json=<b>` are unchanged.

- **What does a revert leave behind?** Nothing: no migration, no new
stored shape. Ids, tokens, digests and sealed values are made the same
way on both sides.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 in T3 Code via Claude Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Nov 19, 2026
## What changed

A few forms never got a body cap, so the server read whatever was sent
to them: creating or joining a company, People and Agent access, Teams,
the integration connection forms, and the local dev server's agent door
and shortcuts form. They now cap their reads as the rest of Patchy's
forms do. A submission over the cap gets the answer that page already
gives a form it can't read, and the connection closes.

Builds on #1426, now merged, which added `closeAfterAnswer`.

## Look at

**`capBody` now refuses a declared length over its cap before reading.**
Until now it noticed an overflow only once the bytes arrived, so a
sender that declared `content-length: 4097` to a 4 KiB form and sent
nothing got no answer until Node's request timeout. It now fails at
once, with the same `HttpServerError` the platform raises mid-stream.
Each page answers it as it answers any unreadable form, and the
connection closes after the answer. The forms in auth and portal that
already read through `capBody` alone get the same: logout, terms, beta
links, machines, What's new, patch pages, sharing, home, feedback and
user lifecycle. Their answer is unchanged; it just comes without the
wait. Readers that check the declared length themselves (`readBody`,
device login, OAuth) answer their own 413 first, as before.

With the new socket test over `capBody` without that check:

```
AssertionError: /join {"declared":4097}: expected +0 to equal 400
```

With it, the test passes.

**The caps**, each sized from the largest legitimate submission of its
form:

| Reader | Cap | Why |
| --- | --- | --- |
| `/join` (`Join.ts`) | 4 KiB | an invitation id, or a company name of
up to 200 UTF-16 units (at most 9 bytes each once percent-encoded: 1,800
bytes) and a 32-character handle |
| People › Invite (`CompanyPage.ts`) | 233,596 bytes (about 228 KiB) |
worked out from the address schema: an address is up to 254 UTF-16
units, each at most 9 bytes once percent-encoded (a three-byte UTF-8
character; a four-byte one is two units, 6 bytes each), and a separator
at most 9 (a comma or semicolon and a CRLF). The cap reads twice a full
batch of those, so a longer paste is refused by its count, and 4 KiB
more for the role and the list's filter: 2 × 50 × 2,295 + 4,096 |
| People › role and Resend, Agent access (`CompanyPage.ts`) | 1 KiB |
one hidden field each |
| Teams, all five forms (`TeamsPage.ts`) | 8 MiB | a roster form carries
up to two member ids per person (a shown member's removal and its keep
box), about 70 bytes a person. Nothing limits how many people a company
holds, so the cap sits far past any roster the page could show at once:
about 119,000 people. It was 1 MiB (about 14,000 people) until
acceptance submitted a 16,000-person roster and was refused. A team name
is 100 code points (1,200 bytes at most) |
| Every connection form (`formBody` in `ConnectionPage.ts`) | 256 KiB |
Postgres's connection string may be 16,384 characters, up to 9 bytes
each once encoded (147,456 bytes), beside a handle and a description |
| Dev server `/~dev/agent` | `mcp.body.bytes` (1,114,112) | the call as
Patchy MCP reads one: the tier 2 argument cap plus 64 KiB of envelope |
| Dev server `/api/me/shortcuts` | 4 KiB | as Patchy's own
`/api/me/shortcuts` reads it |

**How an over-cap form answers** is how that page already answers an
unreadable one:

- Join, People, Agent access and Teams: the auth pages' 400 "Invalid
form" door.
- Connection forms, Pidgeon's and GitHub's included: the form again with
400 "The form could not be read. Submit it again."
- Dev server shortcuts: 400 `Send value=on or value=off.`
- Dev server agent door: the refusal Patchy MCP's door gives a body over
its cap, `too_large` in the door's words, as the dev agent's usual
answer, so `patchy dev agent` reports a refusal and exits 2 (below). A
malformed call within the cap keeps its 400 `Bad request`.

**An over-cap `patchy dev agent` call is the door's `too_large`.** A
plain 400 would have made the CLI say the tool "may or may not have run"
and exit 3, when the call was refused before anything started. A body
over `mcp.body.bytes` is refused unread, so the dev server answers with
the door's own refusal of such a body. That refusal, `bodyTooLarge`, now
lives in `@patchy/api` beside the other shapes of a tool call's answer,
and the door's 413 reads its words from there, unchanged. `patchy dev
agent` then exits 2 with the door's words, as the README and ADR-0004
already say any refusal the door would give does; both now name this
`too_large` beside the oversized read. Answered before the body is read,
the CLI's own client (undici) still reads the refusal: a 1,114,155-byte
call gets it, in each of four runs.

**`test/socket.ts`.** `stalledUpload` reads the answer's
`content-length` and rejects when the server closed before the whole
answer arrived, so a close that cuts a refusal short no longer passes
for one. It returns the body, so tests assert which refusal came back.
Against a throwaway server, a whole answer resolves, one cut 5 bytes
short rejects with "The server closed the connection 5 bytes short of
its answer's body.", and a close with no answer rejects too. The five
suites that already used it pass unchanged.

## How it was verified

Each reader gets a body one byte past its cap over a real socket
(`NodeHttpServer.layerTest`), twice: as one chunk that never ends, and
as a declared length with nothing sent. Each must answer its whole
refusal and close within 3 seconds. Routes that share a reader share one
case.

- `AuthPages.socket.test.ts`: Join, the four People and Agent access
reads, Teams.
- `ConnectionPages.test.ts`: the connect form, through the one
`formBody` every connection form reads with.
- `devServer.test.ts`: both dev server readers, inside the existing dev
server test, so it boots once. The agent door's answer is the door's
refusal, also sent through the CLI's own client; a malformed call within
the cap is still a 400.
- `cliDevAgent.test.ts`: `patchy dev agent` given that refusal exits 2
and prints the door's words, in text and `--json`.
- `CompanyPage.test.ts`: a full batch of the longest addresses the page
accepts (50 addresses, 114,924 bytes with the longest filter) is read
and invites all 50; twice that (228,024 bytes) is refused by its count,
"That is 100 addresses". The socket case refuses one byte past 233,596.

Red, with one piece taken out at a time, then green with it back:

| Taken out | Failing assertion |
| --- | --- |
| `capBody`'s declared-length check | `/join {"declared":4097}: expected
+0 to equal 400` |
| Teams' cap (at its first value, 1 MiB) |
`/settings/company/teams/create {"chunked":1048577}: expected +0 to
equal 400` |
| The connection forms' cap | `{"chunked":262145}: expected +0 to equal
400` |
| The dev agent door's cap | `POST /~dev/agent HTTP/1.1
{"chunked":1114113}: expected +0 to equal 200` |
| The dev agent door's refusal (its plain 400 back) | `POST /~dev/agent
HTTP/1.1 {"chunked":1114113}: expected 400 to equal 200` |
| The invite cap's arithmetic (64 KiB back) | the full batch: `expected
400 to equal 303` |

Existing page tests post real forms through `HttpServerRequest.fromWeb`,
which enforces `MaxBodySize` as the socket does, so a cap below a
legitimate form would fail them. They pass, including the 51-address
invite refusal and every connection form.

Rebased onto #1426's earlier head (`b1310609`, on main at `47deb913`,
with Pidgeon's new API from #1458 and the dependency sweep from #1424),
`pnpm check` passes in full: format, lint, typecheck, synth and all
3,736 offline tests. Neither #1458 nor #1424 added a body read.
Pidgeon's connect form now posts through the shared `formBody`, so the
256 KiB cap covers it, and Postgres's connection string is still the
largest thing a connection form carries. The suites this PR and the
rebase touch pass on Node (810 tests, before the sweep landed:
`packages/integrations`, `packages/companies`, `packages/api`,
`packages/mcp`, the auth socket and company-page tests, and the CLI's
dev-agent, dev-server and `pidgeon` tests). On Bun at this head they
pass too (803; the dev-agent and dev-server files run on Node only).

`pnpm verify` ran before the rebase, at the first commit, `6e54ccd5`, on
a shared machine under heavy load (load average 40 to 60 during the test
phases). Format, lint, typecheck, synth and every acceptance suite
passed: postgres-concurrency, cli-smoke, install, tier2-smoke, browser
and browser-firefox. The offline `test` and `test (bun)` phases each
failed some tests: timeouts in files this PR doesn't touch, a different
set on each run. Rerun alone at low load, all of them passed (10 files
on Node, 6 on Bun). The socket cases ran in both phases, except
`devServer.test.ts`, which is Node-only, as the CLI is. The installer
suite needs `npm` beside the `node` it runs; with the pinned Node first
on `PATH` it passes.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required: forms people submit read as
before; only bodies past a form's largest legitimate size are refused

- **What does a revert leave behind?** Nothing: no schema, rows or
contract change.
- **Does the release before it still work with that?** Yes.

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

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

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:core Touches the core area area:docs Touches the docs area area:integrations Company connections and integration implementations area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles one-way Rolling production back past this PR would break the release before it size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

integrations: Pidgeon is retiring the API Patchy calls; connecting already fails, everything stops on 22 November

1 participant