Skip to content

Commit 8bb6513

Browse files
Merge branch 'dev' into fix-env-caching-12698
2 parents 86c862d + 62bd023 commit 8bb6513

22 files changed

Lines changed: 549 additions & 66311 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
- build-cli
115115
- version
116116
runs-on: blacksmith-4vcpu-windows-2025
117-
if: github.repository == 'anomalyco/opencode' && github.ref_name != 'beta'
117+
if: github.repository == 'anomalyco/opencode'
118118
env:
119119
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
120120
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
@@ -213,7 +213,6 @@ jobs:
213213
needs:
214214
- build-cli
215215
- version
216-
if: github.ref_name != 'beta'
217216
continue-on-error: false
218217
env:
219218
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
@@ -390,7 +389,7 @@ jobs:
390389
needs:
391390
- build-cli
392391
- version
393-
if: github.repository == 'anomalyco/opencode' && github.ref_name != 'beta'
392+
if: github.repository == 'anomalyco/opencode'
394393
continue-on-error: false
395394
env:
396395
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
@@ -591,13 +590,12 @@ jobs:
591590
path: packages/opencode/dist
592591

593592
- uses: actions/download-artifact@v4
594-
if: github.ref_name != 'beta'
595593
with:
596594
name: opencode-cli-signed-windows
597595
path: packages/opencode/dist
598596

599597
- uses: actions/download-artifact@v4
600-
if: needs.version.outputs.release && github.ref_name != 'beta'
598+
if: needs.version.outputs.release
601599
with:
602600
pattern: latest-yml-*
603601
path: /tmp/latest-yml

bun.lock

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

nix/hashes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-fNRQYkucjXr1D61HJRScJpDa6+oBdyhgTBxCu+PE2kQ=",
4-
"aarch64-linux": "sha256-V8J6kn2nSdXrplyqi6aIqNlHcVjSxvye+yC/YFO7PF4=",
5-
"aarch64-darwin": "sha256-6cLmUJVUycGALCmslXuloVGBSlFOSHRjsWjx7KOW8rg=",
6-
"x86_64-darwin": "sha256-kcOSO3NFIJh79ylLotG41ovWLQfH5kh1WYFghUu+4HE="
3+
"x86_64-linux": "sha256-g29OM3dy+sZ3ioTs8zjQOK1N+KnNr9ptP9xtdPcdr64=",
4+
"aarch64-linux": "sha256-Iu91KwDcV5omkf4Ngny1aYpyCkPLjuoWOVUDOJUhW1k=",
5+
"aarch64-darwin": "sha256-bk3G6m+Yo60Ea3Kyglc37QZf5Vm7MLMFcxemjc7HnL0=",
6+
"x86_64-darwin": "sha256-y3hooQw13Z3Cu0KFfXYdpkTEeKTyuKd+a/jsXHQLdqA="
77
}
88
}

packages/app/src/pages/layout/sidebar-workspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ const WorkspaceSessionList = (props: {
274274
<div class="relative w-full py-1">
275275
<Button
276276
variant="ghost"
277-
class="flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10"
277+
class="flex w-full text-left justify-start text-14-regular text-text-weak pl-2 pr-10"
278278
size="large"
279279
onClick={(e: MouseEvent) => {
280280
props.loadMore()

packages/app/src/pages/session/message-timeline.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,10 @@ export function MessageTimeline(props: {
642642
onClick={props.onResumeScroll}
643643
>
644644
<div
645-
class="flex items-center justify-center w-8 h-6 rounded-[6px] border border-[var(--gray-dark-7)] bg-[color-mix(in_srgb,var(--gray-dark-3)_80%,transparent)] backdrop-blur-[0.75px] transition-colors group-hover:border-[var(--gray-dark-8)] [--icon-base:var(--gray-dark-10)] group-hover:[--icon-base:var(--gray-dark-11)]"
645+
class="flex items-center justify-center w-8 h-6 rounded-[6px] border border-border-weaker-base bg-[color-mix(in_srgb,var(--surface-raised-stronger-non-alpha)_80%,transparent)] backdrop-blur-[0.75px] transition-colors group-hover:border-[var(--border-weak-base)] group-hover:[--icon-base:var(--icon-hover)]"
646646
style={{
647647
"box-shadow":
648-
"0 51px 60px 0 rgba(0,0,0,0.13), 0 15.375px 18.088px 0 rgba(0,0,0,0.19), 0 6.386px 7.513px 0 rgba(0,0,0,0.25), 0 2.31px 2.717px 0 rgba(0,0,0,0.38)",
648+
"0 51px 60px 0 rgba(0,0,0,0.10), 0 15px 18px 0 rgba(0,0,0,0.12), 0 6.386px 7.513px 0 rgba(0,0,0,0.12), 0 2.31px 2.717px 0 rgba(0,0,0,0.20)",
649649
}}
650650
>
651651
<Icon name="arrow-down-to-line" size="small" />

packages/desktop-electron/src/main/windows.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function createMainWindow(globals: Globals) {
6666
y: state.y,
6767
width: state.width,
6868
height: state.height,
69-
show: true,
69+
show: false,
7070
title: "OpenCode",
7171
icon: iconPath(),
7272
backgroundColor,
@@ -94,6 +94,10 @@ export function createMainWindow(globals: Globals) {
9494
wireZoom(win)
9595
injectGlobals(win, globals)
9696

97+
win.once("ready-to-show", () => {
98+
win.show()
99+
})
100+
97101
return win
98102
}
99103

packages/opencode/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,11 @@
1414
"fix-node-pty": "bun run script/fix-node-pty.ts",
1515
"upgrade-opentui": "bun run script/upgrade-opentui.ts",
1616
"dev": "bun run --conditions=browser ./src/index.ts",
17-
"random": "echo 'Random script updated at $(date)' && echo 'Change queued successfully' && echo 'Another change made' && echo 'Yet another change' && echo 'One more change' && echo 'Final change' && echo 'Another final change' && echo 'Yet another final change'",
18-
"clean": "echo 'Cleaning up...' && rm -rf node_modules dist",
19-
"lint": "echo 'Running lint checks...' && bun test --coverage",
20-
"format": "echo 'Formatting code...' && bun run --prettier --write src/**/*.ts",
21-
"docs": "echo 'Generating documentation...' && find src -name '*.ts' -exec echo 'Processing: {}' \\;",
22-
"deploy": "echo 'Deploying application...' && bun run build && echo 'Deployment completed successfully'",
2317
"db": "bun drizzle-kit"
2418
},
2519
"bin": {
2620
"opencode": "./bin/opencode"
2721
},
28-
"randomField": "this-is-a-random-value-12345",
2922
"exports": {
3023
"./*": "./src/*.ts"
3124
},
@@ -83,6 +76,7 @@
8376
"@actions/core": "1.11.1",
8477
"@actions/github": "6.0.1",
8578
"@agentclientprotocol/sdk": "0.16.1",
79+
"@ai-sdk/alibaba": "1.0.17",
8680
"@ai-sdk/amazon-bedrock": "4.0.93",
8781
"@ai-sdk/anthropic": "3.0.67",
8882
"@ai-sdk/azure": "3.0.49",

packages/opencode/src/cli/cmd/providers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string,
148148
}
149149

150150
if (method.type === "api") {
151+
const key = await prompts.password({
152+
message: "Enter your API key",
153+
validate: (x) => (x && x.length > 0 ? undefined : "Required"),
154+
})
155+
if (prompts.isCancel(key)) throw new UI.CancelledError()
156+
151157
if (method.authorize) {
152158
const result = await method.authorize(inputs)
153159
if (result.type === "failed") {
@@ -157,7 +163,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string,
157163
const saveProvider = result.provider ?? provider
158164
await Auth.set(saveProvider, {
159165
type: "api",
160-
key: result.key,
166+
key: result.key ?? key,
161167
})
162168
prompts.log.success("Login successful")
163169
}

packages/opencode/src/plugin/github-copilot/copilot.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { iife } from "@/util/iife"
55
import { Log } from "../../util/log"
66
import { setTimeout as sleep } from "node:timers/promises"
77
import { CopilotModels } from "./models"
8+
import { MessageV2 } from "@/session/message-v2"
89

910
const log = Log.create({ service: "plugin.copilot" })
1011

@@ -27,6 +28,21 @@ function base(enterpriseUrl?: string) {
2728
return enterpriseUrl ? `https://copilot-api.${normalizeDomain(enterpriseUrl)}` : "https://api.githubcopilot.com"
2829
}
2930

31+
// Check if a message is a synthetic user msg used to attach an image from a tool call
32+
function imgMsg(msg: any): boolean {
33+
if (msg?.role !== "user") return false
34+
35+
// Handle the 3 api formats
36+
37+
const content = msg.content
38+
if (typeof content === "string") return content === MessageV2.SYNTHETIC_ATTACHMENT_PROMPT
39+
if (!Array.isArray(content)) return false
40+
return content.some(
41+
(part: any) =>
42+
(part?.type === "text" || part?.type === "input_text") && part.text === MessageV2.SYNTHETIC_ATTACHMENT_PROMPT,
43+
)
44+
}
45+
3046
function fix(model: Model, url: string): Model {
3147
return {
3248
...model,
@@ -90,7 +106,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
90106
(msg: any) =>
91107
Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"),
92108
),
93-
isAgent: last?.role !== "user",
109+
isAgent: last?.role !== "user" || imgMsg(last),
94110
}
95111
}
96112

@@ -102,7 +118,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
102118
(item: any) =>
103119
Array.isArray(item?.content) && item.content.some((part: any) => part.type === "input_image"),
104120
),
105-
isAgent: last?.role !== "user",
121+
isAgent: last?.role !== "user" || imgMsg(last),
106122
}
107123
}
108124

@@ -124,7 +140,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
124140
part.content.some((nested: any) => nested?.type === "image")),
125141
),
126142
),
127-
isAgent: !(last?.role === "user" && hasNonToolCalls),
143+
isAgent: !(last?.role === "user" && hasNonToolCalls) || imgMsg(last),
128144
}
129145
}
130146
} catch {}

packages/opencode/src/provider/models-snapshot.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)