Skip to content

feat(auth): Your machines shows how to connect an agent and lists the agents you've connected - #885

Merged
allisonmahmood merged 2 commits into
mainfrom
mcp/853-your-machines
Oct 23, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
mcp/853-your-machines

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

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

What changed

Your machines now opens with how to connect an agent: a tab per agent (Claude, Claude Code, Codex, ChatGPT, Another agent), each a plain link, showing only that agent's steps with Patchy's address in a copy line. Below it, the person's agent connections are listed beside their machines. Each shows its client and site, when it connected and was last used, and Disconnect. A connection unused for a week says when it ends on its own and that a reconnect leaves it behind. "Revoke all machines" becomes Disconnect everything, under "Lost a laptop?", and it shows even when nothing is listed.

Closes #853

Look at

  1. Release notes: the rename. Production's button says "Revoke all machines"; from this release it says Disconnect everything and ends agents too. It is now always on the page, so an approval nobody has collected can still be cancelled. The What's new entry for the stack's release should name the rename. The form still posts to /machines/revoke-all, the route the rollback rehearsal presses.
  2. Choices within the spec's words:
    • With no ?agent=, or an unknown one, the Claude tab is open. Tab links carry #connect-an-agent, the id the card's "Connect your agent" link (A patch's card shows what agents can do #845) lands on.
    • Codex's first step holds both commands as copy lines. Claude Code's /mcp stays inline code, because it's typed inside Claude Code.
    • ChatGPT gets no menu path, only "Only some ChatGPT plans can add custom connectors."
    • Step 3 is a generic "Ask for something", not a patch-specific example.
    • A connection never called says Last used "Not yet". The leftover line counts from the last call, or from connecting when there was none. Its "ends on its own" date comes from the new AgentConnections.list, using the same SQL as the 30-day ending itself, so the two can't disagree.
    • Dates carry the year ("13 Oct 2026"), as the mock does; the spec's example drops it.
    • The reverse state is said once, in the Agents intro: "A disconnected agent can't be brought back: connecting it again makes a new connection."
    • The page moved out of DevicePages.ts into MachinesPage.ts. Device login keeps its own module.

Your machines, access on

A member with a fresh Claude Code connection, made through consent, and a week-unused one from before a reconnect (minted with pnpm dev mcp-token, its last use moved back in the dev database):

Ben, access on, two agents

An admin with a machine and an agent (minted with pnpm dev mcp-token, so its site is the dev host); then the same page after Disconnect everything, with both lists empty and the button still there:

Before Disconnect everything After
Ada, access on, a machine and an agent Ada after Disconnect everything

Access off, as a member and as an admin

Member: the admins are named Admin: Turn it on at Company
Ben, access off Ada, access off

Phones (390 px)

Member, two agents Admin, Codex tab Member, access off Admin, access off After Disconnect everything

No page scrolls sideways at 390 px. None logged a console error.

How it was verified

Done means, with a real Claude Code (2.1.308) against pnpm dev up team on this branch. The run used a throwaway CLAUDE_CONFIG_DIR in a temp dir outside $HOME, so ~/.claude.json and ~/.claude/ gained nothing. Consent was driven in a throwaway Playwright context signed in as Ben (member), with agent access turned on at Company by Ada.

Connect, see it listed, disconnect, 401

The command came from the Claude Code tab's copy line. claude mcp login is the CLI form of /mcp › Authenticate, since the interactive TUI can't run here.

