← Back to PRs

#22061: [Bug]: return 200 for hook invocations

by AIflow-Labs open 2026-02-20 17:25 View on GitHub →
gateway size: XS
## Summary Fixes #22036 by returning HTTP 200 for webhook invocations while keeping async job dispatch unchanged. ## Changes - Updated `src/gateway/server-http.ts` hook handling to respond with status 200 for: - `/hooks/agent` - mapped hook action dispatches that call `dispatchAgentHook` - Kept run payload behavior (`{ ok: true, runId }`) the same so existing consumers still receive run context. ## Validation - `pnpm test:e2e src/gateway/server.hooks.e2e.test.ts` ## Confidence Score - 10/10 confidence. - Change is narrowly scoped to HTTP response codes and directly matches the issue report that integrations expect 200. - Behavior remains async; only response status and semantics changed. - Regression coverage updated in existing hook e2e suite to pin new expected status. <!-- greptile_comment --> <h3>Greptile Summary</h3> Changed webhook invocation responses from HTTP 202 (Accepted) to 200 (OK) to align with webhook consumer expectations. The async dispatch behavior remains unchanged - hooks still execute asynchronously and return a `runId` immediately. All test assertions updated to reflect the new status code. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The change is narrowly scoped to HTTP status codes only. The async behavior and response payload remain identical, so existing consumers are unaffected. Comprehensive test coverage validates the change across all webhook endpoints. - No files require special attention <sub>Last reviewed commit: 3429e81</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs