Skip to content

feat(mcp): an agent's call keeps its company's server for a minute, and waits for it to start - #892

Merged
allisonmahmood merged 1 commit into
mainfrom
mcp/858-agent-idle
Oct 23, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
mcp/858-agent-idle

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

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

What changed

An agent's call used to keep its company's server for thirty minutes, as a tab does, so an agent polling every few minutes kept a company running around the clock. Now an agent's call keeps the server for a minute after it settles, on a clock of its own that never touches a tab's thirty minutes, and a call on a released company waits for the server to start (up to 40 s) before it's refused busy with retryAfterSeconds: 15.

Closes #858

Look at

  • Two clocks on the binding row (packages/execution/src/fleetStore.ts). last_activity_at stays the documents' clock, with idle_since as before: the window starts no earlier than the first pass to find no document holding the task. A binding no document or page ever touched (last_activity_at = 0) skips that step. The new agent_activity_at is the agents' clock. Agent admissions run only their own clock and never set or clear idle_since. idleFence releases once no document holds the task, nothing is in flight on it or on a binding of the company still draining, and both clocks are out.
  • A settling call runs its clock before it lets go of the binding, so no pass can find the binding free with the clock not yet run. It lets go even if that update fails, and then keeps its crash protection to the deadline. Clocks only move forward (GREATEST), so a settlement that lands late never shortens a later one's window. An update that finds no live binding runs once more, because a replacement that committed while it waited is outside its snapshot. That costs a warm call one more statement, six instead of five: the clock, then the protection clear.
  • A tab's window starts when a pass first sees it gone, even while agent work holds the binding. So overlapping agent calls can't postpone a tab's thirty minutes.
  • Who called is now a required argument of ExecutionLifecycle.acquire ("page" | "agent"), set by Invocation from the binding's agent. Nested calls ride on their parent's one admission, so the agent's clock starts when the whole tree, cleanup included, settles.
  • The deadline. The bind wait was already outside the handler's deadline, and the process start inside it. A new Invocation test pins both: 30 s waiting for the server, then a 2.9 s start succeeds and a 3.1 s start is handler_timeout.

How it was verified

  • Fleet tests on Postgres with TestClock, all red before the change:
    • an agent-only binding survives 5 min of in-flight work and is released exactly 60 s after settling;
    • a call that settles on a binding a deployment replaced while it ran still gets its minute on the replacement;
    • a pass landing right after a long call lets go of the binding finds the minute already running;
    • a document holder that vanished without letting go still leaves its thirty minutes from the first pass to find it gone;
    • a tab that leaves while an agent's call runs starts its thirty minutes then, not when the call ends;
    • a settled call whose clock update fails still lets go of the binding and idles out after its protection;
    • a call settling while a deployment replacement commits runs its minute on the replacement;
    • an abandoned cold wait still says how long it waited;
    • a tab's 30 min and an agent's minute run side by side: a call 29m30s after the tab let go keeps the task until 30m30s, not 59m30s;
    • a call's event says bound / spare / launch and the wait, including a wait refused at the end of execution.pool.wait;
    • binding events carry agentOnly.
  • The door test: a bind-wait refusal reaches read_patch and change_patch as busy, "Acme's server is starting; try again in 15 seconds.", retryAfterSeconds: 15.
  • pnpm typecheck, eslint on the changed files, and the execution, runtime, mcp, analytics, limits and server suites.
  • Dev-instance run. pnpm dev up brightline, with countDeals, a read tool, added to New Business. Agent access was turned on at /company, and Jordan's token came from pnpm dev mcp-token jordan --client "Claude Code". The dev runner's server is no-pool and its environment is closed, so a second host from this worktree ran beside it on the instance's database and storage. It had EXECUTION_PROVIDER=local-fleet, its own EXECUTION_LOCAL_DIRECTORY, EXECUTION_CALLBACK_URLS/EXECUTION_CALLBACK_PORT and PATCHY_PUBLIC_BASE_URL, and short clocks through PATCHY_LIMITS_JSON: {"execution.company.agentIdle":10000,"execution.company.idle":60000,"execution.housekeeping.interval":1000}, plus execution.fleet.budget and execution.pool.wait for the last run. A script sent read_patch to that host's /mcp, and a watcher printed Brightline's bindings from the database.