$ claude mcp add --transport http patchy http://<env>.localhost:<port>/mcp
Added HTTP MCP server patchy with URL: http://<env>.localhost:<port>/mcp to local config
$ claude mcp login patchy --no-browser
Visit this URL to authorize: http://<env>.localhost:<port>/oauth/authorize?…&client_id=https%3A%2F%2Fclaude.ai%2Foauth%2Fclaude-code-client-metadata…
   (Ben, in the browser: the consent page, then Allow → http://localhost:<port>/callback?code=…&state=…&iss=…)
Authenticated with "patchy". Its tools are now available in Claude Code.
$ claude mcp get patchy
  Status: ✔ Connected

Your machines, as Ben: Claude Code CLAUDE.AI · Connected 22 Oct 2026 · Last used just now · Disconnect. Ben pressed that row's Disconnect, and the next call failed:

$ claude mcp get patchy
  Status: ! Needs authentication

The server's events for Claude Code's requests, in order:

Request Status Code
POST /oauth/token 200 code exchange
POST /mcp 200 server/discover
POST /mcp 200 tools/list
POST /mcp 401 invalid_token after Disconnect
POST /oauth/token 400 invalid_grant its refresh, after Disconnect
  • MachinesPage.test.ts, through the page's routes over a migrated database:
    • each tab's own steps and copy lines, with no inline script;
    • an unknown ?agent= opening Claude;
    • access off naming the admins (an escaped name) to a member, and offering an admin "Turn it on at Company";
    • the person's own agents only, with "Not yet" and the leftover line on the week-unused one alone;
    • Disconnect ending that connection's next call and nobody else's, and 404 for someone else's connection;
    • machines (moved from DevicePages.test.ts);
    • Disconnect everything shown with nothing listed, ending both kinds, and leaving both lists empty.
  • AgentConnections.test.ts: list returns live connections only, newest first, with endsAt 30 calendar days after the last call, or after connecting.
  • DevicePages.test.ts: a cross-origin or origin-less POST to Disconnect is refused 403 and leaves the connection working.
  • pnpm verify passed on 8153299: 2,244 tests and 81 browser tests, "All passed."
  • Rollback rehearsal: CI's check skips itself because no migration changed. This PR changes the page the rehearsal presses (form[action="/machines/revoke-all"]), so it was run locally against e4243ff, a main commit 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: "Exercised rollback paths passed: e4243ff → 8153299 → e4243ff → 8153299".
  • Review: GPT-6.1-Sol, two rounds (comment below). Round 1's one should-fix, the server skill not saying where people connect, is fixed in 8153299. Round 2 found nothing.

Release impact

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

No migration, no API change; one new read (AgentConnections.list) and one new page route.

  • What does a revert leave behind? Nothing stored. The page goes back to machines only, with "Revoke all machines" shown only while a machine is listed. Disconnects already made stay made.
  • Does the release before it still work with that? Yes. The routes it keeps are unchanged, and the stack ships as one release.

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

Before and after, as Ben Ortiz (member)

Before is 90262f1 (where this branch left mcp/852-find-open) and after is f72f04e (mcp/853-your-machines), both on the team scenario, from pnpm dev compare.

Every page answered 200 with no browser errors.

/machines

1280px, after

After: /machines at 1280px

1280px, before

Before: /machines at 1280px

Width Before After
390px Before: /machines at 390px After: /machines at 390px

Before and after, as Ada Park (admin)

Before is 90262f1 (where this branch left mcp/852-find-open) and after is f72f04e (mcp/853-your-machines), both on the team scenario, from pnpm dev compare.

Every page answered 200 with no browser errors.

/machines

1280px, after

After: /machines at 1280px

1280px, before

Before: /machines at 1280px

Width Before After
390px Before: /machines at 390px After: /machines at 390px

@github-actions github-actions Bot added area:server Touches the server area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review by GPT-6.1-Sol (xhigh), two rounds.

Round 1, on f72f04e: no blocking findings.

  • should-fix: packages/sdk/skills/patchy-server/SKILL.md described /mcp and the agent access switch, but didn't say where a person connects their agent or disconnects it. Fixed in 8153299, which adds one factual sentence. It points to <instance>/machines#connect-an-agent on Your machines, which also lists connected agents, each with Disconnect.

Round 1 also checked and passed:

  • the Agents list against AgentConnections' live predicate;
  • the "ends on its own" date and the week-unused threshold;
  • escaping;
  • the disconnect route's ownership and same-origin checks;
  • Disconnect everything always showing;
  • the plain-link tabs and the copy lines;
  • the phone wrapping;
  • the rollback rehearsal's /machines/revoke-all selector.

Round 2, on 8153299: no findings. The skill fix states the fact without scripting builder behaviour.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 8153299018f7ed7d6d96d6f6ee25bde438fbe188 (stacked base 90262f1a8b6a47a2952c06c54632a208c65d93f2) on fresh team instances, by GPT-6.1-Sol (xhigh) in Codex on T3 Code. The head remained unchanged before posting.

Done means

  • Connect Claude Code, see it listed, disconnect, next call 401: passed. Ran the command from the Claude Code tab with Claude Code 2.1.308 and temporary configuration, authenticated through browser consent as Ben, and saw Claude Code / CLAUDE.AI / Connected / Last used just now. Disconnect removed it. The client's next request returned 401 invalid_token; its refresh returned 400 invalid_grant.
  • Week-unused notice: passed. An eight-day-unused scenario connection showed “Not used since 14 Oct 2026. If you reconnected Old Claude Code since, this is the old one; it ends on its own on 13 Nov 2026.” The recent connection had no notice.
  • Disconnect everything empties both lists: passed. With an agent and Acceptance laptop listed, the button left “No agents are connected” and “No machines are logged in,” while remaining available. The agent then returned 401 and machine whoami was rejected. Cleo's connection still returned 200. With both lists empty, the same button cancelled a confirmed but uncollected device login: collection returned 410 unknown and minted no key.

Golden journeys

  • Sign in: passed. The signed-out company page returned 401 with the sign-in URL header, private, no-store, and no redirect. Signing in as Ada opened the page. Sign out from Your machines returned to the sign-in door.
  • Log a machine in: passed. CLI login → browser confirmation as Ben → completion → whoami named Ben and Acceptance laptop. Disconnect everything then ended that machine. The focused suite also passed individual Revoke and foreign-machine protection.
  • Publish a page: passed. Ben published a company-only tier 0 page; Ada opened “Hello Acme” in its frame. CLI retire and restore returned retired and live.

Other risks checked

  • Missing-origin and foreign-origin Disconnect POSTs returned 403 and left the connection working. Ben's attempt to disconnect Cleo's agent returned 404; her agent stayed usable and absent from his list.
  • All five tabs showed their own three steps and expected copy lines; an unknown selection opened Claude. At 390 px, every tab and the populated list had scrollWidth === innerWidth === 390. Access-off member and admin pages also fit; the member saw Ada's name and the admin's link reached the Company switch. No UI consistency findings.
  • Auth route wiring and existing page consumers passed locally:
pnpm exec vitest run packages/auth/src packages/serving/src/Pages.test.ts apps/server/src/SweepSchedules.test.ts
Test Files  22 passed (22)
     Tests  255 passed (255)

Rollback answers: match the diff. No migration, stored-format change, infrastructure change or changed existing wire contract. Disconnects remain ended after a revert, which the previous release supports. The /machines/revoke-all route remains unchanged. No one-way label is needed; the rollback-rehearsal check is green.

Not run

  • Claude Code's interactive /mcp menu: used its real claude mcp login patchy --no-browser authentication command and browser consent instead.
  • Live connection setup in Claude web, Codex, ChatGPT and other clients: checked these tabs' rendering and copy lines; the live client acceptance journey was Claude Code.

Notes

  • GitHub's postgres-concurrency check still says IN_PROGRESS, although its test step, cleanup steps and Complete job all report success, and the parent workflow is completed/success. This verdict does not treat that individual pending check as green. Job.
  • Applicable mirrored surfaces: Auth routes and page consumers, shared served-page components, Auth glossary/product wording, builder project skill, and disconnect/reconnect guidance. No API schema, CLI command, dev runner, migration, company-resource or package-layout changes.
Real Claude Code transcript and server responses
$ claude mcp add --transport http patchy <instance>/mcp
Added HTTP MCP server patchy ... to local config
$ claude mcp login patchy --no-browser
[Ben allowed consent in the browser]
Authenticated with "patchy". Its tools are now available in Claude Code.
$ claude mcp get patchy
Status: ✔ Connected
[Ben clicked this connection's Disconnect]
$ claude mcp get patchy
Status: ! Needs authentication

POST /oauth/token                           200
POST /mcp  server/discover                   200
POST /mcp  tools/list                        200
POST /machines/agents/<connection>/disconnect 303
POST /mcp                                   401 invalid_token
POST /oauth/token                           400 invalid_grant
Populated page and empty state on the checked head

Ben: connected Claude Code and the week-unused connection

Ben: populated page at 390 px

Ben: both lists empty after Disconnect everything

Exact-base/head desktop and phone comparison (agent access off)

Before and after, as Ben Ortiz (member)

Before is 90262f1 (--base origin/mcp/852-find-open) and after is 8153299 (HEAD), both on the team scenario, from pnpm dev compare.

Every page answered 200 with no browser errors.

/machines

1280px, after

After: /machines at 1280px

1280px, before

Before: /machines at 1280px

Width Before After
390px Before: /machines at 390px After: /machines at 390px

@allisonmahmood allisonmahmood mentioned this pull request Oct 23, 2026
Base automatically changed from mcp/852-find-open to main October 23, 2026 15:32
@allisonmahmood
allisonmahmood merged commit 7865a12 into main Oct 23, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the mcp/853-your-machines branch October 23, 2026 15:42
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
Stacked on #885 (ticket #853); merges with the rest of #833's stack, not
alone.

## What changed

A person's worker agent can now read a patch through its agent tools:
`read_patch { patch, tool, args }` runs a query or read-only action as
the person, on the version served when the call arrives, and answers `{
result, version }`. Until now the door refused it as not built.

Closes #854

## Look at

- **One version per call** (`packages/mcp/src/Calls.ts`, `reach`). The
patch is resolved among those the person can open, then the tool's
existence, its kind and its arguments are all checked against the
version the list read, and `Invocation.callAgent` runs on that same
`LoadedVersion`. A test publishes a version that flips the tool to a
mutation *while the call runs*: the call still ran on the read's
version, and the next call is refused `wrong_kind`, naming the tools
there are now and `open_patch`.
- **The recheck before every company callback** (`Calls.recheck`,
`AgentConnections.current`). It reads the connection, the person and
agent access on the database's clock without stamping last used, and
answers the person as they are now, so a role change shows. On real
workerd, a call whose connection is disconnected between its
shared-table read and its Postgres read gets `{ first: 2, second:
"access_denied" }`, and the next call gets 401.
- **Caps measured once.** A read's compact JSON text over 100,000
characters is refused `too_large` ("Narrow the call; the patch's owner,
Priya Shah, can add paging."). The door fits every tool's refusal into
the same cap in one place: past it, a refusal keeps its code, its words
and any retry wait and leaves its details out, and refusals repeat at
most 128 characters of a tool name, so what they say to do always
arrives. Arguments over the runtime's argument cap are refused before
anything starts the patch. The read cap lives in `@patchy/api` beside
the other shared shapes, so the catalogue and `patchy dev agent` use the
same number.
- **Server wiring.** `Server.ts` now merges the host's invocation into
the server's services so the door finds the same instance Runtime uses
(`provideMerge` instead of `provide`); a host that runs no patch code
answers `source_unavailable`. The new apps/server test fails without
that line.

Decisions the spec left open, picked the way #844 picked `unknown_tool`
and `invalid_args`:

- `wrong_kind` for a change tool named on `read_patch` (and, for #855, a
read on `change_patch`).
- `patch_retired` for the retired refusal, the code publishing already
uses: "new-business was retired by Priya Shah on 12 Oct 2026; they can
restore it. Tell the person."
- `patchy dev agent` refuses a read over the cap too, since it answers
what the door would.

## How it was verified

- `packages/mcp/src/Calls.test.ts`, the door over a migrated database
with Runtime's invocation as an alternate layer: success shape and what
the door hands Runtime (person, `ctx.agent`, version), refusals before
anything runs, publishes between and during calls, retired versus not
found (other company, `Openability` closed, deleted), both caps, a
patch's own refusal and Runtime's, and the recheck through a role
change, agent access off and on, disconnect and deactivation.
- `packages/mcp/src/Calls.workerd.test.ts`, on real workerd: an agent
reads its own table and a shared table as the person with `ctx.agent`; a
read-only action reads company Postgres, attributed to the person;
forced writes in read-only actions are refused (`invalid_query`,
sqlstate 25006, no row written; `access_denied` "A read-only action
cannot write."); the shared table's live check refuses the whole read
once its source is retired and passes again on restore; a disconnect
mid-call stops at the next callback. The request event carries
`agentTool`, `agentToolKind`, `handler`, `kind`, `outcome` and queue,
guest and database milliseconds, and no arguments or results.
- `apps/server/src/McpDoor.test.ts`: a dev-mode server publishes a tier
2 patch with an agent area and `read_patch` runs it through the server's
own invocation.
- `AgentConnections.current`, `wrongKindRefusal`, `readAnswer`,
`fitRefusal` and `patchy dev agent`'s cap have focused tests;
`Door.test.ts` checks every tool's refusal keeps the read cap.
- The head, 8d83b9f, is 9b14bea rebased onto the base's one new commit,
a docs edit to `patchy-server`'s skill outside the paragraph this PR
adds; the skill's tests pass on it. `pnpm verify` passed on 9b14bea
(2,260 tests, Postgres concurrency, CLI and tier 2 smoke, 81 browser
tests). CI is green on the same head after a re-run of `clerk-live` and
`tier2-smoke`, which had hit their job time limits on slow runners.
- Rollback rehearsal: the PR's `rollback-rehearsal` check runs against
production's commit, which doesn't yet have #837 and #838. Rehearsed
instead against `main` at e4243ff, which has both: `pnpm
test:rollback-rehearsal --live e4243ff` passed e4243ff → 9b14bea →
e4243ff → 9b14bea on one set of data, in 169 s.
- Codex 0.163.0 on a dev instance read a patch through its agent tools,
on both revisions, and recovered from a publish between calls.
Transcripts below.

<details><summary>Codex on a dev instance, transcripts</summary>

A `pnpm dev up brightline` environment. New Business (tier 2, sample
data) gained an `agent/deals.ts` with two reads, `dealsInStage` (a
query) and `forecast` (a read-only action), published from the
environment's workspace. Allison turned agent access on at Company.
Codex ran as Jordan Lee, a member, with a token from `pnpm dev mcp-token
jordan --client Codex`, from a temp dir outside `$HOME`: `codex exec
--json --ephemeral --ignore-user-config -s read-only -c
'mcp_servers.patchy.url="<instance>/mcp"' -c
'mcp_servers.patchy.bearer_token_env_var="PATCHY_MCP_TOKEN"'`. Tool
results are cut here.

Asked: "Using the patchy MCP server: find our new-business pipeline
patch and open it. Then tell me which deals are in negotiation right
now, with each one's value and owner, and what the weighted forecast is
for the whole open pipeline."

Codex's default revision (2025-06-18):

~~~text
agent: I’ll find the new-business pipeline in Patchy, open it, and check
the negotiation deals and weighted forecast.
(Codex read the machine's global Patchy skill)
(Codex read the machine's global Patchy skill)
agent: I’m using the Patchy skill with the MCP server you requested.
mcp_tool_call patchy.find_patches({"search": "new business", "detail":
"tools"}) -> completed: {"actingFor":{"person":"Jordan
Lee","company":"Brightline
Studio"},"total":1,"patches":[{"name":"new-business","description":"Brightline's
new-business pipeline: track every pitch from first lead to signed work,
with own…
mcp_tool_call patchy.open_patch({"patch": "new-business"}) -> completed:
{"name":"new-business","description":"Brightline's new-business
pipeline: track every pitch from first lead to signed work, with owners,
stage rules and a live board the whole studio shares.","owner":"Allison
Mahmood","a…
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"forecast", "args": {}}) -> completed:
{"result":[{"stage":"lead","deals":4,"value":105000,"weighted":10500},{"stage":"discovery","deals":3,"value":178000,"weighted":44500},{"stage":"proposal","deals":3,"value":179000,"weighted":89500},{"stage":"negotiation",…
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"dealsInStage", "args": {"stage": "negotiation"}}) -> completed:
{"result":[{"id":"01a164fa-7643-7655-84ce-ed9812d73dd0","client":"Atlas
Outdoor Co.","title":"E-commerce rebuild","value":140000,"owner":"Marcus
Chen","nextStep":"Send a revised timeline with two
releases","expectedClose…
agent: Opened the [new-business
pipeline](<instance>/brightline/new-business).

Currently in negotiation:

| Deal | Value (USD) | Owner |
|---|---:|---|
| Atlas Outdoor Co. — E-commerce rebuild | $140,000 | Marcus Chen |
| Bluebird Pediatrics — Clinic signage and wayfinding | $26,000 | Sofia
Alvarez |

The **weighted forecast for the whole open pipeline is $269,000 USD**,
across 12 deals with a total unweighted value of $628,000.
~~~

With `--enable mcp_2026_07_28` it made the same calls, with the same
answer:

~~~text
agent: I’ll find and open the pipeline patch, then check the negotiation
deals and weighted forecast.
(Codex read the machine's global Patchy skill)
mcp_tool_call patchy.find_patches({"search": "new business", "detail":
"tools"}) -> completed: {"actingFor":{"person":"Jordan
Lee","company":"Brightline
Studio"},"total":1,"patches":[{"name":"new-business","description":"Brightline's
new-business pipeline: track every pitch from first lead to signed work,
with own…
agent: I found Brightline’s `new-business` patch, owned by Allison
Mahmood. I’m using the Patchy skill with the MCP server to read its
pipeline data.
mcp_tool_call patchy.open_patch({"patch": "new-business"}) -> completed:
{"name":"new-business","description":"Brightline's new-business
pipeline: track every pitch from first lead to signed work, with owners,
stage rules and a live board the whole studio shares.","owner":"Allison
Mahmood","a…
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"forecast", "args": {}}) -> completed:
{"result":[{"stage":"lead","deals":4,"value":105000,"weighted":10500},{"stage":"discovery","deals":3,"value":178000,"weighted":44500},{"stage":"proposal","deals":3,"value":179000,"weighted":89500},{"stage":"negotiation",…
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"dealsInStage", "args": {"stage": "negotiation"}}) -> completed:
{"result":[{"id":"01a164fa-7643-7655-84ce-ed9812d73dd0","client":"Atlas
Outdoor Co.","title":"E-commerce rebuild","value":140000,"owner":"Marcus
Chen","nextStep":"Send a revised timeline with two
releases","expectedClose…
agent: Opened the [new-business
pipeline](<instance>/brightline/new-business).

Two deals are in negotiation:

| Deal | Value (USD) | Owner |
|---|---:|---|
| Atlas Outdoor Co. — E-commerce rebuild | $140,000 | Marcus Chen |
| Bluebird Pediatrics — Clinic signage and wayfinding | $26,000 | Sofia
Alvarez |

The **weighted forecast for the whole open pipeline is $269,000 USD**,
across 12 deals with a total estimated value of $628,000.
~~~

Then `forecast` was renamed `weightedForecast` and published as version
3. Asked: "Using the patchy MCP server, call read_patch with patch
new-business, tool forecast and args {} — that's the tool I used
yesterday — and tell me the weighted forecast for the open pipeline."

~~~text
agent: I’ll check the forecast through the Patchy MCP server.
(Codex read the machine's global Patchy skill)
agent: I’m using the Patchy skill for this read.
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"forecast", "args": {}}) -> failed: new-business has no tool forecast.
Its tools now: dealsInStage, weightedForecast. Call open_patch to see
what each does and takes.
mcp_tool_call patchy.open_patch({"patch": "new-business"}) -> completed:
{"name":"new-business","description":"Brightline's new-business
pipeline: track every pitch from first lead to signed work, with owners,
stage rules and a live board the whole studio shares.","owner":"Allison
Mahmood","address":"<instance>/brightline/new-business","tools":[{"name":"dealsInStage","kind":"read","description":"List
the deals in one pipeline stage, most recent activity first: each dea…
mcp_tool_call patchy.read_patch({"patch": "new-business", "tool":
"weightedForecast", "args": {}}) -> completed:
{"result":[{"stage":"lead","deals":4,"value":105000,"weighted":10500},{"stage":"discovery","deals":3,"value":178000,"weighted":44500},{"stage":"proposal","deals":3,"value":179000,"weighted":89500},{"stage":"negotiation","deals":2,"value":166000,"weighted":124500}],"version":3}
agent: The weighted forecast for the open pipeline is **$269,000 USD**,
across 12 deals with a total estimated value of $628,000.

Yesterday’s `forecast` tool is now called `weightedForecast`; I used the
current tool to retrieve this.
~~~

The door's request events for the last four `read_patch` calls (selected
fields; none carries arguments or results):

~~~text
{"status": 200, "outcome": "success", "mcpTool": "read_patch",
"agentTool": "forecast", "agentToolKind": "read", "handler":
"agent.forecast", "kind": "action", "protocolEra": "modern",
"clientName": "Codex", "patchRef": "name", "queueWaitMs": 1, "guestMs":
9, "dbMs": 1.06489, "callbacks": 1, "argsBytes": 2, "resultBytes": 254}
{"status": 200, "outcome": "success", "mcpTool": "read_patch",
"agentTool": "dealsInStage", "agentToolKind": "read", "handler":
"agent.dealsInStage", "kind": "query", "protocolEra": "modern",
"clientName": "Codex", "patchRef": "name", "queueWaitMs": 0, "guestMs":
11, "dbMs": 13.928742, "callbacks": 2, "argsBytes": 23, "resultBytes":
445}
{"status": 200, "outcome": "refused", "code": "unknown_tool", "mcpTool":
"read_patch", "agentTool": "forecast", "protocolEra": "legacy",
"clientName": "Codex", "patchRef": "name"}
{"status": 200, "outcome": "success", "mcpTool": "read_patch",
"agentTool": "weightedForecast", "agentToolKind": "read", "handler":
"agent.weightedForecast", "kind": "action", "protocolEra": "legacy",
"clientName": "Codex", "patchRef": "name", "queueWaitMs": 1, "guestMs":
7, "dbMs": 0.909001, "callbacks": 1, "argsBytes": 2, "resultBytes": 254}
~~~

</details>

## Release impact

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

No migration and no new rows: `read_patch` answers on a door that ships
with the rest of #833's stack.

- **What does a revert leave behind?** Nothing: no schema, no stored
shapes, no configuration.
- **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]>
@allisonmahmood allisonmahmood mentioned this pull request Oct 28, 2026
1 of 2 tasks
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
## What changed

Patchy MCP has been live in production since release 17, but the product
doc, the glossary map and the MCP glossary still called it specified or
being built. They now describe what runs, and where the build settled a
detail differently from the spec, the spec now says what the code does.
Production acceptance (#861) hasn't run: the section says so, and claims
about particular clients are framed as what the build was designed for.

Part of #862. This is everything in #862's "What to do" except "What
remains takes acceptance's findings", which waits for #861.

## Look at

**Status and pointers.** Each of these now reads as built:
- `docs/product.md`: the "Built and live" intro line names Patchy MCP;
the Patchy MCP section opens "Built, and live since release 17", links
#833 and says #861 hasn't run.
- The same file's tier 2 sentence, `agent/` pointer, Companies (admins,
deactivation), Who's who and Bounds' admission rule.
- `GLOSSARY-MAP.md`: Auth and Patchy MCP.
- `packages/mcp/GLOSSARY.md`.
- `README.md`: the layout, plus one sentence on tier 2.
- `AGENTS.md`'s tier 2 line.
- `docs/OPERATIONS.md`: request events.

**Spec details the build settled differently.** Each claim was checked
against main:

| Claim in the doc | What main does | Where |
| --- | --- | --- |
| A forwarded host is trusted from Patchy's proxy | The door never
believes a forwarded host and refuses two `Host` fields |
`packages/mcp/src/RequestTrust.ts:7-10` |
| `Host` gates the OAuth endpoints too | Only `/mcp` is Host-gated; a
dev instance serves every route on `127.0.0.1` |
`packages/mcp/src/Door.ts:372`,
`packages/auth/src/OAuthEndpoints.ts:19-20` |
| An unknown method is `404` | `404` on 2026-07-28, `200` on legacy,
where 404 means session ended | `packages/mcp/src/Door.ts:356-363` |
| An `unknown_outcome` always resolves on retry | Only until a few
minutes before 24 h; then `key_expired` |
`packages/mcp/src/ChangeKeys.ts:116-123`, `Calls.ts:339-347` |
| An action's key never runs again | Unless Runtime refused the first
try before it started | `packages/mcp/src/ChangeKeys.ts:60-64`,
`Calls.ts:409-419` |
| `resource` is bound through exchange and refresh | Optional; must name
the door wherever sent | `packages/auth/src/Consents.ts:203-205,
345-348` |
| Consent re-asks after an account switch | Also re-asks an Allow after
the client's name changes |
`packages/auth/src/OAuthEndpoints.ts:423-436` |
| With agent access off, consent names the admins | To members; an admin
is told to turn it on | `packages/auth/src/OAuthEndpoints.ts:182-185` |
| "logged as Jordan via Claude" | The person's full name: "Jordan Lee
via Claude" | `packages/auth/src/OAuthEndpoints.ts:151-162` |
| The docs say how to reconnect by hand | Not written; Connect an app
gives first-time steps only | no such doc in `docs/`, `skills/`,
`packages/sdk/skills` |
| Publish's warning points at `<instance>/company` |
`<instance>/company/agent-access` |
`packages/patches/src/PatchesApi.ts:454` |
| The instance names a duplicated tool | It can't: inspection drops the
bundle's message; only the CLI names it |
`packages/execution/src/inspection.ts:12-16` |
| A read-only action's writes are type errors | Table and file writes
are; Pidgeon writes typecheck and the callback gate refuses them |
`packages/patchy/src/server.ts:247-262`,
`packages/runtime/src/CallbackGateway.ts:107-111` |
| `dev.log` names the person | It writes their id: `usr_dev via patchy
dev …` | `packages/patchy/src/devLog.ts:23-27` |
| New repos include `agent` | Tier 1 and 2 repos do |
`packages/patchy/src/initProject.ts:207` |
| The MCP request event says whether its binding is agent-only | Only
the binding event carries `agentOnly` |
`packages/analytics/src/WideEvents.ts:228` |
| An in-flight slot is held after the client disconnects | A client gone
before dispatch gives it back | `packages/mcp/src/Admission.ts:13-17` |
| The week-unused note opens "Not used since 2 Oct." | It opens "If you
reconnected …" | `packages/auth/src/MachinesPage.ts:178` |
| "today a person types everything into them" | Agents now find, read
and change patches too | the section itself |
| Pages "get phone checks when built" | They were checked at 390 px in
their PRs' screenshots (#871 #876 #882 #885 #931 #932) | — |

## How it was verified

- Four read-only passes went claim by claim through the Patchy MCP
section against main at 2f9f7c1. I re-read the code for every finding
before changing a line. The table lists each change.
- **Findings left as they are:**
- "the one secret Patchy keeps recoverable": the context is the
connection's tokens.
- "each change gets a fresh change key" in `patchy dev agent`: the
code's own comment says the same.
- The lists of which outside clients can connect: these are facts about
those clients, and the code offers no dynamic registration.
- `pnpm check`: format, lint, typecheck and synth passed. Two test files
failed under load average 19, a 5 s timeout in
`PgliteCompanyDatabases.test.ts` and a worker SIGKILL in
`devExecution.test.ts`. Both passed when rerun alone. Neither touches
docs.
- **Not done here:** `packages/sdk/skills/patchy-server/SKILL.md:415`
and `packages/sdk/src/sdkCapabilities.ts:107` say a patch's tools fit in
64 KiB, but the check allows 60 KiB of that answer. Those files belong
to another lane, so they're left for a follow-up.

## Release impact

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

Docs only.

- **What does a revert leave behind?** Nothing; the docs go back to
calling Patchy MCP specified.
- **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).

---------

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:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Your machines shows how to connect an agent and lists the agents you've connected

1 participant