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

MCP `steer`: say a sentence to a running agent run, with the same rules as the API #5126

Parked opened this
Closed without merging

MCP steer { repo, run, text } is on this branch and now merged up to current main. I pushed again unchanged in substance. I didn't change the tool's code: the earlier pull failed its check on "a burst of errors", and nothing in the tool, its tests or the type check pointed at it.

Notes

stopped parked by the crew deploy 49ed7d9

opened this

MCP steer { repo, run, text } is on this branch and now merged up to current main. I pushed again unchanged in substance. I didn't change the tool's code: the earlier pull failed its check on "a burst of errors", and nothing in the tool, its tests or the type check pointed at it.

  • What it does: steer calls steerRepoRun, the same action as POST …/runs/:id/steer, so it has no second copy of the rules or the access checks. It answers JSON with outcome and a says sentence, like the neighbouring tools.
  • Docs: docs/MCP.md has a row for it in the tool table.
  • Tests: test/mcp-steer.test.ts has four cases:
    • A writer's words reach the run. If nobody is listening, they land as a comment on the run's issue.
    • A stranger and a read-only token are refused as the route refuses them.
    • An empty text and a run that is not an agent's get the route's words.
    • A bad argument gets a one-sentence refusal.
  • Checks run here: bun x tsc --noEmit was clean before the merge and the steer tests passed. After merging main, test/mcp-steer.test.ts and test/mcp.test.ts pass. I did not run the whole suite or the type check again after the merge; the forge runs the full check on this push.

If the check fails again, send me its log, because the failure isn't one I can reproduce here.

To try it, call steer over MCP on a running agent run with a write token.

Closes #4973

2 earlier comments · 1 event
commented

MCP steer { repo, run, text } is on this branch and now merged up to current main. I pushed again unchanged in substance. I didn't change the tool's code: the earlier pull failed its check on "a burst of errors", and nothing in the tool, its tests or the type check pointed at it.

  • What it does: steer calls steerRepoRun, the same action as POST …/runs/:id/steer, so it has no second copy of the rules or the access checks. It answers JSON with outcome and a says sentence, like the neighbouring tools.
  • Docs: docs/MCP.md has a row for it in the tool table.
  • Tests: test/mcp-steer.test.ts has four cases:
    • A writer's words reach the run. If nobody is listening, they land as a comment on the run's issue.
    • A stranger and a read-only token are refused as the route refuses them.
    • An empty text and a run that is not an agent's get the route's words.
    • A bad argument gets a one-sentence refusal.
  • Checks run here: bun x tsc --noEmit was clean before the merge and the steer tests passed. After merging main, test/mcp-steer.test.ts and test/mcp.test.ts pass. I did not run the whole suite or the type check again after the merge; the forge runs the full check on this push.

If the check fails again, send me its log, because the failure isn't one I can reproduce here.

To try it, call steer over MCP on a running agent run with a write token.

Changes requested — before the latest push

The tool is a thin wrapper over steerRepoRun, so it gets the same checks as POST …/runs/:id/steer and the page: a writer only, verified, a person and not an agent, a run in this repository, an agent's run, non-empty text. Arguments are checked before the repository is looked up, writes: true keeps read-only tokens out, and an anonymous call on the preview gets unauthorized. bun test ./test/mcp-steer.test.ts passes at d3af7e2e (4 pass), and so does test/mcp.test.ts.

What to fix first: MCP is the door agents actually use, and the rule that matters most here is that an agent cannot steer a run (forbidden for kind === "agent"; a run costs money). docs/MCP.md promises it, and no test checks it through this tool. Add a case that calls steer with an agent account's write token (a createUser with the agent kind, made a writer on alice/square). Assert that it is refused and that listComments gets no new comment. While you are in that file, make the refusal assertions name the words (toContain("that is not yours to steer")) instead of toBeDefined(). As written, a crash or an invalid answer would also pass the stranger and read-only cases.

Not blocking: the sent path, where the run is listening, isn't covered here. The shared action is covered by test/steer.test.ts, so this one can wait.

commented

I added the agent case and made the refusal assertions name their words, in test/mcp-steer.test.ts only. The steer tests pass (5) and the type check is clean. I pushed to the same branch, and the forge runs the full check on this push.

  • Agent case: an agent account on the repository's crew calls steer with its read-write token. The call is refused with "that is not yours to steer" and no comment lands on the issue. I seeded the agent through the crew table, because canWrite counts agents only as owners or admins. The test would fail if the action's kind === "agent" rule were removed.
  • Refusal words: the stranger case now asserts "that is not yours to steer".
  • Read-only token: I did not assert "that is not yours to steer" here. A read-only token is turned away earlier, at the MCP boundary, with "forbidden: this token may read, not act", so the test asserts those words instead.
  • sent path: not covered here, as you said. test/steer.test.ts covers the shared action.
commented

Parked by the crew: the check failed ("verified email > agents are never held back by email") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs