Skip to content

Commit 1740b9f

Browse files
committed
docs: add SDK defaults divergence notes to README
Document the actual retry, backoff, jitter, and timeout defaults of the Go, TypeScript, and Python SDKs with file and symbol references, so the drift between them is visible. No code defaults were changed.
1 parent 45ee18a commit 1740b9f

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- **"Defaults & divergences across SDKs" README section** documenting how
12+
retry, backoff, jitter, and timeout defaults differ between the Go,
13+
TypeScript, and Python SDKs.
14+
1015
## [0.2.0] — 2026-07-14
1116

1217
### Changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@ with HawkClient() as client:
115115
print(f"Tool: {call.name}({call.arguments})")
116116
```
117117

118+
## Defaults & divergences across SDKs
119+
120+
The three Hawk SDKs (Go, TypeScript, Python) share wire behavior but have
121+
drifted in transport defaults. Actual current values:
122+
123+
| Default | Python (this SDK) | Go | TypeScript |
124+
| --- | --- | --- | --- |
125+
| Retries | **On**`retry_config or DEFAULT_RETRY_CONFIG` (`src/hawk/client.py`, both sync and async clients) | **Off** — opt in with `WithRetry(DefaultRetryConfig())` (`client.go`) | **Off** — opt in with `{ retry: defaultRetryConfig() }` (`src/client.ts`) |
126+
| Initial backoff | 0.5s (`src/hawk/retry.py`, `RetryConfig`) | 1s (`retry.go`, `DefaultRetryConfig`) | 1s (`src/retry.ts`, `defaultRetryConfig`) |
127+
| Backoff jitter | Equal + jitter: `backoff + rand(0, backoff/2)` (`src/hawk/retry.py`, `_compute_backoff`) | Full jitter: `rand(0, backoff)` (`retry.go`, `backoffDuration`) | Full jitter: `rand(0, backoff)` (`src/retry.ts`, `backoffDurationMs`) |
128+
| Request timeout | httpx timeout, 30s (`src/hawk/client.py`, `DEFAULT_TIMEOUT`) | `ResponseHeaderTimeout: 5s`, headers only (`client.go`) | Whole-request deadline, 30s, includes retries (`src/client.ts`, `timeoutMs`) |
129+
130+
Max retries (3), max backoff (30s), retryable statuses (429/500/502/503/504),
131+
and the non-idempotent rule (only 429 is retried for POST `/v1/chat`) are
132+
identical in all three SDKs. This table documents current behavior; it is not
133+
a compatibility contract between the SDKs.
134+
118135
## API Reference
119136

120137
### HawkClient / AsyncHawkClient

0 commit comments

Comments
 (0)