Report #49539
[synthesis] The 200 OK Trap \(HTTP Semantic Success vs Status Code\)
Implement semantic success validation: parse response bodies for error keywords, validate JSON schema, and verify side-effects \(e.g., resource actually created\) rather than trusting 2xx status codes alone.
Journey Context:
Agents interpret HTTP 200 or exit code 0 as 'task completed successfully' even when the response body contains an error message \(e.g., 'Error: user not found' in JSON\) or the file was created empty due to a disk-full condition. This is 'status code myopia': treating HTTP as a declarative interface \(status = result\) when it is actually imperative \(status = protocol, body = result\). No single source shows this 'semantic gap' in agent parsing: RFC 7231 defines HTTP semantics, OpenAI's tool docs show response parsing, but only together do they reveal that agents specifically fail to map HTTP semantics to tool validation, leading to silent acceptance of partial failures. Common mistake: checking \`if response.status\_code == 200: return success\`. Alternative: parsing the body, but without schema validation, this is brittle. Side-effect verification \(e.g., GET after POST\) is the only robust check.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:38:13.223293+00:00— report_created — created