Run at the PR's head (fbc2de3):

An agent calling every 30 s (for every five minutes; agent idle 10 s): each call binds and the company is released ~11 s later
22:36:08 call 1: 200 {"result":{"deals":17},"version":2}  565 ms
22:36:09 bindings  24:active
22:36:20 bindings  24:stopped, bound 11.4 s, idle, agentOnly true
22:36:38 call 2: 200 252 ms
22:36:39 bindings  25:active
22:36:50 bindings  25:stopped, bound 10.9 s, idle, agentOnly true
22:37:09 call 3: 200 346 ms
22:37:09 bindings  26:active
22:37:20 bindings  26:stopped, bound 10.7 s, idle, agentOnly true
binding event: {"type":"binding","releaseCause":"idle","agentOnly":true, ...}
A tab beside the agent keeps its own clock (tab 60 s, agent 10 s): released after both, never extended by agent calls
22:37:25 bindings  27:active                 Jordan opens New Business
22:37:29 call A: 200, 59 ms                  runs on the tab's binding, no new one
22:38:04.976 the tab leaves                  last_activity_at 22:38:04.976, idle_since 22:38:05.221 (next pass)
                                             -> the tab's window runs to 22:39:05
22:38:25 call B: 200, 121 ms                 had it touched the tab's clock: no release before 22:39:25
22:39:00 call C: 200, 123 ms                 agent_activity_at 22:39:00.322 -> agent clock runs to 22:39:10
22:39:10.541 bindings  27:stopped, bound 105.6 s, idle, agentOnly false
A call on a cold company waits for the bind; one past the pool wait is refused busy (budget 1 task, pool wait 5 s)

Calls made the instant the company was released, before the replacement spare was ready (execution.fleet.budget: 1):

call 1: {"companyBind":"launch","bindWaitMs":1646,"durationMs":1980}
call 2: {"companyBind":"launch","bindWaitMs":942,"durationMs":1254}
call 3: {"companyBind":"launch","bindWaitMs":761,"durationMs":1003}
call 4: {"companyBind":"launch","bindWaitMs":1096,"durationMs":1434}

A Patchy Dev tab holding the only task the budget allows, so Brightline's server can't start ("execution.pool.wait":5000):

22:40:35.364 Patchy Dev's tab holds the only task
22:40:35.366 call: 200 after 5228 ms
  {"error":{"code":"busy","from":"patchy","message":"Brightline Studio's server is starting; try again in 15 seconds.","retryAfterSeconds":15}}
  event: {"companyBind":"launch","bindWaitMs":5003,"outcome":"refused","code":"busy","limitId":"execution.pool.wait"}
22:41:34.855 Patchy Dev released; a spare is ready
22:41:34.859 call: 200  {"companyBind":"spare","bindWaitMs":42}

Patchy Dev's patch is a copy of New Business published by the instance's dev key.

Release impact

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

Additive migration 0025_agent_idle: execution_bindings.agent_activity_at (default 0) and execution_binding_history.agent_only (nullable).

  • What does a revert leave behind? The two new columns, and bindings an agent claimed with last_activity_at = 0.
  • Does the release before it still work with that? Yes. It never reads the new columns. 0 is a valid last_activity_at to it, and its own idle_since step gives such a binding a fresh thirty minutes. idle_since keeps the meaning both releases give it, so a rollout or rollback keeps every document's window.

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:docs Touches the docs area size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood
allisonmahmood force-pushed the mcp/858-agent-idle branch 3 times, most recently from a33769f to fbc2de3 Compare October 22, 2026 22:35
@github-actions github-actions Bot added size:xl Over 1,000 changed lines; review in multiple passes and removed size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT-6.1-Sol (xhigh), four rounds

