Skip to content

Commit f2b5bf9

Browse files
authored
Merge branch 'dev' into support-scheduled-events
2 parents 981bcd2 + ad6a5e6 commit f2b5bf9

File tree

49 files changed

+1204
-94
lines changed

Some content is hidden

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

49 files changed

+1204
-94
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ jobs:
8080
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
8181
NPM_CONFIG_PROVENANCE: false
8282
outputs:
83-
releaseId: ${{ steps.publish.outputs.releaseId }}
84-
tagName: ${{ steps.publish.outputs.tagName }}
83+
release: ${{ steps.publish.outputs.release }}
84+
tag: ${{ steps.publish.outputs.tag }}
85+
version: ${{ steps.publish.outputs.version }}
8586

8687
publish-tauri:
8788
needs: publish
@@ -103,7 +104,7 @@ jobs:
103104
- uses: actions/checkout@v3
104105
with:
105106
fetch-depth: 0
106-
ref: ${{ needs.publish.outputs.tagName }}
107+
ref: ${{ needs.publish.outputs.tag }}
107108

108109
- uses: apple-actions/import-codesign-certs@v2
109110
if: ${{ runner.os == 'macOS' }}
@@ -146,20 +147,18 @@ jobs:
146147
shared-key: ${{ matrix.settings.target }}
147148

148149
- name: Prepare
150+
if: inputs.bump || inputs.version
149151
run: |
150152
cd packages/tauri
151153
bun ./scripts/prepare.ts
152154
env:
153-
OPENCODE_BUMP: ${{ inputs.bump }}
154-
OPENCODE_VERSION: ${{ inputs.version }}
155-
OPENCODE_CHANNEL: latest
155+
OPENCODE_VERSION: ${{ needs.publish.outputs.version }}
156156
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
157157
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
158158
AUR_KEY: ${{ secrets.AUR_KEY }}
159159
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
160160
RUST_TARGET: ${{ matrix.settings.target }}
161161
GH_TOKEN: ${{ github.token }}
162-
OPENCODE_RELEASE_TAG: ${{ needs.publish.outputs.tagName }}
163162

164163
# Fixes AppImage build issues, can be removed when https://github.com/tauri-apps/tauri/pull/12491 is released
165164
- name: Install tauri-cli from portable appimage branch
@@ -189,22 +188,22 @@ jobs:
189188
tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }}
190189
args: --target ${{ matrix.settings.target }} --config src-tauri/tauri.prod.conf.json
191190
updaterJsonPreferNsis: true
192-
releaseId: ${{ needs.publish.outputs.releaseId }}
193-
tagName: ${{ needs.publish.outputs.tagName }}
191+
releaseId: ${{ needs.publish.outputs.release }}
192+
tagName: ${{ needs.publish.outputs.tag }}
194193
releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext]
195194
releaseDraft: true
196195

197196
publish-release:
198197
needs:
199198
- publish
200199
- publish-tauri
201-
if: needs.publish.outputs.tagName
200+
if: needs.publish.outputs.tag
202201
runs-on: blacksmith-4vcpu-ubuntu-2404
203202
steps:
204203
- uses: actions/checkout@v3
205204
with:
206205
fetch-depth: 0
207-
ref: ${{ needs.publish.outputs.tagName }}
206+
ref: ${{ needs.publish.outputs.tag }}
208207

209208
- uses: ./.github/actions/setup-bun
210209

@@ -221,8 +220,6 @@ jobs:
221220
222221
- run: ./script/publish-complete.ts
223222
env:
224-
OPENCODE_BUMP: ${{ inputs.bump }}
225-
OPENCODE_VERSION: ${{ inputs.version }}
223+
OPENCODE_VERSION: ${{ needs.publish.outputs.version }}
226224
AUR_KEY: ${{ secrets.AUR_KEY }}
227225
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
228-
OPENCODE_RELEASE_TAG: ${{ needs.publish.outputs.tagName }}

.github/workflows/review.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simpliest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts)
6868
6969
Use the gh cli to create comments on the files for the violations. Try to leave the comment on the exact line number. If you have a suggested fix include it in a suggestion code block.
70+
If you are writing suggested fixes, BE SURE THAT the change you are recommending is actually valid typescript, often I have seen missing closing "}" or other syntax errors.
71+
Generally, write a comment instead of writing suggested change if you can help it.
7072
7173
Command MUST be like this.
7274
\`\`\`

bun.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"packages/console/app": {
2222
"name": "@opencode-ai/console-app",
23-
"version": "1.0.176",
23+
"version": "1.0.180",
2424
"dependencies": {
2525
"@cloudflare/vite-plugin": "1.15.2",
2626
"@ibm/plex": "6.4.1",
@@ -48,7 +48,7 @@
4848
},
4949
"packages/console/core": {
5050
"name": "@opencode-ai/console-core",
51-
"version": "1.0.176",
51+
"version": "1.0.180",
5252
"dependencies": {
5353
"@aws-sdk/client-sts": "3.782.0",
5454
"@jsx-email/render": "1.1.1",
@@ -75,7 +75,7 @@
7575
},
7676
"packages/console/function": {
7777
"name": "@opencode-ai/console-function",
78-
"version": "1.0.176",
78+
"version": "1.0.180",
7979
"dependencies": {
8080
"@ai-sdk/anthropic": "2.0.0",
8181
"@ai-sdk/openai": "2.0.2",
@@ -99,7 +99,7 @@
9999
},
100100
"packages/console/mail": {
101101
"name": "@opencode-ai/console-mail",
102-
"version": "1.0.176",
102+
"version": "1.0.180",
103103
"dependencies": {
104104
"@jsx-email/all": "2.2.3",
105105
"@jsx-email/cli": "1.4.3",
@@ -123,7 +123,7 @@
123123
},
124124
"packages/desktop": {
125125
"name": "@opencode-ai/desktop",
126-
"version": "1.0.176",
126+
"version": "1.0.180",
127127
"dependencies": {
128128
"@kobalte/core": "catalog:",
129129
"@opencode-ai/sdk": "workspace:*",
@@ -171,7 +171,7 @@
171171
},
172172
"packages/enterprise": {
173173
"name": "@opencode-ai/enterprise",
174-
"version": "1.0.176",
174+
"version": "1.0.180",
175175
"dependencies": {
176176
"@opencode-ai/ui": "workspace:*",
177177
"@opencode-ai/util": "workspace:*",
@@ -200,7 +200,7 @@
200200
},
201201
"packages/function": {
202202
"name": "@opencode-ai/function",
203-
"version": "1.0.176",
203+
"version": "1.0.180",
204204
"dependencies": {
205205
"@octokit/auth-app": "8.0.1",
206206
"@octokit/rest": "catalog:",
@@ -216,7 +216,7 @@
216216
},
217217
"packages/opencode": {
218218
"name": "opencode",
219-
"version": "1.0.176",
219+
"version": "1.0.180",
220220
"bin": {
221221
"opencode": "./bin/opencode",
222222
},
@@ -308,7 +308,7 @@
308308
},
309309
"packages/plugin": {
310310
"name": "@opencode-ai/plugin",
311-
"version": "1.0.176",
311+
"version": "1.0.180",
312312
"dependencies": {
313313
"@opencode-ai/sdk": "workspace:*",
314314
"zod": "catalog:",
@@ -328,7 +328,7 @@
328328
},
329329
"packages/sdk/js": {
330330
"name": "@opencode-ai/sdk",
331-
"version": "1.0.176",
331+
"version": "1.0.180",
332332
"devDependencies": {
333333
"@hey-api/openapi-ts": "0.88.1",
334334
"@tsconfig/node22": "catalog:",
@@ -339,7 +339,7 @@
339339
},
340340
"packages/slack": {
341341
"name": "@opencode-ai/slack",
342-
"version": "1.0.176",
342+
"version": "1.0.180",
343343
"dependencies": {
344344
"@opencode-ai/sdk": "workspace:*",
345345
"@slack/bolt": "^3.17.1",
@@ -352,7 +352,7 @@
352352
},
353353
"packages/tauri": {
354354
"name": "@opencode-ai/tauri",
355-
"version": "1.0.176",
355+
"version": "1.0.180",
356356
"dependencies": {
357357
"@opencode-ai/desktop": "workspace:*",
358358
"@solid-primitives/storage": "catalog:",
@@ -379,7 +379,7 @@
379379
},
380380
"packages/ui": {
381381
"name": "@opencode-ai/ui",
382-
"version": "1.0.176",
382+
"version": "1.0.180",
383383
"dependencies": {
384384
"@kobalte/core": "catalog:",
385385
"@opencode-ai/sdk": "workspace:*",
@@ -414,7 +414,7 @@
414414
},
415415
"packages/util": {
416416
"name": "@opencode-ai/util",
417-
"version": "1.0.176",
417+
"version": "1.0.180",
418418
"dependencies": {
419419
"zod": "catalog:",
420420
},
@@ -425,7 +425,7 @@
425425
},
426426
"packages/web": {
427427
"name": "@opencode-ai/web",
428-
"version": "1.0.176",
428+
"version": "1.0.180",
429429
"dependencies": {
430430
"@astrojs/cloudflare": "12.6.3",
431431
"@astrojs/markdown-remark": "6.3.1",

github/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: "Model to use"
1010
required: true
1111

12+
agent:
13+
description: "Agent to use. Must be a primary agent. Falls back to default_agent from config or 'build' if not found."
14+
required: false
15+
1216
share:
1317
description: "Share the opencode session (defaults to true for public repos)"
1418
required: false
@@ -62,6 +66,7 @@ runs:
6266
run: opencode github run
6367
env:
6468
MODEL: ${{ inputs.model }}
69+
AGENT: ${{ inputs.agent }}
6570
SHARE: ${{ inputs.share }}
6671
PROMPT: ${{ inputs.prompt }}
6772
USE_GITHUB_TOKEN: ${{ inputs.use_github_token }}

github/index.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ function useEnvRunUrl() {
318318
return `/${repo.owner}/${repo.repo}/actions/runs/${runId}`
319319
}
320320

321+
function useEnvAgent() {
322+
return process.env["AGENT"] || undefined
323+
}
324+
321325
function useEnvShare() {
322326
const value = process.env["SHARE"]
323327
if (!value) return undefined
@@ -578,16 +582,38 @@ async function summarize(response: string) {
578582
}
579583
}
580584

585+
async function resolveAgent(): Promise<string | undefined> {
586+
const envAgent = useEnvAgent()
587+
if (!envAgent) return undefined
588+
589+
// Validate the agent exists and is a primary agent
590+
const agents = await client.agent.list<true>()
591+
const agent = agents.data?.find((a) => a.name === envAgent)
592+
593+
if (!agent) {
594+
console.warn(`agent "${envAgent}" not found. Falling back to default agent`)
595+
return undefined
596+
}
597+
598+
if (agent.mode === "subagent") {
599+
console.warn(`agent "${envAgent}" is a subagent, not a primary agent. Falling back to default agent`)
600+
return undefined
601+
}
602+
603+
return envAgent
604+
}
605+
581606
async function chat(text: string, files: PromptFiles = []) {
582607
console.log("Sending message to opencode...")
583608
const { providerID, modelID } = useEnvModel()
609+
const agent = await resolveAgent()
584610

585611
const chat = await client.session.chat<true>({
586612
path: session,
587613
body: {
588614
providerID,
589615
modelID,
590-
agent: "build",
616+
agent,
591617
parts: [
592618
{
593619
type: "text",

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

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.176",
4+
"version": "1.0.180",
55
"private": true,
66
"type": "module",
77
"dependencies": {

packages/console/function/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-function",
3-
"version": "1.0.176",
3+
"version": "1.0.180",
44
"$schema": "https://json.schemastore.org/package.json",
55
"private": true,
66
"type": "module",

packages/console/mail/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-mail",
3-
"version": "1.0.176",
3+
"version": "1.0.180",
44
"dependencies": {
55
"@jsx-email/all": "2.2.3",
66
"@jsx-email/cli": "1.4.3",

packages/desktop/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/desktop",
3-
"version": "1.0.176",
3+
"version": "1.0.180",
44
"description": "",
55
"type": "module",
66
"exports": {

0 commit comments

Comments
 (0)