{
  "file": "F19-mcp.md",
  "bullet": "Port out of range (`F19.oauth-callback-bad-port`), known bug.",
  "ids": [
    "F19.oauth-callback-bad-port"
  ],
  "line": 534,
  "script": "JB=$(control-agent-server api POST /api/mcp/oauth/start --json \"$(jq -nc --argjson s \"$OAUTH_SRV\" '{server: $s, timeout: 30}')\" \\\n  --check authorization_url exists --field job_id)\ncontrol-agent-server api GET \"/api/mcp/oauth/status/$JB\" --check callback_ready eq true --until-ok 20\ncontrol-agent-server api POST \"/api/mcp/oauth/callback/$JB\" --json '{\"callback_url\":\"http://localhost:1/callback?code=x\"}' --expect 400 \\\n  --check detail eq 'Unexpected OAuth callback URL'\ncontrol-agent-server api POST \"/api/mcp/oauth/callback/$JB\" --json '{\"callback_url\":\"http://localhost:99999/callback?code=x\"}' --expect 400 --save F19.oauth-callback-bad-port/port-99999  # bug\ncontrol-agent-server api POST \"/api/mcp/oauth/callback/$JB\" --json '{\"callback_url\":\"http://localhost:abc/callback?code=x\"}' --expect 400 --save F19.oauth-callback-bad-port/port-abc  # bug\ncontrol-agent-server api GET \"/api/mcp/oauth/status/$JB\" --check status eq authorizing\n",
  "exit_code": 1,
  "elapsed_ms": 5283,
  "failed_line": 6,
  "failed_command": "control-agent-server api POST \"/api/mcp/oauth/callback/$JB\" --json '{\"callback_url\":\"http://localhost:99999/callback?code=x\"}' --expect 400 --save F19.oauth-callback-bad-port/port-99999",
  "stdout": "{\n  \"ok\": true,\n  \"status\": 200,\n  \"request\": {\n    \"method\": \"GET\",\n    \"path\": \"/api/mcp/oauth/status/a549acd191574fd5bb09674d43ff9c12\",\n    \"query\": [],\n    \"auth\": \"header\",\n    \"body\": null,\n    \"files\": []\n  },\n  \"response\": {\n    \"status\": 200,\n    \"headers\": {\n      \"content-length\": \"474\",\n      \"content-type\": \"application/json\"\n    },\n    \"body\": {\n      \"ok\": true,\n      \"status\": \"authorizing\",\n      \"job_id\": \"a549acd191574fd5bb09674d43ff9c12\",\n      \"authorization_url\": \"http://127.0.0.1:57017/authorize?response_type=code&client_id=911dcb9f-92b7-4da4-b224-114400c09b85&redirect_uri=http%3A%2F%2Flocalhost%3A38557%2Fcallback&state=TE1tJE3OdR47WCTDVWykvPFgI8NvBWoYOppYBsnJUbk&code_challenge=lJDRlUv_PYQ_oODEZ8FCvygjBxaSBT_Dm3bPQk6HsiU&code_challenge_method=S256&resource=http%3A%2F%2F127.0.0.1%3A57017%2Fmcp&scope=mail.read\",\n      \"callback_ready\": true\n    },\n    \"truncated\": false\n  },\n  \"elapsed_ms\": 48,\n  \"checks\": [\n    {\n      \"check\": \"callback_ready eq true\",\n      \"ok\": true,\n      \"actual\": \"true\"\n    }\n  ],\n  \"attempts\": 1\n}\n{\n  \"ok\": true,\n  \"status\": 400,\n  \"request\": {\n    \"method\": \"POST\",\n    \"path\": \"/api/mcp/oauth/callback/a549acd191574fd5bb09674d43ff9c12\",\n    \"query\": [],\n    \"auth\": \"header\",\n    \"body\": {\n      \"callback_url\": \"http://localhost:1/callback?code=x\"\n    },\n    \"files\": []\n  },\n  \"response\": {\n    \"status\": 400,\n    \"headers\": {\n      \"content-length\": \"42\",\n      \"content-type\": \"application/json\"\n    },\n    \"body\": {\n      \"detail\": \"Unexpected OAuth callback URL\"\n    },\n    \"truncated\": false\n  },\n  \"elapsed_ms\": 87,\n  \"checks\": [\n    {\n      \"check\": \"detail eq Unexpected OAuth callback URL\",\n      \"ok\": true,\n      \"actual\": \"Unexpected OAuth callback URL\"\n    }\n  ]\n}\n{\n  \"ok\": false,\n  \"status\": 500,\n  \"request\": {\n    \"method\": \"POST\",\n    \"path\": \"/api/mcp/oauth/callback/a549acd191574fd5bb09674d43ff9c12\",\n    \"query\": [],\n    \"auth\": \"header\",\n    \"body\": {\n      \"callback_url\": \"http://localhost:99999/callback?code=x\"\n    },\n    \"files\": []\n  },\n  \"response\": {\n    \"status\": 500,\n    \"headers\": {\n      \"content-length\": \"120\",\n      \"content-type\": \"application/json\"\n    },\n    \"body\": {\n      \"detail\": \"Internal Server Error\",\n      \"exception\": \"Port out of range 0-65535\",\n      \"error_id\": \"76ef2aae1bfe48b18bf55e61dfc766e1\"\n    },\n    \"truncated\": false\n  },\n  \"elapsed_ms\": 1868,\n  \"saved\": \"/workspace/verification-artifacts/runs/20261013-030153-d95d-map-f19/evidence/F19.oauth-callback-bad-port/port-99999.json\",\n  \"hint\": \"expected 400, got 500\"\n}\n",
  "stderr": ""
}
