Repository navigation
Commit f5aa3e1
committed
fix(bedrock): fail closed on unlisted models and unpriced 1h tiers
What:
- bedrock: clear `promptCacheTtlSupport` in the `guessModelInfoFromId` fallback.
The fallback spreads `bedrockModels[bedrockDefaultModelId]`, which is
1h-capable, and then overlays the guess, so an id that resolves to no catalog
row inherited `["5m","1h"]` and could emit `ttl: "1h"` for a model we cannot
prove accepts it. An unlisted id is now 5m-only (ADR-0006 I2).
- bedrock-cache-ttl.spec: add the regression case for that path, and make the
tier-rate invariant fail when a tier reprices `inputPrice` without a
`cacheWritesPrice1h` instead of skipping it.
Why:
CodeRabbit round 1 on PR #2270, threads KJYW (Major) and KJYK (Minor). The
KJYW premise is real: a custom inference-profile ARN naming an unlisted model
(for example `us.anthropic.claude-3-5-sonnet-20241022-v1:0`, which has no
catalog row) produced `ttlSupport: ["5m","1h"]` on head. Bedrock answers an
unsupported ttl with a ValidationException that kills the turn, so this was a
turn-breaking path rather than a pricing nit.
Impact:
No change for the 48 catalog rows or for any listed ARN, inference profile, or
prompt-router path: only the unresolvable-id fallback loses capability. The
tier guard is a test-only tightening that currently passes on all four tiers.
Red-on-head: with the production hunk reverted and the new test kept,
`bedrock-cache-ttl.spec.ts` fails exactly one case ("emits no ttl for an
unlisted model that the heuristic fallback guesses") and passes the other 24.
With the tier guard reverted and a tier 1h rate temporarily removed from the
catalog, the catalog invariant fails on `anthropic.claude-sonnet-4-6 tier 0`.1 parent 281c22a commit f5aa3e1
2 files changed
Lines changed: 39 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
317 | 337 | | |
318 | 338 | | |
319 | 339 | | |
| |||
538 | 558 | | |
539 | 559 | | |
540 | 560 | | |
541 | | - | |
542 | | - | |
543 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
544 | 572 | | |
545 | 573 | | |
546 | 574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1256 | 1253 | | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
| |||
0 commit comments