Round 1 (at eafd67a): 2 blocking, 2 should-fix. All fixed.

  • Blocking: a binding that replaced its predecessor during a deployment could be idle-released while the predecessor's admitted work was still running, losing that work's minute. Fixed: idleFence waits while any draining binding of the company is protected or held. Test: "runs the minute from a call that settles on a binding a deployment replaced while it ran".
  • Blocking: settlement let go of the binding before recording its clock, so a pass in between could fence. Fixed: the caller's clock runs while the call still holds the binding, then it unlocks, then protection clears. A warm call is six statements, not five. Test: "runs a settling call's minute before it lets go of the binding".
  • Should-fix: dropping idle_since lost a document's window across a rollout or a crashed holder. This was also the cause of a flaky existing test. Fixed: idle_since is restored for the documents' clock only. Agent work never sets or clears it, and agent-only bindings skip it. Test: "starts a document's thirty minutes no earlier than the first pass to find it gone".
  • Should-fix: acquire's retries restarted the 40 s wait and misreported refused waits. Fixed: one pool.wait deadline per admission, with event fields aggregated across tries.

Round 2 (at 4f1e15d): 1 blocking, 2 should-fix. All fixed.

  • Blocking: a failed clock update skipped the unlock, so the binding was held forever. Fixed: settlement always unlocks. Without its clock it keeps crash protection to the deadline. Test: "lets go of the binding when a settled call's clock can't be run".
  • Should-fix: in-flight agent work postponed a leaving tab's window. Fixed: the window starts at the first pass that finds no document, before any in-flight check. Test: "starts a tab's thirty minutes when it leaves, whatever agent work is in flight".
  • Should-fix: a settlement landing late could move a clock back. Fixed: clocks only move forward (GREATEST).
  • Flaky test (Fleet.test.ts:646): a TestClock jump while a call held its binding timed out the activity session's probe, and its reconnect freed the lock for a moment. Fixed in the tests: held calls are aged in SQL instead.
    • Accepted, not changed: in production this gap needs an agent call still in flight past its 65 s protection (only a quiet-query settlement tail can be), plus a session failure at that moment. The work still finishes; at worst the company binds afresh on the next call. Sol agreed in round 3 not to block on it.

Round 3 (at a33769f): 1 blocking, 1 should-fix. Both fixed.

  • Blocking: a settlement whose update waited on a fenced predecessor row missed the replacement committed meanwhile, since it is outside the statement's snapshot. Fixed: an update that finds no live binding runs once more with a fresh snapshot. Test: "runs a settling call's minute on the binding that replaced its own as it settled".
  • Should-fix: abandoned cold waits lost their bind telemetry. Fixed: recorded on any failed exit, interruption included.

Round 4 (at fbc2de3): no findings, nothing blocking.

Each new test was checked red against its regression and green with the fix.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked fbc2de39a86c63d604d361a1a41fbc9779c73463 (base 5d20897bd2dd136d8aaba31eeb5499fefeeb3eec, mcp/857-call-limits) on fresh brightline data, by GPT-6.1-Sol (xhigh) in the Codex harness through T3 Code. I did not author this change.

