Skip to content

feat(mcp): every way a person's credentials end also ends their agent connections - #879

Merged
allisonmahmood merged 2 commits into
mainfrom
mcp/847-endings
Oct 23, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
mcp/847-endings

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

Stacked on #878 (ticket #846); merges with the rest of #833's stack, not alone.

What changed

A person ends an agent connection in several ways: they disconnect it, press Disconnect everything, leave it 30 days without a call, or have its refresh token reused. Deactivation ends it too, and reactivation brings nothing back. Each of these now ends what the spec's endings table says, in one transaction, and the next call sees it. That includes a rollback to the release before the stack. ADR-0008 now reads as decided, retitled Every bearer is somebody: machine tokens and agent connections.

Closes #847

Look at

Disconnect everything and deactivation end agent connections through #838's stamp alone. Neither writes an agent_connections row. #846's check already treats a connection made at or before users.credentials_ended_at as dead, and both endings already set the stamp in their own transaction, under the person's row lock. Release 16 sets the same stamp and knows nothing of agent connections, so a rollback that ends credentials still ends connections. This PR keeps that one mechanism rather than adding a second. Only MachineTokens.revokeAll and Users.deactivate change, and only in their comments. revokeAll needs no machine token to exist, as #853 will rely on.

The one new write is AgentConnections.disconnect({ id, userId }), for Your machines' Disconnect (#853 wires the route). It is one UPDATE … RETURNING scoped to the owner. Another person's id, an admin's included, is AgentConnectionNotFound. Disconnecting a connection that has already ended keeps its first stamp. The statement takes only the connection's row, which refresh also holds FOR UPDATE while it rotates. It holds no lock before or after that one, so it can't invert refresh's user-then-connection order.

The races, tested deterministically. Each test holds one side's transaction open, waits until the other blocks on a lock in pg_stat_activity, then commits:

  • A connection made racing a deactivation. When the deactivation commits first, the exchange waits on the person's row and is refused UserUnavailable, so reactivation finds nothing to bring back. When the exchange commits first, the deactivation's stamp comes later on the database's clock and ends the connection. With create's FOR SHARE removed, the first case fails: the exchange returns a live connection made against a committed deactivation, and it survives reactivation.
  • A refresh racing Disconnect everything. When the ending commits first, the refresh waits and is refused ended. When the refresh commits first, what it issued dies with the connection.

Every comparison is clock_timestamp() against credentials_ended_at, both written under the person's row lock, so no app server's clock enters it.

The rollback rehearsal now runs four steps: live → HEAD → live → HEAD.

  1. At step 2, HEAD mints agent connections for the publisher, Jordan and Priya.
  2. At step 3, release 16 ends credentials as people do, in Chromium:
    • Priya collects one device login's machine token, approves a second without collecting it, and presses Disconnect everything (Revoke all machines on that release);
    • the admin deactivates Jordan and reactivates them through Company's confirmation pages.
  3. At step 4, back at HEAD:
    • HEAD's own work check refuses Jordan's and Priya's connections and still accepts the publisher's;
    • Priya's approved device login answers unknown. An expired answer would show nothing, so it fails as well;
    • her machine token gets 401.

How it was verified

  • packages/auth/src/Endings.test.ts, one test per row of the endings table. Each asserts the next call and the next refresh:

    • disconnecting one agent ends only it, including the minute's retry, and nobody else can, an admin included;
    • Disconnect everything ends both connections, the machine token and an approved device login, and needs no machine token to end a connection;
    • 30 days without a call ends that connection only;
    • a refresh token reused after its minute ends that connection only;
    • deactivation ends every credential and pending approval, and a new connection is refused;
    • reactivation brings none back, and a fresh connection works;
    • plus the two race tests above.
  • Red before green: on Agent connections: the work credential and its tokens #846's code, only the disconnect row failed (connections.disconnect is not a function). The stamp rows passed already, which is the point of the first item under Look at.

  • The auth suites (Endings, AgentConnections, DeviceLogins, MachineTokens, DevicePages) and the companies Users suite pass. Typecheck and lint pass.

  • pnpm test:rollback-rehearsal --live e4243ff (release 16, live since 2026-10-22, with Tier 2 readers accept handler descriptions, read-only actions and agent tools, and enforce them #837 and Deactivation and Disconnect everything end pending device logins and record when a person's credentials ended #838) passed:

    Rehearsing e4243ff → 9358530 → e4243ff → 9358530 on one set of data.
    ▶ Step 3: the live commit (e4243ff) comes back
      passed in 38s
    ▶ Step 4: HEAD (9358530) comes back
      passed in 36s
    Exercised rollback paths passed: e4243ff → 9358530 → e4243ff → 9358530, in 288s.
    

    Step 4 also fails when it should. A throwaway commit whose work check ignores the stamp fails step 4, naming both members. Its device poll still answered 410 unknown and the machine token 401:

    Step 4 of 4, HEAD (55e7c42) comes back, failed while checking what the live release ended.
      HEAD accepts Jordan Lee's agent connection after the live release deactivated and reactivated them
      HEAD accepts Priya Shah's agent connection after they pressed Disconnect everything on the live release
    

    That run also exercised the head's sturdier press, which waits for the new document after a form's POST. CI's rollback-rehearsal rehearses the head against production, which is release 16.

Surfaces. ADR-0008 has the decided text word for word. Its device login and confirmation paragraphs stay as they are, and so do the dead-row, browser sign-out and human-owner sentences. #838's stamp sentence now covers agent connections. The decision line adds the sign-in decision with #846, #847 and #849. GLOSSARY-MAP.md carries the new title. The Auth glossary's Revocation, Device login and Your machines and Companies' Deactivation and Reactivation already read as built, so they're unchanged. docs/OPERATIONS.md › Rolling back and docs/DEVELOPMENT.md describe the fourth step. There's no route, CLI, API or migration change: #853 adds the Disconnect route and #849 the consent rows.

Release impact

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

No schema change. One new service method, comments, a test file, the ADR and the rehearsal.

  • What does a revert leave behind? Connections disconnected through the new method keep revoked_at. Nothing else is written.
  • Does the release before it still work with that? Yes. The rehearsal shows release 16 running on HEAD's data and ending credentials HEAD then honours.

Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh).

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review rounds (GPT-6.1-Sol, xhigh)

Round 1, on 5a30481: nothing blocking or should-fix. The brief asked about three areas. The reviewer's answers:

  • A mint or refresh racing an ending. A mint or refresh that commits first holds the person's lock, and the later ending's stamp makes it dead. An ending that commits first makes refresh refuse ended, and deactivation makes creation refuse. Reactivation keeps the stamp. disconnect takes only the connection's row and never waits for the person's, so there's no lock-order cycle. The deterministic tests do exercise both commit orders. A fresh connection after Disconnect everything stays allowed; cancelling earlier consents belongs to The authorization flow: authorize, the code exchange and refresh #849.
  • Clocks. Creation, revocation, expiry, retry and idle checks run on the database's time. confirmed_at and credentials_ended_at are compared in SQL at database precision. Machine-token timestamps still use the app's Clock, but their revocation check tests nullness, never ordering against the stamp.
  • The rollback path. Release 16 keeps connection rows, advances the shared stamp on both endings and keeps it through reactivation, so HEAD refuses those connections. The rehearsal waits for each form's navigation, reseeds nothing, checks the endings before step 4's broader exercise, and rejects an expired device-login answer. The reviewer found no way for it to pass for the wrong reason.
  • ADR and surfaces. The four decided paragraphs match Every way a person's credentials end also ends their agent connections #847 word for word. The retained text and decision line are present. Keeping Deactivation and Disconnect everything end pending device logins and record when a person's credentials ended #838's generalised stamp sentence is right, and so is relying on the stamp without writing revoked_at on every connection: it's one mechanism older releases also enforce. No missing surface or service-convention issue.
Finding Severity Outcome
scripts/rollback-rehearsal.ts:1260 still says "three steps" nit Fixed in 2f28800

Review stops here: the round found nothing blocking.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 2f288007e51ea0a151bcf91be5eb70936d242fe5 (stack base 82a05f46753ab9d647264d1025cda8015a8b9b51) on fresh team, brightline, and isolated test databases, by GPT-6.1-Sol (xhigh) in the Codex harness through T3 Code.

Done means

  • Each ending: passed. The six ending rows in Endings.test.ts pass: single disconnect, Disconnect everything, idle expiry, refresh reuse, deactivation, and reactivation. Next access and refresh are refused where required; unrelated connections survive; an admin cannot disconnect someone else's connection. The mint/deactivation and refresh/Disconnect everything races pass in both commit orders.
  • Transaction and concurrency risks: passed. Additional probes on fresh team data exercised single disconnect racing refresh in both commit orders, including the minute's retry, and aborting outer transactions around single disconnect and Disconnect everything. No token survived a committed ending; aborted endings left credentials working. Another person's connection survived, and a fresh connection after Disconnect everything worked.
  • Rollback cannot revive a connection: passed. Ran pnpm test:rollback-rehearsal --live e4243ff54d2acbbc88b60eeb0cf9b82a26dc9d5d at this head. Release 16 ended credentials through its browser pages; returning to HEAD refused both ended agent connections, retained the publisher's, refused the ended machine token, and answered unknown for the uncollected device login.
  • ADR-0008 reads as decided: passed. Programmatically compared all four replacement paragraphs with Every way a person's credentials end also ends their agent connections #847 word for word, and checked the retained device-login, confirmation, dead-row, browser-sign-out, and human-owner text, title, and decision references.

Golden journeys

  • Sign in: passed on HEAD. The private page returned 401 with its sign-in URL and private, no-store; Ben signed in and returned to its content, and browser sign-out restored the door.
  • Log a machine in: passed on HEAD. The environment CLI printed a link/code; Ada confirmed in Chromium; whoami named Acceptance laptop; logout removed access.
  • Publish a page: passed on HEAD. Ada published; Ben opened it and found it on Home. Retiring hid its content; restoring brought it back at the same address.
  • Deactivate/reactivate: passed in the four-step rehearsal and the head's company/auth suites; credentials stayed dead after reactivation. The rehearsal also reopened every Brightline patch and checked sample data and live-query delivery on each build.
Local evidence

Focused command: pnpm exec vitest run over Endings, AgentConnections, DeviceLogins, MachineTokens, DevicePages, Users, and SweepSchedules.

Test Files  7 passed (7)
Tests       79 passed (79)

PASS: disconnect commits first; blocked refresh is refused and access is dead
PASS: refresh commits first; disconnect ends the new tokens and the retry
PASS: a failed outer transaction rolls back a single disconnect
PASS: Disconnect everything is transactional, isolates people, and allows a fresh connection

Exercised rollback paths passed: e4243ff → 2f28800 → e4243ff → 2f28800, in 278s.

Rollback answers: They match the diff. No new schema or external contract is introduced by this layer. Single disconnect leaves the existing revoked_at field populated, which the base already enforces. Disconnect everything and deactivation use the existing credentials-ended stamp, including when release 16 writes it. No one-way label is needed for this diff.

Not run

  • Full local pnpm verify: not run; used the focused local checks above and the head's CI run. Its remaining jobs are not counted as passed.

Notes

All temporary instances were taken down. The checkout remains clean at the checked head; no PR code, branch, body, or labels were changed.

@allisonmahmood
allisonmahmood force-pushed the mcp/846-agent-connections branch from 82a05f4 to 39527c5 Compare October 23, 2026 02:09
@allisonmahmood allisonmahmood mentioned this pull request Oct 23, 2026
@allisonmahmood
allisonmahmood force-pushed the mcp/846-agent-connections branch from 39527c5 to 18cac61 Compare October 23, 2026 13:09
Base automatically changed from mcp/846-agent-connections to main October 23, 2026 13:25
… connections

Each row of the spec's endings table now ends what it says, and the next
call sees it. Disconnect everything and deactivation end every agent
connection through #838's credentials-ended stamp alone, which the
release before the stack writes too, so a rollback can't bring one back.
AgentConnections.disconnect ends one of the person's own connections;
nobody else, an admin included, can aim at it.

Endings.test.ts has one test per row, and races a connection's exchange
against a deactivation and a refresh against Disconnect everything in
both orders. The rollback rehearsal now runs live, HEAD, live, HEAD: the
live release deactivates, reactivates and disconnects everything, and
HEAD then finds both connections dead and the approved device login
minting nothing. ADR-0008 reads as decided.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit b1b94ff into main Oct 23, 2026
25 of 26 checks passed
@allisonmahmood
allisonmahmood deleted the mcp/847-endings branch October 23, 2026 13:50
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
… own authorization metadata (#880)

Stacked on #879 (ticket #847); merges with the rest of #833's stack, not
alone.

## What changed

An MCP client such as Claude or Codex first reads how Patchy wants it to
connect, then names itself with a metadata document on its own site.
Patchy now publishes its protected resource metadata for `/mcp` and its
authorization server metadata, and it can fetch and judge a client's
document under the spec's rules. That document's URL is a stranger's, so
the fetch is the SSRF-sensitive part of this PR. Nothing calls it yet:
#849's authorize and code exchange do.

Closes #848

## Look at

**The fetch reaches only global unicast, and connects only to the answer
it checked.** `ClientDocuments` resolves the host once through
`ClientDocumentNetwork.resolve`. It refuses the fetch if *any* answer
isn't global unicast, then hands the checked addresses to `connect`. The
production `connect` opens TLS for the host name, with `lookup`
answering from those addresses, so the name is never resolved again. The
address rule moved from the Postgres integration to `@patchy/core`
(`isPublicAddress`), so both refuse the same set: only `2000::/3` passes
for IPv6, so mapped, compatible, NAT64, 6to4 and Teredo forms all fail,
and so do `169.254.0.0/16` and `fd00:ec2::254`. A client id must be the
URL parser's own canonical https form on a host name. That refuses
decimal, octal, hex and short-form IPv4, any IP literal, dot segments,
userinfo, fragments and the default port before anything is fetched.

```text
# The production layers against the real URLs, from a dev machine:
{"url":"https://claude.ai/oauth/mcp-oauth-client-metadata","ms":184,"result":{"clientId":"https://claude.ai/oauth/mcp-oauth-client-metadata","name":"Claude","site":"claude.ai","redirectUris":["https://claude.ai/api/mcp/auth_callback"]}}
{"url":"https://claude.ai/oauth/claude-code-client-metadata","ms":143,"result":{"clientId":"https://claude.ai/oauth/claude-code-client-metadata","name":"Claude Code","site":"claude.ai","redirectUris":["http://localhost/callback","http://127.0.0.1/callback"]}}
{"url":"https://chatgpt.com/oauth/client.json","ms":62,"result":{"clientId":"https://chatgpt.com/oauth/client.json","name":"ChatGPT","site":"chatgpt.com","redirectUris":["https://chatgpt.com/connector_platform_oauth_redirect"]}}
{"url":"https://chatgpt.com/oauth/codex/client.json","ms":70,"result":{"clientId":"https://chatgpt.com/oauth/codex/client.json","name":"Codex","site":"chatgpt.com","redirectUris":["http://127.0.0.1/callback","http://localhost/callback"]}}
{"url":"https://claude.ai/oauth/does-not-exist","ms":22,"result":{"_tag":"ClientDocumentUnavailable","site":"claude.ai","stage":"status","status":403}}
{"url":"https://localhost/client.json","ms":1,"result":{"_tag":"ClientDocumentUnavailable","site":"localhost","stage":"address"}}
```

**The other limits live in two places.** The HTTP rules are in `get`: no
redirect, 200 only, a declared `Content-Length` over 5,000 refused
before the body, a chunked body cut off once it crosses 5,000 bytes, and
the whole fetch, DNS included, timed out at 5 s. The host limits are two
maps in `ClientDocuments.make`: `kept` holds accepted documents, least
recently used first, and `running` holds the one fetch for each URL.
- **Running fetches.** Every load that arrives while a fetch runs waits
on it, failures included. The fetch belongs to the service's scope, not
the first caller. Claiming a URL and forking its fetch can't be
interrupted apart. An observer on the fetch fiber settles every waiter
however it ends, so an interrupted load or a shutdown never strands a
URL. Keeping documents never evicts a running fetch.
- **What's kept.** A document is kept for its `max-age`, or `Expires` −
`Date`, or the hour row when neither is sent. `Age` counts against each,
the time is counted from the request, and the hour is the cap.
`no-store`, `no-cache`, `max-age=0` and a malformed or repeated
`max-age` keep nothing, and a failure is never kept.
- **Starts.** Each miss spends one of 30 starts a minute host-wide
before fetching. A hit spends nothing.

**Accepting.** `client_id` must equal the URL exactly. `client_name` and
`redirect_uris` are required, as MCP's client registration requires, and
every listed redirect must be an absolute URI without a fragment.
`token_endpoint_auth_methods_supported` is read when present and
`token_endpoint_auth_method` otherwise, and must offer `none`. That is
exactly why ChatGPT's recorded document (single field `private_key_jwt`,
list `["none", "private_key_jwt"]`) is accepted. Grant types and other
fields are ignored. `redirectAllowed` matches an https redirect the
document lists exactly. It matches plain http to `localhost`,
`127.0.0.1` or `[::1]` on any port, with the host and path exact, and
only when written canonically, so only the port varies. It never allows
plain http to another computer, even when listed.

**Patchy's metadata.** `/.well-known/oauth-protected-resource/mcp` (and
the root form) name `scope="patches"`.
`/.well-known/oauth-authorization-server` advertises
`client_id_metadata_document_supported`, `none`, `S256`, `patches`,
`iss` and no `registration_endpoint`. Both send `cache-control: public,
max-age=3600`. In production they also send
`access-control-allow-origin: *` without credentials, and answer a
preflight with the spec's headers. `OAuthMetadata.cors` and `preflight`
are exported for #849's token endpoint and #851's door. A dev instance
(a loopback public origin, the rule dev personas already used, now
`Session.isLoopback`) sends no CORS and advertises
`http://127.0.0.1:<port>/oauth/token`, whatever loopback host it is
served on.

## How it was verified

- `packages/auth/src/ClientDocuments.test.ts`, 25 tests over a real HTTP
server on loopback behind a test `ClientDocumentNetwork`, with one test
per rule. Highlights:
- Claude's, Claude Code's, ChatGPT's and Codex's documents, recorded
byte for byte as fixtures in `@patchy/auth/testing`, all accepted.
- 17 resolver answers refused before any connection, including
`169.254.169.254`, `fd00:ec2::254`, `::ffff:127.0.0.1`,
`64:ff9b::a9fe:a9fe`, `0.0.0.0`, `::`, and a public answer mixed with a
private one.
- A rebinding resolver: the first fetch connects only to the checked
addresses, and the next fetch re-resolves and refuses the private answer
without connecting.
  - Every 3xx and non-200 refused, with exactly one request seen.
