Commit cc5acd6
committed
Whole-repo hardening round: streaming, content policy, realtime billing, modernization
Fixes from a full-source review:
- streaming responses outlived the per-account timeout: reqwest's request
timeout is a total deadline, so any generation longer than timeout_seconds
(default 60s) was cut mid-stream and billed as aborted; streams now get the
bound on response headers and then per gap between chunks
- REST responses never masked secrets (detect_secrets applied inbound and on
the realtime relay only), and a secrets-only tenant streamed raw deltas;
outbound masking and the stream-buffering boundary now share one predicate
- the blocklist scanned base64 image parts, randomly blocking multimodal
requests; the scan now visits the same text fields DLP does
- a second realtime response.create during an active turn desynced the
admitted-turn queue for the rest of the session (misattributed billing plus
a stuck reservation); the bridge holds at most one admitted turn
- content-blocked requests on the responses/embeddings/images/audio surfaces
answered 500 instead of a graceful 400
- vendor error bodies without an error envelope (Bedrock, DashScope native)
parsed as empty successes on 4xx/5xx statuses
- claude engine joined system texts without a separator
- MemoryStore's ledger prune wedged behind an out-of-order young row
- config generation hashed with DefaultHasher (not stable across rustc), so a
mixed-build fleet would miss the shared cache; sha256 now, builder pinned
- Redis QPS used ceil() where the in-process limiter rounds; negative
quotas/qps/qpm are rejected at config load; the in-process failure streak
decays after an hour idle like the Redis backend's TTL
Modernization and hygiene: rust-version 1.88 (let-chains were already in use),
resolver 3, unmaintained serde_yaml replaced by serde-saphyr, yanked spin
bumped, account slots shared via Arc instead of cloned per request, the
one-caller response-transform DSL replaced by a direct conversion, SSE decoder
and buffered drains bounded against unbounded peers, OpenAI/Anthropic usage
now carry cache/reasoning detail on the wire, docs re-synced to the code, and
regression tests pin every fix above plus an e2e erasure round trip.
Verified: 329 tests green on macOS and on Linux (rust:1.94, live PG/Redis);
bench A/B on bare metal: small-chat p50 and request-clone unchanged,
concurrent throughput up ~3%, big-payload p50 +14% traced to x86 codegen
drift (bisect halves it with no per-byte change present; arm64 shows parity).1 parent dd0b04d commit cc5acd6
57 files changed
Lines changed: 1617 additions & 1018 deletions
File tree
- crates
- config
- src
- consts/src
- dag/src
- engines
- src
- tests
- handler/src
- models/src
- protocol/src
- server
- src
- tests
- common
- state/src
- task
- src
- views/src
- deploy
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments