docs: clarify x-bf-async-webhook opt-in delivery and update async/webhook docs and OpenAPI spec - #5429
Conversation
…elivery description
|
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughClarifies async webhook delivery as a per-request opt-in, documents endpoint and subscription requirements, updates submission examples, and aligns the OpenAPI description with behavior when event subscriptions are absent. ChangesAsync webhook documentation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merge activity
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/features/webhooks.mdx`:
- Around line 53-59: Update the curl example’s request body to use valid JSON by
replacing the `"messages": [...]` placeholder with a concrete message object
matching the format in async-inference documentation, while preserving the
existing webhook headers and request structure.
In `@docs/openapi/paths/inference/async.yaml`:
- Around line 750-754: The async webhook documentation must state that the
endpoint must remain both enabled and subscribed when the job completes;
otherwise delivery is skipped while the job still completes normally. Update the
endpoint-state description in docs/openapi/paths/inference/async.yaml lines
750-754 and the corresponding usage guidance in
docs/features/async-inference.mdx lines 173-175, keeping both documentation
layers consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 12013641-1d67-4780-8acb-9c5d13d6e258
📒 Files selected for processing (3)
docs/features/async-inference.mdxdocs/features/webhooks.mdxdocs/openapi/paths/inference/async.yaml
| ```bash | ||
| curl -X POST http://localhost:8080/v1/async/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "x-bf-vk: sk-bf-your-virtual-key" \ | ||
| -H "x-bf-async-webhook: order-events" \ | ||
| -d '{ "model": "openai/gpt-4o-mini", "messages": [...] }' | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use valid JSON in the curl example.
"messages": [...] contains ..., which is invalid JSON, so copying this command fails before it can test webhook delivery. Use a concrete message object, consistent with docs/features/async-inference.mdx.
Proposed fix
- -d '{ "model": "openai/gpt-4o-mini", "messages": [...] }'
+ -d '{
+ "model": "openai/gpt-4o-mini",
+ "messages": [
+ { "role": "user", "content": "Trigger an async webhook" }
+ ]
+ }'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ```bash | |
| curl -X POST http://localhost:8080/v1/async/chat/completions \ | |
| -H "Content-Type: application/json" \ | |
| -H "x-bf-vk: sk-bf-your-virtual-key" \ | |
| -H "x-bf-async-webhook: order-events" \ | |
| -d '{ "model": "openai/gpt-4o-mini", "messages": [...] }' | |
| ``` |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/features/webhooks.mdx` around lines 53 - 59, Update the curl example’s
request body to use valid JSON by replacing the `"messages": [...]` placeholder
with a concrete message object matching the format in async-inference
documentation, while preserving the existing webhook headers and request
structure.
| state (`completed` or `failed`). The endpoint must already exist and be enabled; | ||
| otherwise the submission is rejected with HTTP 400. If the endpoint is not subscribed | ||
| to the resulting event, the job still completes normally but no delivery is enqueued. | ||
| When omitted, no webhook is sent for the job and results are retrieved by polling. | ||
| See the Webhooks management API to register endpoints. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Keep completion-time endpoint state consistent across the documentation layers.
docs/features/webhooks.mdx requires the endpoint to remain enabled and subscribed when the job finishes. The two changed descriptions only mention the subscription requirement, so clarify that disabling the endpoint before completion skips delivery while the job still completes normally.
docs/openapi/paths/inference/async.yaml#L750-L754: document the enabled-at-completion behavior alongside the subscription behavior.docs/features/async-inference.mdx#L173-L175: add the same completion-time enabled requirement to the usage guidance.
As per path instructions, documentation under docs/** must remain consistent with the documented runtime contract.
📍 Affects 2 files
docs/openapi/paths/inference/async.yaml#L750-L754(this comment)docs/features/async-inference.mdx#L173-L175
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/openapi/paths/inference/async.yaml` around lines 750 - 754, The async
webhook documentation must state that the endpoint must remain both enabled and
subscribed when the job completes; otherwise delivery is skipped while the job
still completes normally. Update the endpoint-state description in
docs/openapi/paths/inference/async.yaml lines 750-754 and the corresponding
usage guidance in docs/features/async-inference.mdx lines 173-175, keeping both
documentation layers consistent.
Source: Path instructions
* fixes helm changelog (#5426) * docs: clarify `x-bf-async-webhook` opt-in delivery and update async/webhook docs and OpenAPI spec (#5429) ## Summary Clarifies that webhook delivery for async jobs is opt-in per request, not automatic. Previously, the docs implied that registering an endpoint was sufficient for delivery to occur. This PR corrects that by documenting the `x-bf-async-webhook` header as the explicit trigger, and refines the behavior around subscription validation timing. ## Changes - Updated the async inference tip and webhook overview to state that the endpoint must be named via `x-bf-async-webhook` on the submit request for delivery to occur. - Added a new "Webhook Notifications" section to `async-inference.mdx` detailing opt-in behavior, validation rules, and header scope. - Added a new "Triggering a Delivery" section to `webhooks.mdx` with a curl example and clarifying bullet points. - Corrected the OpenAPI description for `x-bf-async-webhook` to reflect that subscription validation happens at job completion time, not at submission — meaning a missing subscription no longer causes the submit to be rejected, but silently skips delivery instead. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [x] Docs ## How to test Review the rendered documentation to confirm: 1. The async inference page includes the "Webhook Notifications" section with accurate opt-in behavior. 2. The webhooks page includes the "Triggering a Delivery" section with a working curl example. 3. The OpenAPI spec correctly reflects that subscription absence at job completion skips delivery rather than rejecting the submit. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. No changes to auth, secrets, or delivery signing behavior. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable --------- Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
* fixes helm changelog (maximhq#5426) * docs: clarify `x-bf-async-webhook` opt-in delivery and update async/webhook docs and OpenAPI spec (maximhq#5429) ## Summary Clarifies that webhook delivery for async jobs is opt-in per request, not automatic. Previously, the docs implied that registering an endpoint was sufficient for delivery to occur. This PR corrects that by documenting the `x-bf-async-webhook` header as the explicit trigger, and refines the behavior around subscription validation timing. ## Changes - Updated the async inference tip and webhook overview to state that the endpoint must be named via `x-bf-async-webhook` on the submit request for delivery to occur. - Added a new "Webhook Notifications" section to `async-inference.mdx` detailing opt-in behavior, validation rules, and header scope. - Added a new "Triggering a Delivery" section to `webhooks.mdx` with a curl example and clarifying bullet points. - Corrected the OpenAPI description for `x-bf-async-webhook` to reflect that subscription validation happens at job completion time, not at submission — meaning a missing subscription no longer causes the submit to be rejected, but silently skips delivery instead. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [x] Docs ## How to test Review the rendered documentation to confirm: 1. The async inference page includes the "Webhook Notifications" section with accurate opt-in behavior. 2. The webhooks page includes the "Triggering a Delivery" section with a working curl example. 3. The OpenAPI spec correctly reflects that subscription absence at job completion skips delivery rather than rejecting the submit. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. No changes to auth, secrets, or delivery signing behavior. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable --------- Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
* fixes helm changelog (maximhq#5426) * docs: clarify `x-bf-async-webhook` opt-in delivery and update async/webhook docs and OpenAPI spec (maximhq#5429) ## Summary Clarifies that webhook delivery for async jobs is opt-in per request, not automatic. Previously, the docs implied that registering an endpoint was sufficient for delivery to occur. This PR corrects that by documenting the `x-bf-async-webhook` header as the explicit trigger, and refines the behavior around subscription validation timing. ## Changes - Updated the async inference tip and webhook overview to state that the endpoint must be named via `x-bf-async-webhook` on the submit request for delivery to occur. - Added a new "Webhook Notifications" section to `async-inference.mdx` detailing opt-in behavior, validation rules, and header scope. - Added a new "Triggering a Delivery" section to `webhooks.mdx` with a curl example and clarifying bullet points. - Corrected the OpenAPI description for `x-bf-async-webhook` to reflect that subscription validation happens at job completion time, not at submission — meaning a missing subscription no longer causes the submit to be rejected, but silently skips delivery instead. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [x] Docs ## How to test Review the rendered documentation to confirm: 1. The async inference page includes the "Webhook Notifications" section with accurate opt-in behavior. 2. The webhooks page includes the "Triggering a Delivery" section with a working curl example. 3. The OpenAPI spec correctly reflects that subscription absence at job completion skips delivery rather than rejecting the submit. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. No changes to auth, secrets, or delivery signing behavior. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable --------- Co-authored-by: Akshay Deo <akshay@akshaydeo.com>

Summary
Clarifies that webhook delivery for async jobs is opt-in per request, not automatic. Previously, the docs implied that registering an endpoint was sufficient for delivery to occur. This PR corrects that by documenting the
x-bf-async-webhookheader as the explicit trigger, and refines the behavior around subscription validation timing.Changes
x-bf-async-webhookon the submit request for delivery to occur.async-inference.mdxdetailing opt-in behavior, validation rules, and header scope.webhooks.mdxwith a curl example and clarifying bullet points.x-bf-async-webhookto reflect that subscription validation happens at job completion time, not at submission — meaning a missing subscription no longer causes the submit to be rejected, but silently skips delivery instead.Type of change
Affected areas
How to test
Review the rendered documentation to confirm:
Breaking changes
Related issues
Security considerations
None. No changes to auth, secrets, or delivery signing behavior.
Checklist
docs/contributing/README.mdand followed the guidelines