Done means

  • Periodic agent calls bind and release: passed. An independent local-fleet host used an 8 s agent window, 30 s document window, 500 ms housekeeping and a one-task budget. Three calls 25 s apart each returned all 17 deals and released a distinct binding after settlement:

    call 1: HTTP 200, 221 ms; released after 8,229 ms
    call 2: HTTP 200, 194 ms; released after 8,144 ms
    call 3: HTTP 200, 194 ms; released after 8,498 ms
    each: document clock = 0, idle_since = null, agentOnly = true, releaseCause = idle
    
  • A tab keeps its own clock: passed. Two open boards retained the company beyond the agent window. After both left, an agent call at +26.077 s changed neither the document clock nor idle_since. The binding remained active past the 30 s document window, then released at +34.443 s, 8.366 s after agent settlement, with agentOnly: false.

  • Cold bind and timed-out bind: passed. A call immediately after release succeeded with companyBind: "launch", bindWaitMs: 616 (817 ms HTTP round trip). With another company's real document holding the only task, both read_patch and change_patch waited 5,012 ms and returned:

    {"error":{"code":"busy","from":"patchy","message":"Brightline Studio's server is starting; try again in 15 seconds.","retryAfterSeconds":15}}

    Their events recorded companyBind: "launch", bindWaitMs: 5000, limitId: "execution.pool.wait". Sixteen concurrent bind waits retained all sixteen agent slots; the seventeenth was refused in 10 ms with a one-second retry. After capacity returned, reads succeeded, the mutation's previously refused key succeeded, and repeating it produced replayed: true.

Golden journeys

  • Use a tier 2 tool — passed. Jordan's agent invoked an action with a nested deal mutation. Jordan's and Allison's already-open boards both changed Lead/Discovery counts from 4/3 to 3/4 without reloading; moving back restored 4/3 on both. Neither browser reported console errors.
  • Spend's own-approval rule — passed. Allison opened his submitted sample request and clicked Approve. The page answered “You can't approve your own request.” and the request stayed Waiting.

Additional checks

Run serially at the head, with one Vitest worker:

pnpm exec vitest run packages/execution --maxWorkers=1
12 files, 141 tests passed

pnpm exec vitest run packages/runtime packages/mcp packages/analytics packages/limits apps/server --maxWorkers=1
53 files, 432 tests passed

These cover the exact default 60 s / 30 min boundaries, long in-flight work, settlement-before-unlock, failed clock updates, deployment replacement and snapshot races, abandoned waits, and nested admissions. The deadline test passed: a 30 s bind wait plus a 2.9 s process start succeeds; a 3.1 s process start times out. All current PR checks are green.

Rollback answers: match the diff. The migration adds two columns with compatible defaults; the predecessor ignores them and accepts agent-only rows with last_activity_at = 0, starting its existing document idle window. idle_since retains its meaning. No one-way label is required. The successful rollback rehearsal exercised live release → PR merge → live release → PR merge, including retained scenario data.

Not run

  • A literal five-minute polling / thirty-minute wall-clock run: live checks used the explicit shorter limits above; default boundaries were checked with TestClock.
  • Live ECS containment and a fresh Clerk run: local-fleet was used; the PR's Clerk CI job is green. Full CI was inspected rather than duplicating every suite locally.

Notes

  • The disposable environment's installed CLI could not resolve workerd/package.json for tier 2 bundle inspection. I supplied the checkout's pinned workerd dependency inside that disposable CLI install, then published successfully with the original CLI code. The PR changes neither this packaging path nor the dev runner. No global client configuration was edited.
  • Applied surfaces: execution/runtime admission, MCP refusal and replay, analytics, additive migration, generated limits and SDK skill documentation. No CLI flag, served HTML, resource-provisioning, or package-layout change required a separate journey.

@allisonmahmood allisonmahmood mentioned this pull request Oct 23, 2026
Base automatically changed from mcp/857-call-limits to main October 23, 2026 16:43
…nd waits for it to start

A company task now has two clocks. The documents' thirty minutes run from the
last document letting go or page work settling, as before, starting no earlier
than the first housekeeping pass to find no document holding the task; agents
never move them. An agent's call runs its own minute
(execution.company.agentIdle) from when it settles, nested work and cleanup
included, recorded before it lets go of the binding. The task is released once
no document holds it, no admitted work is in flight on it or on a binding of
the company still draining, and both clocks have run out.

A call on a released company waits for the bind inside its request, outside
the handler's deadline, for one execution.pool.wait across its tries; the
process start after it counts against the deadline. The door refuses a wait
past it as busy: "Acme's server is starting; try again in 15 seconds." A call's
event says how it found the server (bound, spare, launch) and how long it
waited; binding events say whether the binding was agent-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 933486f into main Oct 23, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the mcp/858-agent-idle branch October 23, 2026 16:58
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
…r 2 patches have agent areas (#894)

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

## What changed

A dev environment had only a builder agent, so trying a patch's agent
area meant hand-building a client config each time, and the
environment's own CLI couldn't publish a tier 2 repo at all. Now `pnpm
dev up` puts two worker agent launchers beside `agent`: `worker-claude`
(Claude Code, connecting through consent) and `worker-codex <person>`
(Codex, with a connection minted by `pnpm dev mcp-token`). Neither loads
your instructions, skills, plugins or config, and both reach Patchy only
through `/mcp`. `brightline` starts with agent access on, and New
Business and Spend Requests have agent areas that keep their rules.

Closes #859

## Look at

**1. The launchers' isolation**, in `scripts/dev/src/environment.ts`
(`writeWorkers`). Both start in the environment's own `workers/` folder
behind the builder's guard (`PATCHY_API_URL` is the instance, the
shell's `PATCHY_API_TOKEN` is cleared) with a CLI state that never logs
in and a temp folder per session.

- **Claude Code**: `--setting-sources project`, the builder's
`claudeMdExcludes` for every folder above the environment,
`--strict-mcp-config` with one server, auto memory off,
`--permission-mode default`. Its sign-in can only live in your
`~/.claude/.credentials.json`, keyed by the server's name and address,
so the server name is `patchy-dev-<hash of the worktree path>`: one
entry per worktree address, replaced by the next sign-in there. `down`
leaves it, because your running Claude Code sessions rewrite that file
when they refresh and a second writer could drop a refresh and sign you
out. DEVELOPMENT says so and how to clear it (`/mcp` › Clear
authentication).
- **Codex**: `CODEX_HOME` is the environment's, with a `config.toml`
naming only the door and turning off the account's `apps`, `plugins` and
`remote_plugin` (without that, the TUI listed my ChatGPT connectors, 217
tools, and a plugin from my account). `HOME` is the session's temp
folder, because Codex reads skills from `~/.agents/skills` whatever
`CODEX_HOME` says. Your login is linked in; Codex writes `auth.json` in
place through the link (checked with `codex login --with-api-key` on a
throwaway home), so a refresh lands in your one file as another
session's would. The token reaches Codex's environment only: the config
excludes `PATCHY_MCP_TOKEN` from the commands Codex runs and turns shell
snapshots off (Sol's round 1 found both leaking it; a command inside
Codex printed `env | grep -c '^PATCHY_MCP_TOKEN='` → 1 before, 0 after,
with no snapshot under `CODEX_HOME`).

What Codex sees, from `worker-codex jordan debug prompt-input`, which
renders the model's prompt without a model call:

```text
skill roots: ['<env>/worker-state/codex/skills/.system']
"agents/skills": 0   "~/.codex": 0   personal instructions: 0   token: 0
```

What the Claude worker reports, `worker-claude -p --model haiku`:

```text
skills:        dataviz, update-config, keybindings-help, code-review, simplify, … (Claude Code's bundled ones; its code-review is the bundled one, not mine)
instructions:  NONE
MCP servers:   patchy-dev-04bc0n
```

**2. The env CLI publishes tier 2**, a separate commit (`fix(cli)`). The
CLI resolved workerd beside its own install, so the environment's
`bin/patchy` (and any global `patchy`) failed every tier 2 publish and
`patchy dev`. A tier 2 repo pins the exact workerd the CLI checks for,
so publish and the dev runtime now run the repo's own, as they already
run its vite and tsc. `startWorkerd`/`Inspection` take an optional
`workerdFrom`; the server never passes it.

```console
# before (base), in <env>/workspace/new-business
$ patchy publish --json
{"ok":false,"error":"Could not inspect the server bundle. Its modules must load and export only valid handlers.","kind":"local","code":"invalid_manifest"}
# after
$ patchy publish --json
{"ok":true, …, "versionNumber":2, "warnings":[]}
$ patchy dev --json        → {"ok":true,"url":"http://127.0.0.1:<port>/dev/…"}
$ patchy dev agent listRequests '{"status":"submitted"}' --json
{"result":{"total":0,"requests":[]},"version":1}
```

**3. brightline's agent areas** reuse the patches' rules rather than
restating them: `move`, `addNote`, `team.people`, `approve` and `reject`
are re-exported from `server/` with descriptions added there; `addLead`
and `submitRequest` are tools of their own, with the shared insert moved
to `helpers/leads.ts` and `helpers/requests.ts`. `addLead` requires a
next step, which the page leaves optional; `submitRequest` takes no
receipt, so the patch's own `receipt_required` stops anything from $500.
`listDeals` and `listRequests` answer 50 at a time with `total` and
`next`, which `from` continues (checked with 55 requests: 50 + `next`
50, then 5 + `next` null). The seed turns agent access on as the
publisher only while nobody has touched the switch, so turning it off at
Company survives restarts.

<details><summary>Done means: Codex adds a lead to New Business through
<code>/mcp</code></summary>

`pnpm dev up brightline`, then `<env>/worker-codex jordan exec
--skip-git-repo-check --json -c '…change_patch.approval_mode="approve"'
"Add a lead to New Business: Lumen Labs wants a website refresh, a
referral from their CEO. Next step: intro call on Tuesday. Leave the
value and owner empty." < /dev/null`. Results cut.

```text
agent: I'll find New Business and add Lumen Labs with the referral and next step, leaving value and owner empty.
find_patches {"search":"New Business"}  → {"actingFor":{"person":"Jordan Lee","company":"Brightline Studio"},"total":1,"patches":[{"name":"new-business",…,"tools":["addLead","addNote",…]}]}
open_patch {"patch":"new-business"}     → {"name":"new-business",…,"tools":[{"name":"addLead","kind":"change",…}]}
change_patch {"patch":"new-business","tool":"addLead","key":"lumen-labs-website-refresh-20261023",
  "args":{"title":"Website refresh","client":"Lumen Labs","source":"Referral","service":"Website","nextStep":"Intro call on Tuesday"}}
                                        → {"result":{"id":"01a165b6-…","stage":"lead","owner":null,"value":null,…},"version":2}
change_patch {"tool":"addNote","args":{"deal":"01a165b6-…","note":"Referral from Lumen Labs' CEO."}} → {"result":{…,"kind":"note"},"version":2}
agent: Added Lumen Labs — Website refresh to New Business as a lead, with a CEO referral note and "Intro call on Tuesday" as the next step. Value and owner are empty.
```

The patch's log, as its owner (`patchy logs --limit 2` in the repo):

```text
… · v2 · agent.addNote (mutation) · success · 84 ms · Jordan Lee via Codex
… · v2 · agent.addLead (mutation) · success · 471 ms · Jordan Lee via Codex
```

A patch rule, met through the door (Codex as Jordan, "move the Lumen
Labs website refresh to Proposal"):

```text
change_patch {"tool":"moveDeal","args":{"deal":"01a165b6-…","stage":"proposal"}}
  → {"code":"needs_value_and_owner","from":"patch","details":{"stage":"proposal","missing":["value","owner"]}}
```

Interactive too: `worker-codex marcus`, then "Which deals are in
Negotiation in New Business?" called `find_patches`, `open_patch` and
`read_patch`, and `/mcp` listed only `patchy-dev-04bc0n` and Codex's
built-in `codex_worktrees`.

</details>

<details><summary>Done means: the Claude Code launcher connects through
consent</summary>

`<env>/worker-claude --model haiku` in a terminal, `/mcp` ›
`patchy-dev-04bc0n` › Authenticate. Its browser URL was answered as
Jordan in a throwaway Playwright browser (personas sign-in, then Allow):

![Consent as
Jordan](https://github.com/user-attachments/assets/52c03b72-6699-44b2-8dae-dfab0f5dcc6b)

```text
❯ /mcp
  ⎿  Authentication successful. Connected to patchy-dev-04bc0n.
❯ In Spend Requests, which requests are waiting for a decision? Approve the smallest one that someone else submitted, with the note: fine by me.
  (Claude Code asked before each call; each answered Yes)
  find_patches {search: "Spend Requests", detail: "tools"} · open_patch {patch: "spend"} · read_patch {tool: "listRequests"}
  change_patch {tool: "approveRequest", args: {id: "01a165b0-…", note: "fine by me"}, key: "approve-saltwater-hotel-priya-2026-10-23"}
● I approved the smallest pending request that someone else submitted: Priya Shah's hotel for the Saltwater site visit (2 nights), $438.20, with the note "fine by me."
  … I skipped the two you submitted yourself (the $2,850 photographer and the $1,800 copywriter), since approving your own request isn't allowed.
```

</details>

## How it was verified

- **Neither launcher reads your instructions or touches `~/Patchy`.**
Over all the runs above: `~/Patchy`'s listing is unchanged;
`~/.codex/config.toml` and `~/.codex/AGENTS.md` hash the same and
`~/.claude/settings.json` and `~/.claude/CLAUDE.md` keep their mtimes;
no token-shaped string (`pw[ar]_…`) appears anywhere in the environment
folder or `.local/dev`, `dev.log` included; no Codex or Claude process
with the environment's paths outlived its session. What the runs did add
outside the environment: Claude Code's `patchy-dev-04bc0n` sign-in in
`~/.claude/.credentials.json`, and its trust of `<env>/workers` in
`~/.claude.json`, both Claude Code's own writes.
- `scripts/dev/src/environment.test.ts`: the Claude launcher's guard,
worker CLI state, its one server and the excludes; the Codex launcher
mints for the named person in this worktree, hands the token only to
Codex (the launcher prints nothing of it), runs on its own `CODEX_HOME`
and `HOME`, links your login, drops a stale link when you have none and
leaves the login alone when started from a shell already on that home,
writes the door, the apps/plugins switches, the snapshot switch and the
token's shell exclusion into `config.toml`, and starts no Codex when
minting fails.
- `scripts/dev/src/scenario.test.ts`: seeding brightline turns agent
access on as the publisher, and a later off survives a reseed. Red
without each half of the seed change.
- `packages/execution/src/Inspection.test.ts`: inspection runs the
workerd where it's told, and refuses one of another version found there.
Red with the resolver reverted.
- Both agent areas typecheck and publish with no warnings; their 9 tools
are listed in publish's `handlers`.
- `pnpm verify` on 33b5445: everything passed except
`test/browser-tier1/csv.spec.ts` (instance-side inspection timed out at
load ~15); it passed alone, and CI's `browser` job passed on the same
head.
- Targeted: `vitest run scripts/dev
packages/execution/src/Inspection.test.ts
packages/patchy/src/devServerWatch.test.ts`, 104 passed; turbo typecheck
of execution, the CLI and the dev runner; `tsc -p tsconfig.test.json`;
eslint and prettier on the changed files.
- Not exercised: Claude Code's own consent in a real browser of yours
(Playwright answered it), and macOS.
- The vitest template is unchanged: it applies `applyDevSeed`, which
this doesn't touch; the scenario seed isn't part of it.

## Release impact

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

Dev tooling, scenario data and docs, plus one CLI fix: a `patchy`
installed outside a tier 2 repo now builds it with the repo's pinned
workerd instead of failing. No schema, API or wire change.

- **What does a revert leave behind?** Environments already up keep the
worker launchers until their next `up`; Claude Code sign-ins already
made stay in that developer's credentials file, harmless. A global CLI
goes back to refusing tier 2 repos.
- **Does the release before it still work with that?** Yes. Nothing it
reads changes.

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:docs Touches the docs area area:server Touches the server area size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An agent's call keeps its company's server for a minute, and waits for it to start

1 participant