- 5,000 bytes accepted. A declared 5,001 is refused with no body sent,
and a chunked 5,001 closes the connection.
- A silent server and a trickling body both time out at 5 s and not at
4.999 s (`TestClock`).
- 17 cache-header cases, errors and refused documents never kept, and
LRU eviction at the entry limit.
- Busy past the minute's starts, with a cache hit spending none. 20
concurrent loads make one request for a success and for a 500. 40 URLs
at once make exactly 30 fetches.
- A running fetch survives the kept documents filling up. Closing the
service before a fetch runs ends every waiting load.
- `ClientDocumentNetwork.test.ts`: the production `connect` reaches a
TLS server on `127.0.0.1` under the unresolvable `client.invalid`, sends
that name as SNI and refuses its self-signed certificate.
- Mutation check: removing each of these makes the suite fail. The
address check, the declared-size check, the canonical client id,
list-before-single, `no-store`, `Age`, the loopback host match, the
200-only rule, the start limit and the IP-literal refusal.
- `OAuthMetadata.test.ts` covers both documents, the preflight, and dev
instances on `<label>.localhost`, `localhost` and `127.0.0.1`.
`Server.test.ts` shows the full server answers `/.well-known/*` ahead of
`/:company/:name/*`.
- GPT-6.1-Sol reviewed in three rounds; [the findings and their
fixes](#880 (comment)).
Round 3 found nothing.
- `pnpm test:rollback-rehearsal --live e4243ff` (release 16, live, with
#837 and #838) passed: `e4243ff → fd374a4 → e4243ff → fd374a4, in 161s`.
The commit after fd374a4 only changes `ClientDocuments.load` and a test,
and adds no migration.
- `vitest run packages/limits packages/auth packages/core
apps/server/src/Server.test.ts`: 297 passed. The Postgres integration's
`Source.test.ts` passed after the move. Typecheck (packages and tests)
and lint pass.
- Not checked here: a real client connecting, which needs #849's
endpoints, and the fetch from production's egress, which #834 already
showed for all four documents.

## Release impact

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

New routes and an in-memory service. No migration, configuration or wire
contract changes, and the three new limits are optional
`PATCHY_LIMITS_JSON` ids with defaults. Within the stack, the metadata
names `/oauth/authorize` and `/oauth/token`, which #849 builds. Nothing
here ships before the whole stack does.

- **What does a revert leave behind?** Nothing: no rows, schema or
stored state. Clients that cached the metadata for its hour would find
`/oauth/*` gone, as before the stack.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and
accepted by GPT-6.1-Sol (xhigh).
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
## What changed

This PR adds release 17's What's new entry, written from `5dd94f3`. It
covers everything merged since release 16's `through` (`dd3f41f`), and
it sets the `patchy` release to `0.17.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`. With this release,
people's agents can use their company's patches through Patchy MCP
(#833).

| Change | PRs |
| --- | --- |
| New: Your AI agent can use your company's tools | #873, #878, #880,
#881, #882, #883, #884, #886, #887 |
| New: Admins choose whether agents can use the company's tools | #871 |
| Improved: Your machines shows your agents too (Revoke all machines is
now Disconnect everything) | #885, #879 |
| New: See what agents can do with a tool | #876 |
| New: The log says when an agent made a change | #888 |
| New: Your agent can make a tool ready for agents | #869, #870, #872,
#875, #896 |
| Behind the scenes: agents' calls have their own limits, and a server
only an agent uses rests a minute after its last call | #889, #892 |
| Behind the scenes: New and Improved changes are public, for
patchyhq.com | #893 |
| Behind the scenes: library updates | #899 |

Five merged PRs get no line:
- #874 is release 16's own entry.
- #894 is dev tooling: worker agent launchers and scenario data. Its one
CLI fix lets a `patchy` installed outside a tier 2 repo publish it. The
skills have agents use the repo's pinned `pnpm patchy` instead, so that
path is off the documented one.
- #900 is CI.
- #901 rewords an internal skill.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- It names only Claude Code and Codex. Both have connected through real
consent against dev instances. Hosted clients (Claude.ai, ChatGPT) are
checked in production only (`docs/product.md` › Patchy MCP ›
Acceptance).
- Its labels are the pages' own: Agent access on Company, Your machines,
What agents can do, Disconnect everything, and "Jordan Lee via Claude".
- **Rollback safety, from the live commit `e4243ff` to `5dd94f3`.**
- No PR in the range is labelled `one-way`, and every PR answers both
Release impact questions with "Yes".
  - Migrations 0020–0025 are all additive:
    - three defaulted or nullable columns on `companies`;
- `agent_name` on the runtime log, with a widened `credential_kind`
check;
    - the agent connection tables, `agent_consents` and `change_keys`;
    - two columns on execution bindings.

The new tables reference `users` without a cascade, but no release
deletes users or companies. Release 16 reads the runtime log only for
credential kinds it knows, so rows from agents can't break it.
- `rollback-rehearsal` on #892 rehearsed the whole stack, since #892
adds the last migration and the rest of the stack sits below it:
`Exercised rollback paths passed: e4243ff → c8bede4 → e4243ff → c8bede4,
in 238s.` #896's run skipped, because it changes no migration or handler
descriptor.
- #883 turns on the load balancer's host header preservation, which the
Deploy workflow's app stack deploy applies. A rollback leaves it on.
That's harmless, because release 16's server never reads `Host`.
- A rollback takes `/mcp` and `/whats-new.json` away. Connected agents
get a 404 until this release returns, and then their connections work
again, unless one ended in between. Agent tools published in between
stay refused to pages, because #837 already shipped in release 16.

## How it was verified

- `pnpm check` on `2d528b1`: format, lint, typecheck and synth passed.
In the test step, 2,300 of 2,301 tests passed. The one failure was
`packages/sdk/src/install.test.ts` › "says how to reach patchy when the
prefix's bin is not on PATH", which timed out at 180 s while the shared
machine was loaded. Rerun alone, that file passes all 7 tests in 62 s.
The release's own tests pass too: `whatsNew.test.ts`, `schemas.test.ts`
and `WhatsNewPages.test.ts`.
- The live commit was pinned from `/healthz/deep`: `e4243ff`, release
16. The Deploy run updated last succeeded, and none is unfinished.
- Each PR in the range was read with `gh pr view`, including its Release
impact answers.

## Release impact

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

This PR changes only the changelog text and the `patchy` version. As
with every release, a CLI installed before this deploy is told to
upgrade.

- **What does a revert leave behind?** Nothing. People whose seen marker
reached 17 would just see no new release.
- **Does the release before it still work with that?** Yes.

If this release misbehaves, roll back to
`e4243ff54d2acbbc88b60eeb0cf9b82a26dc9d5d` (release 16).

Prepared by Claude Opus 5.5 (xhigh) in Claude Code on 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:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area area:server Touches the server area size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every way a person's credentials end also ends their agent connections

1 participant