GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(bedrock): add prompt caching support for custom ARNs and inference profiles by marcelloceschia · Pull Request #2 · marcelloceschia/opencode

Conversation

@marcelloceschia

@marcelloceschia marcelloceschia commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Enable prompt caching for Bedrock models that support it (Claude, Nova)
  • Add 'caching' option for custom ARNs/inference profiles without claude in name
  • Disable caching for Llama, Mistral, Cohere models (not supported)
  • Add comprehensive tests for all caching scenarios

Fixes: Prompt cache not supported for custom ARN models
Fixes: 1M context window not configurable

What changed

Resolved merge conflict with latest dev branch by:

  • Merging origin/dev into fix/bedrock-prompt-caching-custom-arn
  • Keeping CacheFormat/Caching types and source/filepath/ttl refactor
  • Combining Anthropic + Bedrock caching logic with google-vertex-anthropic and nova support

Test Plan

  • Local testing verified caching works with Grafana dashboard

Closes anomalyco#16504 (supersedes original PR with re-sync)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
marcelloceschia and others added 30 commits March 7, 2026 17:53
@marcelloceschia
feat(bedrock): add prompt caching support for custom ARNs and inferen…
e349074
…ce profiles

- Enable prompt caching for Bedrock models that support it (Claude, Nova)
- Add 'caching' option for custom ARNs/inference profiles without claude in name
- Disable caching for Llama, Mistral, Cohere models (not supported)
- Add comprehensive tests for all caching scenarios

Fixes #1: Prompt cache not supported for custom ARN models
Fixes #2: 1M context window not configurable

Users can now configure custom ARNs like:
```json
{
  "provider": {
    "amazon-bedrock": {
      "models": {
        "arn:aws:bedrock:...:application-inference-profile/xxx": {
          "options": { "caching": true },
          "limit": { "context": 1000000, "output": 32000 }
        }
      }
    }
  }
}
```
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
e998ee6
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
8e6fdc1
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
9d56df5
@rekram1-node
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
3013032
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
2a82170
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
96fbf63
@marcelloceschia
feat(provider): add explicit caching configuration for prompt caching
68fd00d
- Add 'caching' field to Model schema with support for:
  - Boolean (true/false to enable/disable)
  - Object with 'format' and 'positions' options
- No auto-detection - caching is opt-in via model config
- Cache formats: anthropic, openrouter, bedrock, openaiCompatible
- Configurable cache positions: system, first, last

Example configuration:
```json
{
  "provider": {
    "kiro": {
      "models": {
        "claude-sonnet-4-5": {
          "caching": true
        }
      }
    }
  }
}
```

This enables prompt caching for models through kiro-gateway and
other OpenAI-compatible providers.
@marcelloceschia
Merge branch 'anomalyco:dev' into fix/bedrock-prompt-caching-custom-arn
4138895
@marcelloceschia
Merge branch 'anomalyco:dev' into fix/bedrock-prompt-caching-custom-arn
8426f2b
@marcelloceschia
Merge branch 'anomalyco:dev' into fix/bedrock-prompt-caching-custom-arn
3cc08de
@marcelloceschia
Merge branch 'anomalyco:dev' into fix/bedrock-prompt-caching-custom-arn
1c93aa6
@marcelloceschia
fix(bedrock): restore auto-detection for Claude/Nova and add options.…
68406c1
…caching support

- Re-add copilot to providerOptions (was accidentally removed)
- Add auto-detection for Bedrock Claude/Nova models (unless options.caching=false)
- Support explicit options.caching=true for custom ARNs
- Respect options.caching=false to disable caching on Anthropic models
- Fixes test failures from PR anomalyco#16504
@marcelloceschia
Merge upstream/dev into fix/bedrock-prompt-caching-custom-arn
7a09b5f
@marcelloceschia
Merge branch 'anomalyco:dev' into fix/bedrock-prompt-caching-custom-arn
0a71da2
@marcelloceschia
Merge branch 'dev' into fix/bedrock-prompt-caching-custom-arn
81e0072
@thdxr
refactor(session): simplify LLM stream by replacing queue with fromAs…
567a911
…yncIterable (anomalyco#20324)
opencode
release: v1.3.11
beab4cc
@rekram1-node
fix: rm exclusion of ai-sdk/azure in transform.ts, when we migrated t…
4dd866d
…o v6 the ai sdk changed the key for ai-sdk/azure so the exclusion is no longer needed (anomalyco#20326)
@major
feat: enable prompt caching and cache token tracking for google-verte…
26cc924
…x-anthropic (anomalyco#20266)

Signed-off-by: Major Hayden <[email protected]>
@github-actions
Update VOUCHED list
d6d4446
anomalyco#20342 (comment)
@kommander
upgrade opentui to 0.1.94 (anomalyco#20357)
1812130
opencode
release: v1.3.12
892bdeb
@github-actions opencode
Update VOUCHED list
53330a5
anomalyco#20333 (comment)
@kitlangton
test: migrate prompt tests to HTTP mock LLM server (anomalyco#20304)
0c03a3e
@kitlangton
refactor(session): effectify SessionSummary service (anomalyco#20142)
954a6ca
@kitlangton
refactor(session): effectify SessionRevert service (anomalyco#20143)
3fc0367
@opencode-agent
chore: generate
9b09a7e
@opencode-agent
chore: update nix node_modules hashes
4280307
@kommander
upgrade opentui to 0.1.95 (anomalyco#20369)
4b4b783
adamdotdevin and others added 27 commits April 7, 2026 11:06
@adamdotdevin
feat(app): better subagent experience (anomalyco#20708)
ec8b981
@jlongster
refactor(core): support multiple event streams in worker and remove w…
5d48e7b
…orkspaces from plugin api (anomalyco#21348)
@ariane-emory @rekram1-node
fix(tui): use sentence case for theme mode command palette items (ano…
2549a38
…malyco#21192)

Co-authored-by: Aiden Cline <[email protected]>
@rekram1-node
fix: ensure the alibaba provider errors are retried (anomalyco#21355)
81bdffc
@kitlangton
fix(opencode): improve console login transport errors (anomalyco#21350)
d83fe4b
@opencode-agent
chore: generate
6bfa82d
@ariane-emory @rekram1-node
feat(tui): allow variant_list keybind for the "Switch model variant" …
e945436
…command (anomalyco#21185)

Co-authored-by: Aiden Cline <[email protected]>
@altendky
test: disable GPG signing in test fixtures (anomalyco#20386)
095aeba
@rekram1-node
fix(opencode): clear webfetch timeouts on failed fetches (anomalyco#2…
bc1840b
…1378)
@thdxr
feat(opencode): add OTLP observability support (anomalyco#21387)
c90fc6a
@fwang
zen: glm5.1 doc
9385714
@fwang
zen: glm5.1 doc
c589724
@fwang
go: glm5.1
7afb517
@thdxr
core: refactor tool system to remove agent context from initialization (
4633184
anomalyco#21052)
@thdxr @adamdotdevin
refactor(snapshot): store unified patches in file diffs (anomalyco#21244
b7fab49
)

Co-authored-by: Adam <[email protected]>
@opencode-agent
chore: generate
0788a53
opencode
release: v1.4.0
98325dc
@opencode-agent opencode
chore: update nix node_modules hashes
65cde7f
@kitlangton @opencode-agent
fix(tui): simplify console org display (anomalyco#21339)
ae614d9
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
@Brendonovich
ui: fix sticky session diffs header (anomalyco#21486)
988c989
@rekram1-node @opencode-agent
test: update webfetch test (anomalyco#21398)
cd87d4f
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
@rekram1-node
fix: ensure that /providers list and shell endpoints are correctly ty…
039c601
…ped in sdk and openapi schema (anomalyco#21543)
@adamdotdevin
fix(app): patch tool diff rendering
d98be39
@adamdotdevin
fix(app): diff list normalization
689b1a4
@rekram1-node
fix: dont show invalid variants for BP (anomalyco#21555)
00cb883
@rekram1-node
tweak: separate ModelsDev.Model and Config model schemas (anomalyco#2…
4961d72
…1561)
@marcelloceschia
Merge origin/dev into fix/bedrock-prompt-caching-custom-arn
a561c76
Resolve conflicts in:
- provider/models.ts: Keep CacheFormat/Caching types, source/filepath/ttl
  refactor, options, headers, variants, caching fields
- provider/transform.ts: Combine Anthropic + Bedrock caching logic
  with google-vertex-anthropic and nova support
@github-actions github-actions Bot added the needs:compliance label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcelloceschia marcelloceschia closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs:compliance

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

20 participants

@marcelloceschia @rekram1-node @thdxr @major @kommander @kitlangton @Brendonovich @nexxeln @fwang @JosXa @Hona @mchenco @valenvivaldi @aaron-he-zhu @dpuyosa @noamzbr @BYK @MrMushrooooom @lennyvaknine43 @ykswang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.