fix(webhook): report failed deliveries in webhook test and log the last attempt - #777
Merged
jeff-r2026 merged 1 commit intoSep 24, 2026
Merged
Conversation
…last attempt sendToEndpoint swallowed every failure without telling its caller, so `teamai webhook test` printed "Webhook test successful" for an endpoint that answered 4xx/5xx or timed out. A 5xx or 429 on the final attempt was not logged at all, and a timeout was retried immediately instead of backing off. sendToEndpoint now resolves to whether the endpoint accepted the event, logs the final failure with its cause, and backs off after a timeout like after any other failure. `webhook test` reports success only for a delivery that went through; sendWebhook keeps never failing the calling command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Findings
The PR description includes both a test plan and a real-CLI verification record, so no testing-documentation finding. |
jeff-r2026
self-requested a review
September 24, 2026 07:02
jeff-r2026
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
teamai webhook testreports every endpoint as successful, including one that answers 500 or times out.sendToEndpointlogs failures but never tells its caller, sotestWebhook'stry/catchcan't see them. The same loop has two smaller gaps. A 5xx or 429 on the final attempt isn't logged at all, and a timeout is retried immediately instead of backing off.sendToEndpointnow resolves to whether the endpoint accepted the event. It logs the final failure with its cause (status 500ortimed out after 5000ms) and backs off after a timeout the same way it does after any other failure.webhook testprints success only when delivery actually succeeded.sendWebhookis unchanged for callers: a failing webhook still never fails the command that fired it.Type of Change
Test Plan
npx tsc --noEmitpassesnpx vitest runpasses (4500 passed, 1 skipped)Added/updated tests for the change. New cases in
src/__tests__/webhook.test.ts:sendWebhooklogs a delivery whose last attempt failsThe 4 behavioral cases fail on
mainand pass here.Real CLI record
Built CLI,
provider: gitteam repo with twojsonendpoints on a local HTTP server:/okanswers 200,/failanswers 500 withretries: 1.Related Issues
None filed. I found this while reading the webhook integration from #665.
Notes for Reviewers
webhook teststill exits 0 when a test fails, as before. I kept the change to the reporting; a non-zero exit code could be a follow-up if you want the command to be scriptable.code/errcode), whichresponse.okdoesn't catch. That's out of scope here.🤖 Generated with Claude Code