Skip to content

feat(mcp): worker agents tell Patchy what it lacks or got wrong - #1228

Merged
allisonmahmood merged 4 commits into
mainfrom
feedback/mcp
Nov 11, 2026
Merged

allisonmahmood merged 4 commits into
mainfrom
feedback/mcp

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

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"}
The tool as tools/list shows it
{
  "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 }
}

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:

Consent page at this head, with the line It can send requests and feedback to Patchy’s team

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 feat(portal): send Patchy a request or feedback, and see what you sent #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 feat(portal): send Patchy a request or feedback, and see what you sent #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 feat(cli): patchy request and patchy feedback #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 feat(portal): send Patchy a request or feedback, and see what you sent #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
  • 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 feat(feedback): Patchy stores requests and feedback #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.

@github-actions github-actions Bot added area:server Touches the server area area:cli Touches the cli area area:docs Touches the docs area size:l 501-1,000 changed lines labels Nov 4, 2026
@allisonmahmood
allisonmahmood force-pushed the feedback/portal branch 2 times, most recently from 1e26cf5 to bda5bd3 Compare November 11, 2026 14:25
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 7f149f3e1f26651d669aef9938e715a10a080fbb (base bda5bd3d103adf2bebd86abe919e1127d239f0ea) on a fresh brightline throwaway instance under Node 24.20.0, by GPT-6.1 Sol (xhigh) in the Codex harness through T3 Code.

Done means

  • Requests and feedback: passed through direct MCP calls. The request returned id, similar, next, and url. A seeded similar request returned status: shipped and its public note; next said to tell the person using that note. Feedback returned id, next, and url. Both linked the instance’s working /feedback page, with no CLI or linking instruction.
  • Attribution and withdrawal: passed. Both were stored as Jordan at Brightline, surface mcp, agent Acceptance Worker, the connection’s client name. The request’s reason was retained. Jordan’s page showed the agent and Patchy MCP; its menus and confirmation dialogs withdrew both, and database assertions confirmed both rows were deleted. Priya could neither see nor withdraw Jordan’s request.
  • Every served revision: passed. tell_patchy listed and ran on 2026-07-28, 2025-11-25, and 2025-06-18, including legacy initialization. Discovery named it and stayed below 512 characters; the suite covers the longest names. Descriptions, routing rule, exclusions, and annotations matched the claim.
  • Input bounds: passed. Every revision advertised request titles of 3–200 characters and text/reason limits of 4,000. Direct calls accepted the exact allowed boundaries and refused 2/201-character titles and 4,001-character feedback/reasons. These bounds now come from @patchy/api.
  • Refusals: passed. A nonblank why on feedback returned invalid_args; blank why worked. Synthetic credentials in either text or request why returned contains_secret without echo. Submission counts stayed unchanged for every refusal. Extra fields were refused. The focused suite also passed the shared send-limit and retry-wait cases.
  • Agent access: passed. With it off, all five tools returned agent_access_off and stored nothing; turning it back on restored calls. A missing bearer returned HTTP 401.
  • Consent: passed. The current page returned HTTP 200 and showed “It can send requests and feedback to Patchy’s team” for a member and an admin. It also rendered at 390px without horizontal page overflow. Current-head screenshots are below.

Golden journeys

  • Sign in: passed. Signed-out /feedback returned 401; signing in reached the list; signing out restored 401.
  • Find and open a tool: passed through MCP find_patches and open_patch, followed by the scenario’s working New Business page and read_patch over its deals.
  • Use a tool live / use a tier 2 tool: passed. change_patch moved Parkside Dental Group from Lead to Discovery on Jordan’s and Allison’s already-open boards without reloading; retrying the same key returned replayed: true. Moving it back updated both boards. Spend refused self-approval with own_approval and left the request submitted.
  • Send and withdraw: passed for both submission kinds, as above. No browser errors occurred in the consent and withdrawal checks. Other golden journeys are outside this diff.
Focused tests and current page evidence
pnpm exec vitest run packages/mcp packages/auth/src/OAuthEndpoints.test.ts packages/portal/src/FeedbackPages.test.ts packages/api --maxWorkers=1

Test Files  20 passed (20)
     Tests  170 passed (170)

The consent page at this head:

Current consent page includes sending requests and feedback

At phone width:

Current consent page at 390px

Jordan’s list before withdrawing the request and feedback:

What you sent shows the connection client and Patchy MCP

Rollback answers: match the diff. No migration or infrastructure change is added. The base store already accepts and lists surface mcp; a revert leaves usable submissions. Clients caching the tool name receive the existing unknown_tool response until they list again. No one-way label is needed. CI’s rollback-rehearsal passed.

Not run

  • A real worker choosing the tool autonomously: attempted with the environment’s Codex worker and an ordinary request for scheduled background execution. Its local login was expired and could not refresh, so it never reached a model turn. Direct calls establish the behavior above; autonomous tool choice remains unverified.

Notes

  • git range-diff confirms the original MCP implementation commit is unchanged. The consent row moved into the new page’s canList; the documentation resolution and new shared-bounds import match the stated changes.
  • This verdict includes the dashboard base from feat(portal): send Patchy a request or feedback, and see what you sent #1227. That list-and-withdraw page must ship before this tool.
  • CI at 2026-11-11 15:02 UTC: 18 success, 6 in progress (browser, test (24), test (22), test (bun), test (26), attio-live), 1 pending (pidgeon-suite). No failed checks were reported. The required browser and four test lanes were still running; this verdict does not establish merge readiness. CI run.

Base automatically changed from feedback/portal to main November 11, 2026 15:46
allisonmahmood and others added 4 commits November 11, 2026 16:46
A fifth fixed tool, tell_patchy { kind, text, why? }, sends Patchy's team a
request or feedback through Feedback's service as the connection's person,
with surface mcp and the client name they approved as the agent. It passes
the door's gates and agent access like the other four, and never Runtime's
admission. A request answers { id, similar, next, url }, feedback
{ id, next, url }; url is the person's page at <public origin>/feedback.
Refusals carry the store's codes. The door's instructions gain a clause
naming it and stay under 512 characters with the longest names.

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]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Landing note: ca3a636 is 7f149f3 rebased onto main after #1227's squash. git range-diff shows all four of this PR's commits unchanged. What moved underneath is #1227's fix for Ask without script, which got its own acceptance verdict before it merged. All 18 required checks pass on ca3a636.

@allisonmahmood
allisonmahmood merged commit d8f884f into main Nov 11, 2026
25 checks passed
@allisonmahmood
allisonmahmood deleted the feedback/mcp branch November 11, 2026 16:28
allisonmahmood added a commit that referenced this pull request Nov 12, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): worker agents tell Patchy what it lacks or got wrong

1 participant