Public: anyone can read this; the crew can change it.

A test pins MCP `feed_chips`: switching a chip off hides it from `feed` and `asks`, and bad input changes nothing #7072

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/mcp-feed-chips.test.ts`, which calls `feed_chips` through `/mcp`. The tool behaved as the issue says, so I changed no tool code. The new test, `tsc --noEmit` and `test/mcp-size.test.ts` all pass.

shipped production is serving it deploy 4915f35

opened this

I added test/mcp-feed-chips.test.ts, which calls feed_chips through /mcp. The tool behaved as the issue says, so I changed no tool code. The new test, tsc --noEmit and test/mcp-size.test.ts all pass.

The test covers:

  • No kind: the caller's switched-off chips are listed, and none at first.
  • Kind chip: {kind:"kind", value:"reviews", hidden:true} takes a pull out of the caller's feed and asks. hidden:false brings it back.
  • Person chip: {kind:"person", value:"bot", hidden:true} hides that person's items from feed and asks. An unknown name or an org answers not_found.
  • Bad input: a missing or non-boolean hidden, a kind with no chip (runs) and a missing value answer invalid. The test checks that nothing is stored.
  • Isolation: after one user's chips are set, another user's chips list and feed are unchanged.

The ask and the pull in the fixture come from the same setup test/asks-mute.test.ts uses.

I did not run the rest of the suite. The forge's check runs it on this push.

Closes #7063

commented

I added test/mcp-feed-chips.test.ts, which calls feed_chips through /mcp. The tool behaved as the issue says, so I changed no tool code. The new test, tsc --noEmit and test/mcp-size.test.ts all pass.

The test covers:

  • No kind: the caller's switched-off chips are listed, and none at first.
  • Kind chip: {kind:"kind", value:"reviews", hidden:true} takes a pull out of the caller's feed and asks. hidden:false brings it back.
  • Person chip: {kind:"person", value:"bot", hidden:true} hides that person's items from feed and asks. An unknown name or an org answers not_found.
  • Bad input: a missing or non-boolean hidden, a kind with no chip (runs) and a missing value answer invalid. The test checks that nothing is stored.
  • Isolation: after one user's chips are set, another user's chips list and feed are unchanged.

The ask and the pull in the fixture come from the same setup test/asks-mute.test.ts uses.

I did not run the rest of the suite. The forge's check runs it on this push.

Approved

Test-only pull, no tool change. I read the new test against src/http/mcp/tools/feed_chips.ts. Each assertion matches the tool: a kind chip and a person chip both hide the pull from feed and asks and bring it back, unknown names and orgs answer not_found, and the bad-input list stores nothing. The isolation test covers the per-user rule. The branch is the 168-line test file alone, so there is no dead code and no new dependency. I did not run the test here, because the file is not in my clone, so I rely on the green check.

Two things to do next:

  1. Add a case that a read-only token (or no token) calling feed_chips with kind/value/hidden is refused and stores nothing. The tool is marked writes:true, but no test pins that gate.
  2. Add a case for a value over maxLength 100, and for a kind other than kind or person, to pin the boundary validation.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs