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 — fix: ensure anthropic models on OR also have variant support (#13498) · lytedev/opencode@839c5cd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bun.lock
  • package.json
  • packages/opencode/src/provider
    • transform.ts
  • patches
    • @openrouter%[email protected]
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bun.lock‎

Copy file name to clipboardExpand all lines: bun.lock
+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"@types/node": "catalog:"
104104
},
105105
"patchedDependencies": {
106-
"@standard-community/[email protected]": "patches/@standard-community%[email protected]"
106+
"@standard-community/[email protected]": "patches/@standard-community%[email protected]",
107+
"@openrouter/[email protected]": "patches/@openrouter%[email protected]"
107108
}
108109
}
Collapse file

‎packages/opencode/src/provider/transform.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/provider/transform.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export namespace ProviderTransform {
361361

362362
switch (model.api.npm) {
363363
case "@openrouter/ai-sdk-provider":
364-
if (!model.id.includes("gpt") && !model.id.includes("gemini-3")) return {}
364+
if (!model.id.includes("gpt") && !model.id.includes("gemini-3") && !model.id.includes("claude")) return {}
365365
return Object.fromEntries(OPENAI_EFFORTS.map((effort) => [effort, { reasoning: { effort } }]))
366366

367367
case "@ai-sdk/gateway":
@@ -763,6 +763,9 @@ export namespace ProviderTransform {
763763
result["promptCacheKey"] = input.sessionID
764764
}
765765

766+
if (input.model.providerID === "openrouter") {
767+
result["prompt_cache_key"] = input.sessionID
768+
}
766769
if (input.model.api.npm === "@ai-sdk/gateway") {
767770
result["gateway"] = {
768771
caching: "auto",
Collapse file

‎patches/@openrouter%[email protected]‎

Copy file name to clipboard
+128Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index f33510a50d11a2cb92a90ea70cc0ac84c89f29b9..e887a60352c0c08ab794b1e6821854dfeefd20cc 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -2110,7 +2110,12 @@ var OpenRouterChatLanguageModel = class {
6+
if (reasoningStarted && !textStarted) {
7+
controller.enqueue({
8+
type: "reasoning-end",
9+
- id: reasoningId || generateId()
10+
+ id: reasoningId || generateId(),
11+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
12+
+ openrouter: {
13+
+ reasoning_details: accumulatedReasoningDetails
14+
+ }
15+
+ } : undefined
16+
});
17+
reasoningStarted = false;
18+
}
19+
@@ -2307,7 +2312,12 @@ var OpenRouterChatLanguageModel = class {
20+
if (reasoningStarted) {
21+
controller.enqueue({
22+
type: "reasoning-end",
23+
- id: reasoningId || generateId()
24+
+ id: reasoningId || generateId(),
25+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
26+
+ openrouter: {
27+
+ reasoning_details: accumulatedReasoningDetails
28+
+ }
29+
+ } : undefined
30+
});
31+
}
32+
if (textStarted) {
33+
diff --git a/dist/index.mjs b/dist/index.mjs
34+
index 8a688331b88b4af738ee4ca8062b5f24124d3d81..6310cb8b7c8d0a728d86e1eed09906c6b4c91ae2 100644
35+
--- a/dist/index.mjs
36+
+++ b/dist/index.mjs
37+
@@ -2075,7 +2075,12 @@ var OpenRouterChatLanguageModel = class {
38+
if (reasoningStarted && !textStarted) {
39+
controller.enqueue({
40+
type: "reasoning-end",
41+
- id: reasoningId || generateId()
42+
+ id: reasoningId || generateId(),
43+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
44+
+ openrouter: {
45+
+ reasoning_details: accumulatedReasoningDetails
46+
+ }
47+
+ } : undefined
48+
});
49+
reasoningStarted = false;
50+
}
51+
@@ -2272,7 +2277,12 @@ var OpenRouterChatLanguageModel = class {
52+
if (reasoningStarted) {
53+
controller.enqueue({
54+
type: "reasoning-end",
55+
- id: reasoningId || generateId()
56+
+ id: reasoningId || generateId(),
57+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
58+
+ openrouter: {
59+
+ reasoning_details: accumulatedReasoningDetails
60+
+ }
61+
+ } : undefined
62+
});
63+
}
64+
if (textStarted) {
65+
diff --git a/dist/internal/index.js b/dist/internal/index.js
66+
index d40fa66125941155ac13a4619503caba24d89f8a..8dd86d1b473f2fa31c1acd9881d72945b294a197 100644
67+
--- a/dist/internal/index.js
68+
+++ b/dist/internal/index.js
69+
@@ -2064,7 +2064,12 @@ var OpenRouterChatLanguageModel = class {
70+
if (reasoningStarted && !textStarted) {
71+
controller.enqueue({
72+
type: "reasoning-end",
73+
- id: reasoningId || generateId()
74+
+ id: reasoningId || generateId(),
75+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
76+
+ openrouter: {
77+
+ reasoning_details: accumulatedReasoningDetails
78+
+ }
79+
+ } : undefined
80+
});
81+
reasoningStarted = false;
82+
}
83+
@@ -2261,7 +2266,12 @@ var OpenRouterChatLanguageModel = class {
84+
if (reasoningStarted) {
85+
controller.enqueue({
86+
type: "reasoning-end",
87+
- id: reasoningId || generateId()
88+
+ id: reasoningId || generateId(),
89+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
90+
+ openrouter: {
91+
+ reasoning_details: accumulatedReasoningDetails
92+
+ }
93+
+ } : undefined
94+
});
95+
}
96+
if (textStarted) {
97+
diff --git a/dist/internal/index.mjs b/dist/internal/index.mjs
98+
index b0ed9d113549c5c55ea3b1e08abb3db6f92ae5a7..5695930a8e038facc071d58a4179a369a29be9c7 100644
99+
--- a/dist/internal/index.mjs
100+
+++ b/dist/internal/index.mjs
101+
@@ -2030,7 +2030,12 @@ var OpenRouterChatLanguageModel = class {
102+
if (reasoningStarted && !textStarted) {
103+
controller.enqueue({
104+
type: "reasoning-end",
105+
- id: reasoningId || generateId()
106+
+ id: reasoningId || generateId(),
107+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
108+
+ openrouter: {
109+
+ reasoning_details: accumulatedReasoningDetails
110+
+ }
111+
+ } : undefined
112+
});
113+
reasoningStarted = false;
114+
}
115+
@@ -2227,7 +2232,12 @@ var OpenRouterChatLanguageModel = class {
116+
if (reasoningStarted) {
117+
controller.enqueue({
118+
type: "reasoning-end",
119+
- id: reasoningId || generateId()
120+
+ id: reasoningId || generateId(),
121+
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
122+
+ openrouter: {
123+
+ reasoning_details: accumulatedReasoningDetails
124+
+ }
125+
+ } : undefined
126+
});
127+
}
128+
if (textStarted) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.