Repository navigation
feat(cli): patchy request and patchy feedback - #1218
Conversation
a531081 to
db1f7e9
Compare
b4f5880 to
cc511db
Compare
db1f7e9 to
89037f8
Compare
cc511db to
75e1f05
Compare
89037f8 to
9a2d5cb
Compare
75e1f05 to
77631b6
Compare
9a2d5cb to
7c3a02e
Compare
Acceptance: PASS with notesChecked CI still pending after the approximately 30-minute wait: Pidgeon and its dependent final gate must finish before merge. Rebase: passed. Range-diff evidenceRetained independent evidence The following evidence is carried forward from comment 6795627896, checked at Prior Done means, risks, focused checks and golden journeys — retained verbatimDone means
Exit codes and send safety: passed again The secret refusal did not echo the value. JSON successes were one stdout document with empty stderr; JSON failures were one stderr document with empty stdout. The dropped send made exactly one API call and warned it may have been stored, directing the agent to Three focused suites passed under Node 24, one worker: These are the complete Golden journeys
Rollback answers: The answers match the diff. This layer adds commands and skill text, with no migration or new stored shape. Revert leaves submissions in #1217’s schema, still usable by the preceding stack release. No Current rollback check: passed; log read. Job 130523496189 reports “No migration or handler descriptor changed, so there is no rollback to rehearse.” This is the expected gate for this layer, not a separate full rehearsal. The inherited feedback migration’s four-stage rehearsal passed on #1217 at CI on the checked head Snapshot 2026-11-11 13:00 UTC: 22 passed, 2 skipped, 0 failed, 1 unfinished (25 reported checks). All results belong to the checked head. Passed: CI re-verification remains incomplete at the approximately 30-minute wait limit. Earlier behavioral evidence is retained; these unfinished checks have no passing result on this head. The PR still needs its pending checks before merge.
Skipped (not counted as passed):
The current-head Node 24 log reports 316 suites passed; 3,483 tests passed, 3 skipped, including the 18 CLI-feedback, 13 feedback-service and one skill-lock tests (32 focused tests). These are new-head CI results, separate from the retained manual CLI evidence. Not run
Notes
No code, branch, PR body or labels were changed, and nothing was pushed or merged. No local instance was started; production and the personal CLI state were not accessed. |
`patchy request "<text>" [--why]` files a request with Patchy's team and exits 0 with its id and similar requests, each with the exact link command, and `next`. `request link|unlink|list|withdraw` and `feedback "<text>"`, `feedback list|withdraw` cover the rest of the feedback group's routes. Inside a published repo a send names its patch. An instance from before requests answers their routes with the API's catch-all 404, which these commands report as exit 2. A send whose answer is lost stays exit 3 and says to check `list` before sending again; the CLI never resends. `request` and `feedback` join `CliCommand`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The commands, their `--json` shapes, refusals, the exit 3 note and both directions of version skew. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The global skill's Requests and feedback section says where submissions go, when to request and when to send feedback, once per problem, and what to leave out. Its description gains the intent so the skill loads for it. patchy-loop points to the section, or to the package's bundled copy where the global skill isn't installed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A local port probe's stray `GET /` can land in a stub instance's request log, so these tests look only at `/api/` requests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…chy/api `SUBMISSION_TITLE_MIN`, `SUBMISSION_TITLE_MAX` and `SUBMISSION_TEXT_MAX` move from the service to the wire package, so the CLI checks the same bounds before sending without bundling server code. `SubmissionId` names the shape the store mints for request and feedback ids, and a store test pins minted ids to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and read unreadable refusals as no answer - A match's `link` command quotes each id as one POSIX shell word, so an operator-written general request id can't split it into two commands. - A declared refusal status whose body doesn't decode is exit 3, with the list-before-resending message on a send, not a refusal. Only that combined cause counts; an undeclared status still reads by its code. - Every text is checked against the store's bounds before sending, exit 1. stdin is decoded as strict UTF-8 and reading stops once past the bound. - Path ids must be of the shape the store mints, so a code-less 404 means the routes are missing; that refusal no longer names a release. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An undeclared status, such as an empty 403 from a proxy, carries no decode failure, so it read as the instance's refusal, exit 2. On a send, any answer that isn't a decoded refusal is now exit 3 with the storage warning. Decoded refusals, the missing-routes 404 and every other command are unchanged. The stdin bound test now feeds one character past the bound into a stdin it leaves open, so a CLI that reads further, or waits for the end, fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7c3a02e to
ee0d40a
Compare
|
Landing note: |
…he CLI's do #1218 moved the submission bounds into @patchy/api, so the CLI checks them before sending; the panel's title split reads them there too. The product says the CLI is built. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1218 moved the request and feedback bounds into @patchy/api; the tool's input schema now reads them there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stacked on #1218; merge after it. ## What changed An agent that hits a real Patchy fault rarely goes looking for a feedback command, so the failure itself now says one exists. After an answer the CLI couldn't use, such as an unmodelled 5xx or an unreadable body, or after an `Unexpected error`, the CLI adds one line: ``` If Patchy got this wrong, tell Patchy's team: patchy feedback "<what you ran and what happened>" ``` Under `--json`, the same line goes in the failure document as `feedbackHint`, so stderr still holds exactly one document. Network failures (including a reply cut off mid-body), refusals (exit 2), local mistakes (exit 1), sign-in states and failures of `patchy feedback` itself carry no hint. Those are things the agent should fix itself, and hinting on them would flood the channel. To tell those cases apart, `UnreachableError` now records why it happened, at the point where it's created: `transport`, `response` or `decode`. Exit codes don't change. Closes #1213 Part of #1210. ## Look at **1. An instance 500, before and after.** The output is the real bundled CLI's, run against a stub that answers 500. The "before" is the exact stderr that main's exit-code ladder test asserts. Before: ``` $ patchy whoami <instance> answered 500. Try again later, or tell the operator. exit 3 ``` After: ``` $ patchy whoami <instance> answered 500. Try again later, or tell the operator. If Patchy got this wrong, tell Patchy's team: patchy feedback "<what you ran and what happened>" exit 3 $ patchy whoami --json {"ok":false,"error":"<instance> answered 500. Try again later, or tell the operator.","kind":"unreachable","feedbackHint":"If Patchy got this wrong, tell Patchy's team: patchy feedback \"<what you ran and what happened>\""} exit 3 ``` These don't change: ``` $ patchy whoami --json # the instance refuses with a 409 {"ok":false,"error":"<instance> answered 409.","kind":"rejected"} exit 2 $ patchy whoami --api-url http://patchy.invalid --json {"ok":false,"error":"http://patchy.invalid could not be reached.\nCheck the address and your network connection, then run the same command again.","kind":"unreachable"} exit 3 $ patchy whoami --json # 200 headers, then the socket drops mid-body {"ok":false,"error":"<instance> answered 200. Try again later, or tell the operator.","kind":"unreachable"} exit 3 ``` **2. How each `UnreachableError` site is classified.** Every site that creates one: | Site | What happened | Reason | Hint | | --- | --- | --- | --- | | `Api.classify`, `SchemaError` | the body failed the wire schema | `decode` | yes | | `Api.classify`, `TransportError` | DNS, connect | `transport` | no | | `Api.classify`, other responses that aren't 4xx | a status nothing describes, including the generated client's fallback for an undeclared status such as a 500 | `response` | yes | | | a body that stopped arriving, including a declared refusal status's | `transport` | no | | | a 2xx body that arrived and couldn't be read | `decode` | yes | | `Login.poll`, wait budget | no answer before the deadline | `transport` | no | | `Project.add`, `inventory: null` | the instance answered, but its company database was unavailable (`source_unavailable`) | `response` | yes | | `Project.installedFailure` | relays the installed CLI's failure document, which doesn't say why | `response` if the document carries `feedbackHint`, else `transport`. Its hinted `Unexpected error` stays a `LocalError` marked `unexpected`, exit 1 | as the installed CLI decided | | `Dev.agent` | the local dev runtime gave no usable answer | from the client error, as in `Api.classify` | 5xx or unreadable: yes | | `submissionFailure` (#1218) | a declared refusal status whose body arrived but doesn't decode, which #1218 treats as no answer | `decode` | `request`: yes; `feedback`: never | | | a declared refusal status whose body was cut off mid-stream | `transport` | no | | | on a send, an undeclared refusal status the CLI couldn't decode, such as an empty 403 | `response`, or `transport` if its body was cut off | `request`: yes; `feedback`: never | | | rewrites any other `request` or `feedback` send's exit-3 message to say it may have been stored | keeps the reason of the failure it rewrites | `request`: as classified; `feedback`: never | `unreachableReason` switches exhaustively over Effect's six `HttpClientError` reasons, so a reason Effect adds later fails typecheck. Effect reports two different things as a `DecodeError`, and the function tells them apart: - A body read that fails with the connection's error, rather than a `SyntaxError`, is `transport`. That check is `bodyCutOff`. For a declared refusal status, the generated client fails with the status first and the body's failure after it, and `Effect.catch` hands `classify` only the first. So the CLI's client (`cutOffFirst`, passed through `makeClient`'s new `transformResponse`) puts a body that stopped arriving first in the cause. `classify` and `submissionFailure` both read that first error; neither scans the cause itself. - The generated client's fallback for an undeclared status is `response`, read from the status. A request that couldn't be built (`EncodeError`, `InvalidUrlError`) was never answered, so it maps to `transport`. **3. How `patchy feedback`'s own failures are suppressed.** The check keys off the running command's name, `Api.CurrentCommand`. That's the same name the `patchy-cli` header records, and #1218 registers `feedback` and `request` with `withCommandHeader` like every other command. The check lives in `unhintedCommands` in `Output.ts`, a `ReadonlySet<Api.CurrentCommand["Service"]>` holding `feedback`, so its subcommands (`list`, `withdraw`) are covered too. A 500 on `patchy request` still offers the hint. A broken request route is a Patchy fault, and `feedback` is the channel that reports it. If `feedback` is down too, its own failure stays quiet, so an agent that tries it costs at most one call. **4. The skills.** The failure-document summaries in the global `patchy` skill and in `patchy-loop` now list `feedbackHint` and say when it appears. `skills-lock.json` carries the new hash. ## How it was verified - **`Api.undici.test.ts` (new, Node only like the other undici suites)** records the reason for each case, using the real generated client over the CLI's undici against a local server: - an undeclared 500 is `response`; - a 2xx body that isn't JSON, or has the wrong shape, is `decode`; - a 200 whose socket drops mid-body is `transport`. Removing the cause rule fails the cut-off case, and removing the status rule fails the 500. - **`Output.test.ts` (new)** tests the contract in-process, with one case per path. The hint follows an unmodelled 5xx, an unreadable body, an `Unexpected error` and the installed CLI's relayed one, each exactly once, in text mode and as `feedbackHint`. It never follows no answer at all, a `name_taken` refusal, a local mistake, or a failure (5xx or defect) of `patchy feedback` itself. Two mutations were checked: forcing the hint onto `transport` fails "never follows no answer at all", and ignoring the command name fails the `feedback` case. - **The exit-code ladder in `cli.test.ts`** runs the bundled CLI. A 503 prints the hint once in text and `--json` carries `feedbackHint`. A garbled 200 carries it too. Nothing listening, `patchy.invalid` failing DNS, and a body cut off mid-stream carry none. The cut-off cases are a 200 on `whoami`, and a declared 503 on `patchy list some-patch tasks`, whose body the client reads. Without `cutOffFirst` the 503 case fails, and so does `cliFeedback`'s cut-off 422. The existing exit-1 (`validate`) and exit-2 (rejected key) cases still assert their exact output, with no hint. - **`cliRepo.test.ts`** covers the relay. A 503 on generation, which runs in the installed CLI, comes back with the hint, while a dropped connection on the same route, a 401 and a 403 come back without it. Hardcoding the relay to `transport` fails the 503 case. A stand-in installed CLI that crashes with a hinted `Unexpected error` comes back from `refresh` as exit 1, still carrying `feedbackHint`; without the relay fix it loses the hint. - **`cliFeedback.test.ts`** runs the built CLI's real commands against a stub. - **On a 500:** `patchy request` prints the hint after its "may have been stored" message, and its `--json` carries `feedbackHint`. `patchy feedback` and `patchy feedback list` carry no hint in text or `--json`. - **On a declared 422 whose body isn't JSON:** `patchy request` exits 3 with the hint in text and `--json`. - **On a declared 422 whose headers arrive and whose body is then cut off:** `patchy request` exits 3 with the storage warning and no hint. - **On an empty undeclared 403 (#1218's case):** the `request` send now also carries `feedbackHint`. - **Mutation checks:** emptying `unhintedCommands` fails the test, recording the unreadable refusal as `transport` fails it, and so does removing the `bodyCutOff` check, which prints the hint after the cut-off 422. - **#1218's exit-1 local checks** (text bounds, id shape, UTF-8 on stdin) are plain `LocalError`s and print no hint. Run by hand against the built CLI, each exits 1 with no hint in text or `--json`, `patchy request` included. - **`cliDevAgent.test.ts`**: the dev runtime's 500 and its garbled 200 carry the hint. - **`Login.test.ts`**: the login wait timeout, a sign-in state that exits 3, is `transport`, so it gets no hint. - **`pnpm check` at this head** passes format, lint, typecheck and synth. Its test stage passes every suite this PR touches, `cliFeedback` and the skillLock test. The rest fails only in the shared-machine ways described below. Every conflict across the rebases onto #1218 was in the CLI (`submissionFailure` and `cliFeedback.test.ts`), so `pnpm verify` last ran before them, at this PR's review fixes. - **`pnpm verify`, run locally at the review fixes.** Format, lint, typecheck, synth, postgres-concurrency, tier2-smoke and browser pass. On the bun stage, the classify cases came back `transport` because Bun has no undici dispatcher, so they moved into the Node-only `Api.undici.test.ts`. Rerun after the move, every bun suite passes except two under full-suite load, both of which pass alone: - `RequestEvents` (server, passes alone on Bun and Node); - `Supervisor` (execution). It, `Engine` and `LocalTaskProvider`, which failed under load in earlier runs, pass 53/53 alone. The other failures come from this shared machine, not the change: - Another local process sends a stray `GET /` to the CLI suites' stub servers. Each run, that breaks a different request-log assertion in `cliPublish`, `cliLifecycle`, `cliLook` and `cliRepoRecovery`, and three bodiless-request parses in `devExecution`. The same files fail the same way on `main`. Each failure passes on a rerun. - The installer checks (`packages/sdk` install tests, the `install` stage and the last step of `cli-smoke`) need `npm` beside the running Node, and this machine's system Node 26 has none. All three pass under Node 24. CI is the authority on both. ## Review GPT 6.1 Sol reviewed this PR at xhigh, three times. - **First pass (ab85634): three findings, all fixed.** 1. A body cut off mid-stream offered feedback. It's now `transport`. 2. The installed CLI's relayed `Unexpected error` lost its hint. It now keeps the hint, still exit 1. 3. A real 500 was recorded as `decode`. It's now `response`. A fourth, the skill summaries missing `feedbackHint`, waited for the rebase onto #1218 and is fixed. - **Second pass (13fd67f): one finding, fixed.** A declared 503 whose body was cut off still offered feedback, because `classify` saw only the status. The client now puts a cut-off body first in the cause, as described under Look at. - **Third pass (520fa1a): one finding, dismissed.** An *undeclared* 5xx whose body is cut off still offers feedback, because Effect rejects an undeclared status from its headers without reading the body. That's intended. An unmodelled 5xx is the case the hint is for (#1213: "on response failures, meaning an unmodelled 5xx"): the status line already says Patchy failed, whether or not its body arrived whole. Detecting the truncation would mean reading every error body for no change in what the agent should do. The same pass found `makeClient` has one caller, the CLI, and that `409 name_taken` refusals, SIGTERM → 130, and single sends are unchanged. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The change is additive. Text-mode stderr gains one line after unexpected failures; ADR-0004 already says line count isn't the contract. The `--json` failure document gains an optional `feedbackHint`. `makeClient` in `@patchy/api` gains an optional `transformResponse` argument, which only the CLI passes. Exit codes, `kind`, `code` and every other field stay the same. The README and ADR-0004 document the field. - **What does a revert leave behind?** Nothing: there's no state, schema or stored data. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…he CLI's do #1218 moved the submission bounds into @patchy/api, so the CLI checks them before sending; the panel's title split reads them there too. The product says the CLI is built. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1218 moved the request and feedback bounds into @patchy/api; the tool's input schema now reads them there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1218 moved the request and feedback bounds into @patchy/api; the tool's input schema now reads them there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stacked on #1227, the dashboard's `/feedback` page, so Patchy MCP never ships ahead of the page every answer links. ## What changed People's own agents reach Patchy only through Patchy MCP, and never load the `patchy` skill. The door could send a patch's missing tool to its owner, but a missing Patchy capability, or a Patchy fault, had nowhere to go. The door gains a fifth fixed tool, `tell_patchy { kind: "request" | "feedback", text, why? }`. It sends Patchy's team a request or feedback as the connection's person, through #1211's `Feedback` service, with surface `mcp` and the client name the person approved as the agent. Every answer links the person's page at `<instance>/feedback`, where they see or withdraw what their agent sent. The door's instructions name the tool, and the consent page says an agent can do this. Closes #1214 Part of #1210 **How it works** - **One tool, not two.** A request is something Patchy can't do; feedback is something it does wrongly or confusingly. The description says "feature request" and "feedback" in those words, because clients that load tools on demand search by text. It says a patch's own missing tool still goes to the patch's owner. It lists what to leave out: keys and tokens, connection strings, rows, file contents, other people's personal details and pasted logs. - **Results.** A request answers `{ id, similar, next, url }`, with up to three `{ id, title, status, note? }`. Feedback answers `{ id, next, url }`. `next` names no CLI command and no linking. When a match has shipped, it says to tell the person using its note. It always says they can see or withdraw what was sent at `url`. `url` is the public origin the door already reads (`PATCHY_PUBLIC_BASE_URL`) plus `/feedback`. - **`why` on feedback is refused, not ignored.** The store keeps exactly what was sent, so dropping a reason the agent wrote would quietly lose it. A blank `why` counts as none, as the service treats it. - **Admission.** It passes the same door gates as the other four: the `work` bearer, the person's requests a minute, and the `agent_access_off` refusal while access is off. It reads no patch, passes no patch's admission and mints no token. The service spends its own `feedback.sends.perMinute`. - **Refusals** are tool results with the store's codes, each saying what to rewrite: `invalid_text` with `details: { field }`, `contains_secret` with `details: { secrets: [{ field, kind }] }` (never the value), and `rate_limited` with `retryAfterSeconds`. A `text` too long for a request's title says a request's text is one line and the rest goes in `why`. - **Annotations:** not read-only, not idempotent and not destructive, since sending only adds a submission. With `destructiveHint` left out, the MCP default would mark it destructive. - **Instructions** now end "Send what Patchy itself lacks or gets wrong to tell_patchy." The earlier sentences were trimmed so that, with the person and company each cut at 64 characters, the worst case is 505 characters. A test holds that bound below 512. ## Look at **A worker agent on a local instance** (`pnpm dev up brightline`, Jordan via a Claude Code connection from `pnpm dev mcp-token`, a shipped general request written with psql as OPERATIONS.md shows): ``` $ modern server/discover → instructions You act for Jordan Lee at Brightline Studio through Patchy, where company tools are patches. find_patches lists those they can open, open_patch shows one's tools, read_patch runs a read and change_patch a change. You reach only tools builders added for agents; if one is missing, name the patch's owner. Every change is logged as them, via you. Send what Patchy itself lacks or gets wrong to tell_patchy. $ tools/call tell_patchy {"kind":"request","text":"Attio integration for our deal tracker","why":"Sales keeps every deal in Attio"} { "id": "req_sia8s0buut22bzb0hryx1qij", "similar": [ { "id": "gen_e82078e3d2c0479a8b9a1d38", "title": "Attio CRM integration", "status": "shipped", "note": "Connect Attio on Integrations; a patch reads its records through uses." } ], "next": "Patchy's team has this request, sent as the person you act for. A similar request has shipped: tell the person, using its note. They can see or withdraw it at http://<instance>/feedback.", "url": "http://<instance>/feedback" } $ tools/call tell_patchy {"kind":"feedback","text":"open_patch said New Business changed, but nobody had published since my last call."} { "id": "fbk_ajxhjme90jvae7aaqj5fvtxb", "next": "Patchy's team has this feedback, sent as the person you act for. They can see or withdraw it at http://<instance>/feedback.", "url": "http://<instance>/feedback" } $ legacy (2025-06-18) tools/call tell_patchy, with a GitHub token in the text {"content":[{"type":"text","text":"Nothing was stored: `text` holds a GitHub token. Remove it, or replace it with <token>, and send it again."}], "structuredContent":{"error":{"code":"contains_secret","from":"patchy","message":"Nothing was stored: `text` holds a GitHub token. Remove it, or replace it with <token>, and send it again.","details":{"secrets":[{"field":"text","kind":"github_token"}]}}},"isError":true} ``` Both submissions were stored as Jordan, via the connection's client. The door's request events carry the submission's id and the two limits it spent. A grep of the dev log for the why, the feedback text and the token finds none of them. ``` id | kind | person | surface | agent | why ------------------------------+----------+------------+---------+-------------+--------------------------------- req_sia8s0buut22bzb0hryx1qij | request | Jordan Lee | mcp | Claude Code | Sales keeps every deal in Attio fbk_ajxhjme90jvae7aaqj5fvtxb | feedback | Jordan Lee | mcp | Claude Code | {"route":"/mcp","status":200,"outcome":"success","mcpTool":"tell_patchy","submissionId":"req_sia8s0buut22bzb0hryx1qij","protocolEra":"modern","clientName":"Claude Code","limits":["mcp.requests.perMinute peak 3","feedback.sends.perMinute peak 1"]} {"route":"/mcp","status":200,"outcome":"refused","code":"contains_secret","mcpTool":"tell_patchy","protocolEra":"legacy","clientName":"Claude Code"} ``` <details><summary>The tool as <code>tools/list</code> shows it</summary> ```json { "name": "tell_patchy", "title": "Tell Patchy", "description": "Send Patchy's team a feature request or feedback about Patchy itself, as the person you act for: a request when Patchy can't do something, such as an integration or capability they need; feedback when it does, but wrongly or confusingly, such as a refusal that made no sense. A patch's own missing tool goes to the patch's owner, not here. Send each once. Leave out keys and tokens, connection strings, rows, file contents, other people's personal details and pasted logs; a credential is refused. A request answers similar ones with their status, and a shipped one's note says how to use it.", "inputSchema": { "type": "object", "properties": { "kind": { "type": "string", "enum": ["request", "feedback"], "description": "request: Patchy can't do it. feedback: it does, but wrongly or confusingly." }, "text": { "type": "string", "minLength": 1, "maxLength": 4000, "description": "For a request, its title: one line saying what Patchy should do, 3–200 characters. For feedback, what happened and what you expected, up to 4,000." }, "why": { "type": "string", "maxLength": 4000, "description": "A request's reason: what the person is trying to do and why it matters. Requests only: feedback with a why is refused, so put everything in its text." } }, "required": ["kind", "text"], "additionalProperties": false }, "annotations": { "readOnlyHint": false, "destructiveHint": false, "idempotentHint": false } } ``` </details> **The consent page** gains one line in what the agent can do: "It can send requests and feedback to Patchy’s team". The screenshots this PR carried showed the consent page before the UI overhaul (#1332–#1354); the line now sits in the overhauled page's `canList`, and here it is at this head, from the acceptance run:  ## How it was verified - **Tests** (`packages/mcp`, 77 pass; `packages/auth`'s consent test): ``` ✓ Tell.test.ts > tell_patchy > sends a request as the person via the connection's client, answering its matches and their page ✓ Tell.test.ts > tell_patchy > sends feedback as the person, answering its id and their page, where both show ✓ Tell.test.ts > tell_patchy > refuses with the service's codes, saying what to rewrite, and stores nothing ✓ Tell.test.ts > tell_patchy > is listed and called on every revision the door serves ✓ Door.test.ts > the door > lists the same five tools for everyone, read_patch read-only and change_patch destructive ✓ Door.test.ts > the door > keeps the instructions under 512 characters with the longest name and company ✓ Door.test.ts > the door > refuses every tool call while agent access is off, naming the admins and nothing else ✓ OAuthEndpoints.test.ts > asks who meets whom, what the agent can and can't do, and where the answer goes ``` The revisions test lists and calls `tell_patchy` on 2026-07-28's per-request envelope, then on 2025-11-25 and 2025-06-18. The access-off test now includes `tell_patchy` and checks that nothing was stored. "Both show" reads the person's own list through `Feedback.list`, the list the dashboard's page shows. - **`pnpm verify`** (Node 24, as CI runs it): format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser passed. `test` and `test (bun)` failed only in files this PR doesn't touch, under load from other worktrees. The CLI's stub-server files failed on a stray local `GET /` in their request logs; `cliLook.test.ts` passes alone. The PGlite files (`Tables`, `PgliteCompanyDatabases`, the Postgres dev fixture), `LocalTaskProvider` and `RequestEvents` timed out or counted a stray request, and pass alone, `RequestEvents` 12/12 in the bun lane's config as well. After rebasing onto #1227 (one conflict, the status sentence in `docs/product.md` › Requests and feedback, which now names the store, the dashboard and this door as built), `packages/mcp` passed again (77). - **Rebased 2026-11-11** onto #1227 after the store and the CLI merged and main took the UI overhaul. Two conflicts: the consent line moved into the new consent page's list, and `docs/product.md`'s status line now names every door as built. One new commit reads `tell_patchy`'s bounds from `@patchy/api`, where #1218 moved them. After it: `packages/mcp` 77, the consent test 21 and `packages/api` 64 pass, with lint and typecheck. - **Not checked:** a real worker agent choosing the tool on its own. The local Codex worker couldn't run because this machine's Codex login had expired, and the Claude worker signs in through a person's browser. The `/feedback` link is the dashboard's page from #1227, which this stacks on. **Hit every surface.** These applied: - **The wire contract**: the door's tool list, results and refusals, with `docs/API.md` › Agent tools re-rendered from `packages/api/src/markdown.ts`. The MCP protocol dates are unchanged. - **Vocabulary and product shape**: `packages/mcp/GLOSSARY.md` (five fixed tools, sends through Feedback), the Patchy MCP lines in `GLOSSARY-MAP.md` (its context and its relationship, which gains Feedback), `docs/product.md` › Patchy MCP (what an agent reaches, confirmation, what a client learns first, the tools, bounds, consent) and › Requests and feedback, and ADR-0014, which named four tools. Also the count in the README, Analytics' glossary and the wide event's comment, and Publishing's glossary. - **Served pages**: the consent page's one new row in an existing list. - **Reverse states**: whatever an agent sends, the person withdraws on the dashboard's page, which is why this ships after it. These did not apply: the CLI and its skills, since worker agents load none; migrations, since the store's schema already allows surface `mcp`; the dev loop; company resources. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Additive: a new tool in a list clients cache for up to 24 hours. A client that cached the old list sees `tell_patchy` the next time it lists. Nothing existing changes shape, and the protocol dates stay the same. - **What does a revert leave behind?** Submissions with surface `mcp` in the `feedback` schema, which the store from #1211 already accepts and lists. - **Does the release before it still work with that?** Yes. Clients that cached a list with `tell_patchy` get `-32602 unknown_tool` from it until they list again, as for any tool name the door doesn't have. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ey shortcuts (#1421) ## What changed This adds release 42's What's new entry, written from `1cd6d12`. It covers everything merged since release 41's `through` (`a25a9c5`), and sets the `patchy` release to `0.42.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Tell Patchy what it's missing | #1217, #1218, #1219, #1227, #1228 | | New: Turn off single-key shortcuts | #1276, #1279, #1301 | | Fixed: Typing reaches the patch again | #1407, #1412 | | Fixed: Dialogs in patches keep your place | #1420, #1255 | | Behind the scenes: plainer facts for agents building patches | #1249, #1256, #1297, #1418 | | Behind the scenes: Patchy stores teams and audiences ahead of teams | #1416 | | Patch changes: Mod+/ and `client.close()` in patchy/hotkeys; single-key shortcuts can be off; Tab wraps in plain modal dialogs | #1279, #1301, #1420 | #1376 is release 41's own entry. #1400, #1406, #1414, #1415, #1302, #1413 and #1419 are test, CI and dev tooling and need no line. The teams bridge (#1416) ships alone in this release so teams (#1417) can follow in the next one with a release to roll back to that reads its data closed. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7f93b91` (release 41) to this PR's merge.** No PR in the range is labelled `one-way`, and every Release impact answer says release 41 still works: - **#1217** adds migration `0037_feedback`, a schema release 41 never reads. **#1227** and **#1228** write into it. - **#1276** adds migration `0038_single_key_shortcuts`, a column with a default that release 41 never selects. - **#1416** adds migrations `0039_company_teams` to `0041_connection_audiences`, which hold tables that stay empty until teams ship, and widens one scope check. Its CI rehearsal ran `7f93b91 → head → 7f93b91 → head` on one set of data, and all four steps passed. - **#1279**, **#1301**, **#1255** and **#1420** change the SDK and the shell. Patches built on this release carry a `shortcutSetting` manifest field that release 41 reads without refusing, and its shell names no frame, so every shortcut stays on. - **#1218** and **#1219** add CLI commands and an optional `feedbackHint` in `--json` failures. A CLI from this release refuses to publish to an older instance before sending anything, as any mismatched release does. - Everything else is skill text, docs, tests and CI. If this release misbehaves, roll back to `7f93b91` (release 41). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1217; merge after it.
What changed
When an agent finds Patchy can't do something the person needs, or Patchy behaves oddly, the signal dies in that session. #1217 gave Patchy a place to store requests and feedback; this gives agents the way in.
patchy requestandpatchy feedbacksend them from the CLI in one call, without prompts, and read well under--json. The globalpatchyskill says when to use each, andpatchy-looppoints to it.Closes #1212
Part of #1210
How it works
patchy request "<what Patchy should do>" [--why "<need>"]stores the request and exits 0 even with matches, since a failure exit would invite a retry and a retry is a real duplicate.--jsonis{ ok, id, similar: [{ id, title, status, note?, link }], next }: each match'slinkis the exactpatchy request link <id> <match-id>command, each id one shell word, quoted when it needs it, andnextsays nothing else is required, to link only a match that fully meets the need, and, when one has shipped, to tell the person using its note. Text prints the id, then the matches.request link <id> <match-id> [--why],request unlink <id>,feedback "<text>",request|feedback list [--cursor]andrequest|feedback withdraw <id>print feat(feedback): Patchy stores requests and feedback #1217's success documents. Any text, or--why, may be-to read stdin, one per call.patchy.json's patch. It is read leniently: a missing or brokenpatchy.jsonnames none and never stops the send.requestandfeedbackjoinCliCommand, so thePatchy-Cliheader records them for every subcommand (feat(cli): unexpected failures point to patchy feedback #1213 reads this to keep its hint offfeedback).@patchy/api), stdin that isn't UTF-8 or passes the bound (reading stops there), and a path id that isn't of the shape the store mints (SubmissionId:req_/fbk_and 24 lowercase letters and digits). A match id rides in the body, so a general request's id stays the instance's to judge.code:contains_secret,invalid_text,rate_limited,not_found,invalid_link.{ ok: false, error: "Not found." }, no code). The CLI turns that into exit 2, " doesn't take requests yet." The new routes' own 404 always carriesnot_found, and ids are checked locally first, so an overlong id can't reach the router's catch-all and pass for skew. Nothing is gated on an exact release, and an older CLI simply has no such commands.patchy request list(orfeedback list) before sending again, instead of the usual "run the same command again".The skill text (
skills/patchy/SKILL.md; itsdescription:gains "or tell Patchy's team what it lacks or got wrong"):It says nothing either way about asking the person first.
patchy-loopgains one line: "When Patchy itself can't do what the person needs, or gets something wrong, follow Requests and feedback in the globalpatchyskill, or innode_modules/patchy/skills/patchy/SKILL.mdwhere that skill isn't installed." The packedpatchytarball carriespackage/skills/patchy/SKILL.md, so that path exists in any installed repo, a fresh clone included.Look at
The commands on real instances. Before is #1217's head, whose CLI has no such commands; after is this branch. The credential in the third line is
postgres://app:[email protected]/app; the transcript's sanitizer redacted part of it as an email address.Transcript
requests-and-feedbackBefore is
b4f5880(where this branch left feedback/store) and after isdb1f7e9(feedback/cli), both on theteamscenario, frompnpm dev transcript.Each line ran in its own
bash -cfrom the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads<origin>, its environment folder<env>, its checkout<checkout>and the home folder~; nothing else is normalized. Redacted before writing: email addresses outside the scenarios' example domains.9 of 9 lines changed.
File a request, then a similar one: the second lists the first as a match
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
14 of 44 lines are cut from the middle.
--jsonhas it all.Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
A credential is refused, naming the field and kind, and nothing is stored
Changed. Before, exit 1 in 0.2 s; after, exit 2 in 0.2 s.
Feedback, and a long note from stdin
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
12 of 42 lines are cut from the middle.
--jsonhas it all.Link a request to its match, then unlink it
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.9 s.
What I sent, and withdrawing one
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
15 of 45 lines are cut from the middle.
--jsonhas it all.Changed. Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s.
Changed. Before, exit 1 in 0.4 s; after, exit 0 in 0.6 s.
14 of 44 lines are cut from the middle.
--jsonhas it all.Version skew, on real instances. This branch's CLI, copied out of the build, against an instance at
main(before, no #1217) and at this branch (after):Transcript
request-version-skewBefore is
5bbf22a(--base origin/main) and after isdb1f7e9(feedback/cli), both on theteamscenario, frompnpm dev transcript.Each line ran in its own
bash -cfrom the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads<origin>, its environment folder<env>, its checkout<checkout>and the home folder~; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as).3 of 3 lines changed.
This branch's CLI against each side's instance: before has no requests yet
Changed. Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s.
Changed. Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s.
Changed. Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s.
Checked before sending. Before is this PR's head before review,
d6b8507, which sent each of these and left the instance to answer.Transcript
request-local-checksBefore is
d6b8507(--base) and after isdb1f7e9(feedback/cli), both on theteamscenario, frompnpm dev transcript.Each line ran in its own
bash -cfrom the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads<origin>, its environment folder<env>, its checkout<checkout>and the home folder~; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as).5 of 5 lines changed.
Checked before anything is sent: an empty request from stdin, and one over 200 characters
Changed. Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s.
Changed. Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s.
An id the store couldn't have minted, which an instance's router also turns away
Changed. Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s.
stdin that isn't UTF-8, and stdin past the 4,000-character bound
Changed. Before, exit 0 in 0.2 s; after, exit 1 in 0.2 s.
Changed. Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s.
A fresh agent blocked on a missing integration files one request from the skill alone. Claude Code on Sonnet 5.5, through a
teamenvironment'sagentlauncher at this branch's CLI and skill (no personal instructions, settings or memory), was given only: "Make us a patch that shows the sales team the latest Gmail thread with each customer, read straight from our company Gmail." It finished in 6 turns and 22 seconds:Its answer to the person, in full:
patchy request listafterwards held exactly that one request,surface: "cli",agent: "claude-code", as the environment's publisher. One run is a smell test, not a measurement.How it was verified
packages/patchy/src/cliFeedback.test.ts, 18 tests through the bundled CLI against a stub instance: a filed request's--jsonand text with matches,linkcommands andnext; none similar; the repo's patch named, and none from a brokenpatchy.json;-from stdin for--whyand feedback, and refused for both at once; link, unlink and withdraw; feedback's id;listpaging by--cursorand a bad cursor;contains_secret,invalid_textandrate_limitedas exit 2 in the instance's words;not_foundandinvalid_link; every command against an instance from before requests (exit 2); a dropped connection, a 502, an unreadable 201, a 422 whose body isn't JSON and an empty 403 on a send (exit 3, sent once, thelistmessage), the same 403 onliststaying exit 2; link commands quotinggen_demo; printf injectedand an id with an apostrophe, each run throughshas one command with the id intact; every text bound, in characters (200 emoji pass); 4,001 characters into a stdin left open ending the CLI before EOF; Latin-1 stdin refused; malformed and wrong-kind ids refused before any request, while a shapelessgen_match id still links.packages/feedback: a new test pins mintedreq_/fbk_ids toSubmissionId; all 41 of its tests pass with the bounds moved to@patchy/api.help.test.tswalks the new subcommands and finds every argument and flag described;skillLock.test.tspasses with the refreshed hash.pnpm checkon Node 24 atdb1f7e9: format, lint, typecheck and synth passed;testfailed 12 tests, all in the CLI's stub-instance files and execution'sLocalTaskProvider/Supervisor. Each is a local port probe's stray request reaching a test server (an extraGET /or host in the request log) or a load timeout, and a different test fails on each run:cliPublishalone failed two different tests on each of two reruns, andcliLookpassed both times. None of them touches requests or feedback. The focused run of the request and feedback file, the store, the API package and the CLI'sApi, help and skillLock tests passed (162), and the request and feedback file passes 18/18 in the Bun lane too.pnpm verifyon Node 24 at the first review fixes: every stage buttestandtest (bun)passed, and their failures were the same probe pattern.Not as the ticket said: its last Done means asks for a
pnpm dev evalrun. Eval tasks are graded on what the builder publishes (Task.targetis a new repo, page or existing patch), and this outcome publishes nothing, so it doesn't fit without a target-less task kind.pnpm dev trialfits, but on this machine both of its agents stopped before their first turn with "Failed to authenticate: OAuth session expired and could not be refreshed", twice: the trial passes onlyCLAUDE_CONFIG_DIR,ANTHROPIC_API_KEYandCLAUDE_CODE_OAUTH_TOKEN, and the stored Claude Code login needs a browser sign-in. So the agent run above is the by-hand route thepatchy-dev-loopskill describes: the environment's ownagentlauncher, started headless with a closed environment holding onlyPATH,HOMEand this session's Claude credentials. It ran at an earlier commit of this branch. Since then #1217's five server commits and the review fixes below have landed, and neither changes what that run did: its title and why are well inside the bounds now checked locally.Review
GPT 6.1 Sol reviewed
d6b8507. Fixed infa24c11(bounds and the minted id shape move to@patchy/api, pinned by a store test),28594e6(the CLI: quoted link ids, unreadable refusals as exit 3, local text, stdin and id checks, skew wording) and7f06333(README and ADR-0004):Sol re-checked at
a531081and closed 1, 3, 4 and 5. Fixed indb1f7e9, after rebasing onto #1217'sb4f5880:Release impact
Additive: new CLI commands and skill text. No route, schema or existing command changes. Against an instance without #1217 they refuse with exit 2 and say so.
feedbackschema, as the person's own submissions.Hit every surface. These applied:
packages/patchywith their tests,packages/patchy/README.md, ADR-0004 (commands,--jsonshapes, refusals, the exit 3 note, version skew, and thePatchy-Cliheader now also feeding each submission's agent and release), the globalpatchyskill and its hash inskills-lock.json, andpatchy-loopunderpackages/sdk/skills.CliCommandinpackages/api/src/cli.tsgainsrequestandfeedback, andpackages/api/src/schemas.tsnow holds the store's bounds andSubmissionId, whichpackages/feedbackuses. No route or wire shape changed, sodocs/API.mdis unchanged (its render test passes).These did not apply: migrations, vocabulary (no new term beyond #1217's glossary), served pages, the dev loop, company resources, the repo layout. Reverse states: send has
withdraw,linkhasunlink.Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.