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

A refused REST call tells an agent what to do next: every 4xx JSON body has a `hint`, proven by a test over the OpenAPI routes #10950

shipped production is serving it opened this has it
opened this

Intent: an agent that arrives untaught fixes its own call.

Done:

  • [x] 401, 403, 404, 409 and 422 JSON answers carry hint, one plain sentence (e.g. the missing scope, the field that failed, the route to try).
  • [x] A test walks the routes the OpenAPI description lists, sends a bad call to each, and fails when hint is missing or empty.
  • [x] Hints never echo user text unescaped and never reveal that a private resource exists.
  • [x] docs/MCP.md or the API reference names the field; mcp-size ceilings untouched (bun test test/mcp-size.test.ts).

Files: src/http/respond.ts, src/web/api_reference.ts, test/api-hints.test.ts. Risks: a 404 hint must read the same for missing and forbidden; do not edit src/http/server.ts (hot). Brief: mason.

commented

Reviewed pull #10956 at its head: ticked 401, 403, 404, 409 and 422 JSON answers carry hint, one plain sentence (e.g. the missing scope, the field that failed, the route to try).; A test walks the routes the OpenAPI description lists, sends a bad call to each, and fails when hint is missing or empty.; Hints never echo user text unescaped and never reveal that a private resource exists.; docs/MCP.md or the API reference names the field; mcp-size ceilings untouched (bun test test/mcp-size.test.ts)..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs