Skip to content

Commit 91d5a92

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into zai-coding-plan-glm-anthropic
2 parents 390213b + 57bd47a commit 91d5a92

File tree

46 files changed

+451
-234
lines changed

Some content is hidden

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

46 files changed

+451
-234
lines changed

.github/workflows/update-nix-hashes.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,25 @@ jobs:
4141
- name: Update flake.lock
4242
run: |
4343
set -euo pipefail
44+
echo "📦 Updating flake.lock..."
4445
nix flake update
46+
echo "✅ flake.lock updated successfully"
4547
4648
- name: Update node_modules hash
4749
run: |
4850
set -euo pipefail
51+
echo "🔄 Updating node_modules hash..."
4952
nix/scripts/update-hashes.sh
53+
echo "✅ node_modules hash updated successfully"
5054
5155
- name: Commit hash changes
5256
env:
5357
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
5458
run: |
5559
set -euo pipefail
5660
61+
echo "🔍 Checking for changes in tracked Nix files..."
62+
5763
summarize() {
5864
local status="$1"
5965
{
@@ -71,16 +77,24 @@ jobs:
7177
FILES=(flake.lock flake.nix nix/node-modules.nix nix/hashes.json)
7278
STATUS="$(git status --short -- "${FILES[@]}" || true)"
7379
if [ -z "$STATUS" ]; then
80+
echo "✅ No changes detected. Hashes are already up to date."
7481
summarize "no changes"
75-
echo "No changes to tracked Nix files. Hashes are already up to date."
7682
exit 0
7783
fi
7884
85+
echo "📝 Changes detected:"
86+
echo "$STATUS"
87+
echo "🔗 Staging files..."
7988
git add "${FILES[@]}"
89+
echo "💾 Committing changes..."
8090
git commit -m "Update Nix flake.lock and hashes"
91+
echo "✅ Changes committed"
8192
8293
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
94+
echo "🌳 Pulling latest from branch: $BRANCH"
8395
git pull --rebase origin "$BRANCH"
96+
echo "🚀 Pushing changes to branch: $BRANCH"
8497
git push origin HEAD:"$BRANCH"
98+
echo "✅ Changes pushed successfully"
8599
86100
summarize "committed $(git rev-parse --short HEAD)"

.opencode/command/commit.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
description: Git commit and push
3-
subtask: true
43
---
54

65
commit and push

.opencode/opencode.jsonc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "https://opencode.ai/config.json",
33
"plugin": ["opencode-openai-codex-auth"],
4-
"enterprise": {
5-
"url": "http://localhost:3000",
6-
},
4+
// "enterprise": {
5+
// "url": "http://localhost:3000",
6+
// },
77
"provider": {
88
"opencode": {
99
"options": {

STATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,4 @@
150150
| 2025-11-22 | 837,269 (+10,960) | 780,996 (+11,689) | 1,618,265 (+22,649) |
151151
| 2025-11-23 | 846,609 (+9,340) | 795,069 (+14,073) | 1,641,678 (+23,413) |
152152
| 2025-11-24 | 856,733 (+10,124) | 804,033 (+8,964) | 1,660,766 (+19,088) |
153+
| 2025-11-25 | 869,423 (+12,690) | 817,339 (+13,306) | 1,686,762 (+25,996) |

bun.lock

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

flake.lock

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

nix/hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"nodeModules": "sha256-m7hL9Uzqk+oa2/FtgkzEPgi+m/VZP1SvjpgYHNjiS1c="
2+
"nodeModules": "sha256-EikMl2CESyJpTT48CGq8xr/N+WTkvCj05N6enXQmRbI="
33
}

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.108",
3+
"version": "1.0.110",
44
"type": "module",
55
"scripts": {
66
"typecheck": "tsgo --noEmit",

packages/console/app/src/routes/zen/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Legal } from "~/component/legal"
1818
import { Footer } from "~/component/footer"
1919
import { Header } from "~/component/header"
2020
import { getLastSeenWorkspaceID } from "../workspace/common"
21-
import { IconGemini } from "~/component/icon"
21+
import { IconGemini, IconZai } from "~/component/icon"
2222

2323
const checkLoggedIn = query(async () => {
2424
"use server"
@@ -116,6 +116,9 @@ export default function Home() {
116116
/>
117117
</svg>
118118
</div>
119+
<div>
120+
<IconZai width="24" height="24" />
121+
</div>
119122
</div>
120123
<a href="/auth">
121124
<span>Get started with Zen </span>

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function handler(
6666
await rateLimiter?.check()
6767

6868
const retriableRequest = async (retry: RetryOptions = { excludeProviders: [], retryCount: 0 }) => {
69-
const providerInfo = selectProvider(zenData, modelInfo, ip, retry)
69+
const providerInfo = selectProvider(zenData, modelInfo, sessionId, retry)
7070
const authInfo = await authenticate(modelInfo, providerInfo)
7171
validateBilling(authInfo, modelInfo)
7272
validateModelSettings(authInfo)
@@ -275,7 +275,7 @@ export async function handler(
275275
return { id: modelId, ...modelData }
276276
}
277277

278-
function selectProvider(zenData: ZenData, modelInfo: ModelInfo, ip: string, retry: RetryOptions) {
278+
function selectProvider(zenData: ZenData, modelInfo: ModelInfo, sessionId: string, retry: RetryOptions) {
279279
const provider = (() => {
280280
if (retry.retryCount === MAX_RETRIES) {
281281
return modelInfo.providers.find((provider) => provider.id === modelInfo.fallbackProvider)
@@ -286,9 +286,13 @@ export async function handler(
286286
.filter((provider) => !retry.excludeProviders.includes(provider.id))
287287
.flatMap((provider) => Array<typeof provider>(provider.weight ?? 1).fill(provider))
288288

289-
// Use the last 2 characters of IP address to select a provider
290-
const lastChars = ip.slice(-2)
291-
const index = parseInt(lastChars, 16) % providers.length
289+
// Use the last 4 characters of session ID to select a provider
290+
let h = 0
291+
const l = sessionId.length
292+
for (let i = l - 4; i < l; i++) {
293+
h = (h * 31 + sessionId.charCodeAt(i)) | 0 // 32-bit int
294+
}
295+
const index = (h >>> 0) % providers.length // make unsigned + range 0..length-1
292296
return providers[index || 0]
293297
})()
294298

0 commit comments

Comments
 (0)