Skip to content

Commit 2235fc2

Browse files
docs: link the Ruby failure boundary guide
1 parent 6ccf9ae commit 2235fc2

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ the [MDN Retry-After reference](https://developer.mozilla.org/en-US/docs/Web/HTT
2323
and the [WHATWG Server-Sent Events specification](https://html.spec.whatwg.org/multipage/server-sent-events.html).
2424
For a worked replay-safety model, read the
2525
[LLM stream retry-safety walkthrough](https://ai-router.hashnode.dev/rust-llm-stream-retry-safety).
26+
The repository also includes a [Ruby failure-boundary deep dive](https://github.com/airouter-dev/openai-compatible-errors-ruby/blob/main/marketing/ruby-openai-compatible-api-errors-deep-dive.md)
27+
with the decision rationale and runnable boundary examples.
2628

2729
The package is available from
2830
[RubyGems](https://rubygems.org/gems/openai-compatible-errors). Teams using PHP

marketing/ruby-openai-compatible-api-errors-deep-dive.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ credits, a disconnected POST may already have reached the upstream service,
77
and an SSE connection can fail after user-visible tokens have been rendered.
88

99
This article explains the engineering boundary behind
10-
openai-compatible-errors on RubyGems. The gem is intentionally small at
11-
runtime (no HTTP client dependency), but it is not a blanket retry-everything
12-
helper.
10+
[openai-compatible-errors on RubyGems](https://rubygems.org/gems/openai-compatible-errors).
11+
The [AI-ROUTER API gateway](https://ai-router.dev/) is one compatible endpoint
12+
context, but the gem is intentionally small at runtime (no HTTP client
13+
dependency) and is not a blanket retry-everything helper.
1314

1415
## Why status-code-only retry logic loses money
1516

@@ -51,7 +52,9 @@ credential redaction.
5152

5253
## Retry-After is evidence, not an order to sleep
5354

54-
The gem parses seconds, HTTP dates and millisecond hints, but it never sleeps.
55+
The gem parses the formats described by the
56+
[MDN Retry-After reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After)
57+
and millisecond hints, but it never sleeps.
5558
The application owns cancellation and scheduling:
5659

5760
plan = OpenAICompatibleErrors.decide_retry(error, context)
@@ -64,7 +67,8 @@ the remaining elapsed-time budget and maximum delay.
6467

6568
## SSE needs a separate replay state machine
6669

67-
SSE is a sequence of framed events, not a JSON response. A parser that only
70+
SSE follows the [WHATWG Server-Sent Events specification](https://html.spec.whatwg.org/multipage/server-sent-events.html):
71+
it is a sequence of framed events, not a JSON response. A parser that only
6872
looks for [DONE] cannot distinguish an idle stream from one that emitted a
6973
partial completion. SSEInspector keeps:
7074

@@ -100,3 +104,9 @@ with one. If it only talks to one provider with a stable native exception
100104
contract, the provider SDK may be enough. The value here is the explicit,
101105
auditable boundary when an application talks to multiple
102106
OpenAI-compatible endpoints.
107+
108+
## Further reading
109+
110+
- [OpenAI error-code guide](https://developers.openai.com/api/docs/guides/error-codes)
111+
- [PHP implementation on Packagist](https://packagist.org/packages/airouter/openai-compatible-errors)
112+
- [Cross-language package overview](https://github.com/airouter-dev/openai-compatible-errors-ruby#related-language-packages)

0 commit comments

Comments
 (0)