Skip to content

Commit 5e8b15c

Browse files
shuv1337code-yeongyuactions-userwsx99outlookFrank
authored
sync: merge upstream v1.0.133 (#87)
* fix: ensure checkUpgrade sets `init:` (anomalyco#5040) * chore: format code * ci: use blacksmith runners in review workflow too (anomalyco#5042) * zen: make session provider sticky * ci: only maintainer can trigger * ci: cleaner * ignore: update download stats 2025-12-04 * fix(tui): cursor color * Preserve prompt input when creating new session (anomalyco#4993) * fix: model not being passed correctly to tool * tweak: bash tool messages regarding timeouts and truncation more clear for agent (anomalyco#5066) * tui: fix /new slash command being persisted in prompt input * add optional prompt Input to Github Action (anomalyco#4828) Co-authored-by: Github Action <action@github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * bump: builtin plugin versions * feat: Add SAP AI Core provider support (anomalyco#5023) Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org> * core: ensure model npm package falls back to dev models config when not explicitly defined * docs: add CodeCompanion.nvim integration instructions (anomalyco#5079) * tweak: bash tool description re commit stuff * core: add test for custom model npm package inheritance * feat(desktop): terminal pane (anomalyco#5081) Co-authored-by: Github Action <action@github.com> Co-authored-by: Dax Raad <d@ironbay.co> * Revert "feat(desktop): terminal pane (anomalyco#5081)" This reverts commit d763c11. * release: v1.0.133 * sync: record last synced tag v1.0.133 --------- Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org> Co-authored-by: YeonGyu-Kim <code.yeon.gyu@gmail.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: wsx99outlook <247713593+wsx99outlook@users.noreply.github.com> Co-authored-by: Frank <frank@sst.dev> Co-authored-by: Aiden Cline <aidenpcline@gmail.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: Daniel Gray <DanielFGray@gmail.com> Co-authored-by: Shantur Rathore <i@shantur.com> Co-authored-by: Daniel Polito <danielbpolito@gmail.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Jérôme Benoit <jerome.benoit@piment-noir.org> Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: Cason Adams <casonadams@gmail.com> Co-authored-by: opencode <opencode@sst.dev>
1 parent 2b44c14 commit 5e8b15c

45 files changed

Lines changed: 344 additions & 119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/last-synced-tag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.132
1+
v1.0.133

.github/workflows/review.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,20 @@
11
name: Guidelines Check
22

33
on:
4-
pull_request_target:
5-
types: [opened, ready_for_review]
64
issue_comment:
75
types: [created]
86

97
jobs:
108
check-guidelines:
119
if: |
12-
(github.event_name == 'pull_request_target' &&
13-
github.event.pull_request.draft == false) ||
14-
(github.event_name == 'issue_comment' &&
15-
github.event.issue.pull_request &&
16-
startsWith(github.event.comment.body, '/review'))
17-
runs-on: ubuntu-latest
10+
github.event.issue.pull_request &&
11+
startsWith(github.event.comment.body, '/review') &&
12+
contains(fromJson('["OWNER","MEMBER"]'), github.event.comment.author_association)
13+
runs-on: blacksmith-4vcpu-ubuntu-2404
1814
permissions:
1915
contents: read
2016
pull-requests: write
2117
steps:
22-
- name: Check if user has write permission
23-
if: github.event_name == 'issue_comment'
24-
run: |
25-
PERMISSION=$(gh api /repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission --jq '.permission')
26-
if [[ "$PERMISSION" != "write" && "$PERMISSION" != "admin" ]]; then
27-
echo "User does not have write permission"
28-
exit 1
29-
fi
30-
env:
31-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
3318
- name: Get PR number
3419
id: pr-number
3520
run: |

STATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,4 @@
159159
| 2025-12-01 | 925,898 (+9,782) | 876,500 (+6,306) | 1,802,398 (+16,088) |
160160
| 2025-12-02 | 939,250 (+13,352) | 890,919 (+14,419) | 1,830,169 (+27,771) |
161161
| 2025-12-03 | 952,249 (+12,999) | 903,713 (+12,794) | 1,855,962 (+25,793) |
162+
| 2025-12-04 | 965,611 (+13,362) | 916,471 (+12,758) | 1,882,082 (+26,120) |

bun.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: "Share the opencode session (defaults to true for public repos)"
1414
required: false
1515

16+
prompt:
17+
description: "Custom prompt to override the default prompt"
18+
required: false
19+
1620
runs:
1721
using: "composite"
1822
steps:
@@ -26,5 +30,6 @@ runs:
2630
env:
2731
MODEL: ${{ inputs.model }}
2832
SHARE: ${{ inputs.share }}
33+
PROMPT: ${{ inputs.prompt }}
2934
OPENCODE_BIN_PATH: ${{ github.workspace }}/packages/opencode/dist/shuvcode-linux-x64/bin/opencode
3035
run: bun packages/opencode/bin/opencode github run

packages/console/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/console-app",
3-
"version": "1.0.132",
3+
"version": "1.0.133",
44
"type": "module",
55
"scripts": {
66
"typecheck": "tsgo --noEmit",

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { oaCompatHelper } from "./provider/openai-compatible"
2121
import { createRateLimiter } from "./rateLimiter"
2222
import { createDataDumper } from "./dataDumper"
2323
import { createTrialLimiter } from "./trialLimiter"
24+
import { createStickyTracker } from "./stickyProviderTracker"
2425

2526
type ZenData = Awaited<ReturnType<typeof ZenData.list>>
2627
type RetryOptions = {
@@ -68,9 +69,11 @@ export async function handler(
6869
const isTrial = await trialLimiter?.isTrial()
6970
const rateLimiter = createRateLimiter(modelInfo.id, modelInfo.rateLimit, ip)
7071
await rateLimiter?.check()
72+
const stickyTracker = createStickyTracker(modelInfo.stickyProvider ?? false, sessionId)
73+
const stickyProvider = await stickyTracker?.get()
7174

7275
const retriableRequest = async (retry: RetryOptions = { excludeProviders: [], retryCount: 0 }) => {
73-
const providerInfo = selectProvider(zenData, modelInfo, sessionId, isTrial ?? false, retry)
76+
const providerInfo = selectProvider(zenData, modelInfo, sessionId, isTrial ?? false, retry, stickyProvider)
7477
const authInfo = await authenticate(modelInfo, providerInfo)
7578
validateBilling(authInfo, modelInfo)
7679
validateModelSettings(authInfo)
@@ -121,6 +124,9 @@ export async function handler(
121124
dataDumper?.provideModel(providerInfo.storeModel)
122125
dataDumper?.provideRequest(reqBody)
123126

127+
// Store sticky provider
128+
await stickyTracker?.set(providerInfo.id)
129+
124130
// Scrub response headers
125131
const resHeaders = new Headers()
126132
const keepHeaders = ["content-type", "cache-control"]
@@ -289,12 +295,18 @@ export async function handler(
289295
sessionId: string,
290296
isTrial: boolean,
291297
retry: RetryOptions,
298+
stickyProvider: string | undefined,
292299
) {
293300
const provider = (() => {
294301
if (isTrial) {
295302
return modelInfo.providers.find((provider) => provider.id === modelInfo.trial!.provider)
296303
}
297304

305+
if (stickyProvider) {
306+
const provider = modelInfo.providers.find((provider) => provider.id === stickyProvider)
307+
if (provider) return provider
308+
}
309+
298310
if (retry.retryCount === MAX_RETRIES) {
299311
return modelInfo.providers.find((provider) => provider.id === modelInfo.fallbackProvider)
300312
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Resource } from "@opencode-ai/console-resource"
2+
3+
export function createStickyTracker(stickyProvider: boolean, session: string) {
4+
if (!stickyProvider) return
5+
if (!session) return
6+
const key = `sticky:${session}`
7+
8+
return {
9+
get: async () => {
10+
return await Resource.GatewayKv.get(key)
11+
},
12+
set: async (providerId: string) => {
13+
await Resource.GatewayKv.put(key, providerId, { expirationTtl: 86400 })
14+
},
15+
}
16+
}

packages/console/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@opencode-ai/console-core",
4-
"version": "1.0.132",
4+
"version": "1.0.133",
55
"private": true,
66
"type": "module",
77
"dependencies": {

packages/console/core/src/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export namespace ZenData {
2424
cost: ModelCostSchema,
2525
cost200K: ModelCostSchema.optional(),
2626
allowAnonymous: z.boolean().optional(),
27+
stickyProvider: z.boolean().optional(),
2728
trial: z
2829
.object({
2930
limit: z.number(),

0 commit comments

Comments
 (0)