Skip to content

Commit f0b78f0

Browse files
committed
merge: Merge upstream/dev 2026-06-08 (303 commits)
Resolves all 11 conflicts per UPSTREAM_SYNC.md playbook. TUI relocated from packages/opencode/src/cli/cmd/tui/ to packages/tui/ per upstream refactor(tui): extract standalone package (anomalyco#31193). Lash invariants preserved: - getCwd()/setCwd() + cwd sentinel in packages/opencode/src/session/prompt.ts - detectNaturalLanguage() in prompt.ts shell finish effect - ExecutionModeProvider + WorkingDirProvider wrap <App /> in packages/tui/src/app.tsx - Double left border (row layout) in packages/tui/src/component/prompt/index.tsx - EventCwdUpdated in packages/sdk/js/src/v2/gen/types.gen.ts Event union - agent_cycle = shift+tab keybind (untouched) - @shell-mode + @tui-integration path aliases added to packages/tui/tsconfig.json - removeSessions navigate hoisted out of produce callback (tabs.tsx) Refs: LAC-2337
2 parents c04019d + 1772e8e commit f0b78f0

1,513 files changed

Lines changed: 119005 additions & 33692 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.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages/core/migration/**/snapshot.json linguist-generated
2+
packages/core/src/database/migration.gen.ts linguist-generated

.github/CODEOWNERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# web + desktop packages
2-
packages/app/ @adamdotdevin
3-
packages/tauri/ @adamdotdevin
4-
packages/desktop/src-tauri/ @brendonovich
5-
packages/desktop/ @adamdotdevin
2+
packages/app/ @Hona @Brendonovich
3+
packages/desktop/ @Hona @Brendonovich

.github/workflows/nix-hashes.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,24 @@ jobs:
5656
BUILD_LOG=$(mktemp)
5757
trap 'rm -f "$BUILD_LOG"' EXIT
5858
59-
# Build with fakeHash to trigger hash mismatch and reveal correct hash
60-
nix build ".#packages.${SYSTEM}.node_modules_updater" --no-link 2>&1 | tee "$BUILD_LOG" || true
59+
HASH=""
60+
MAX_ATTEMPTS=3
61+
for ((ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++)); do
62+
# Build with fakeHash to trigger hash mismatch and reveal correct hash
63+
nix build ".#packages.${SYSTEM}.node_modules_updater" --no-link 2>&1 | tee "$BUILD_LOG" || true
6164
62-
# Extract hash from build log with portability
63-
HASH="$(nix run --inputs-from . nixpkgs#gnugrep -- -oP 'got:\s*\Ksha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | tail -n1 || true)"
65+
HASH="$(nix run --inputs-from . nixpkgs#gnugrep -- -oP 'got:\s*\Ksha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | tail -n1 || true)"
66+
67+
[ -n "$HASH" ] && break
68+
69+
if [ "$ATTEMPT" -lt "$MAX_ATTEMPTS" ]; then
70+
echo "::warning::Attempt ${ATTEMPT}/${MAX_ATTEMPTS} produced no hash for ${SYSTEM}; retrying in $((ATTEMPT * 10))s"
71+
sleep $((ATTEMPT * 10))
72+
fi
73+
done
6474
6575
if [ -z "$HASH" ]; then
66-
echo "::error::Failed to compute hash for ${SYSTEM}"
76+
echo "::error::Failed to compute hash for ${SYSTEM} after ${MAX_ATTEMPTS} attempts"
6777
cat "$BUILD_LOG"
6878
exit 1
6979
fi

.github/workflows/publish.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
id: build
9191
run: |
9292
./packages/opencode/script/build.ts ${{ (github.ref_name == 'beta' && '--sourcemaps') || '' }}
93+
./packages/cli/script/build.ts ${{ (github.ref_name == 'beta' && '--sourcemaps') || '' }}
9394
env:
9495
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
9596
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
@@ -107,6 +108,12 @@ jobs:
107108
with:
108109
name: opencode-cli-windows
109110
path: packages/opencode/dist/opencode-windows*
111+
112+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
113+
with:
114+
name: opencode-preview-cli
115+
path: packages/cli/dist/cli-*
116+
110117
outputs:
111118
version: ${{ needs.version.outputs.version }}
112119

@@ -327,9 +334,9 @@ jobs:
327334
VITE_SENTRY_ENVIRONMENT: ${{ (github.ref_name == 'beta' && 'beta') || 'production' }}
328335
VITE_SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }}
329336

330-
- name: Package and publish
337+
- name: Package
331338
if: needs.version.outputs.release
332-
run: npx electron-builder ${{ matrix.settings.platform_flag }} --publish always --config electron-builder.config.ts
339+
run: npx electron-builder ${{ matrix.settings.platform_flag }} --publish never --config electron-builder.config.ts
333340
working-directory: packages/desktop
334341
timeout-minutes: 60
335342
env:
@@ -349,11 +356,9 @@ jobs:
349356
env:
350357
OPENCODE_CHANNEL: ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }}
351358

352-
- name: Create and upload macOS .app.tar.gz
359+
- name: Create macOS .app.tar.gz
353360
if: runner.os == 'macOS' && needs.version.outputs.release
354361
working-directory: packages/desktop/dist
355-
env:
356-
GH_TOKEN: ${{ steps.committer.outputs.token }}
357362
run: |
358363
if [[ "${{ matrix.settings.target }}" == "x86_64-apple-darwin" ]]; then
359364
APP_DIR="mac"
@@ -371,7 +376,6 @@ jobs:
371376
exit 1
372377
fi
373378
tar -czf "$OUT_NAME" -C "$(dirname "$APP_PATH")" "$(basename "$APP_PATH")"
374-
gh release upload "v${{ needs.version.outputs.version }}" "$OUT_NAME" --clobber --repo "${{ needs.version.outputs.repo }}"
375379
376380
- name: Verify signed Windows Electron artifacts
377381
if: runner.os == 'Windows'
@@ -446,12 +450,24 @@ jobs:
446450
name: opencode-cli-signed-windows
447451
path: packages/opencode/dist
448452

453+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
454+
with:
455+
name: opencode-preview-cli
456+
path: packages/cli/dist
457+
449458
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
450459
if: needs.version.outputs.release
451460
with:
452461
pattern: latest-yml-*
453462
path: /tmp/latest-yml
454463

464+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
465+
if: needs.version.outputs.release
466+
with:
467+
pattern: opencode-desktop-*
468+
path: /tmp/desktop
469+
merge-multiple: true
470+
455471
- name: Setup git committer
456472
id: committer
457473
uses: ./.github/actions/setup-git-committer
@@ -478,6 +494,19 @@ jobs:
478494
git config --global user.name "opencode"
479495
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
480496
497+
- name: Upload desktop release assets
498+
if: needs.version.outputs.release
499+
env:
500+
GH_TOKEN: ${{ steps.committer.outputs.token }}
501+
run: |
502+
shopt -s nullglob
503+
files=(/tmp/desktop/*.{exe,blockmap,dmg,zip,AppImage,deb,rpm} /tmp/desktop/*.app.tar.gz)
504+
if (( ${#files[@]} == 0 )); then
505+
echo "No desktop release assets found"
506+
exit 1
507+
fi
508+
gh release upload "v${{ needs.version.outputs.version }}" "${files[@]}" --clobber --repo "${{ needs.version.outputs.repo }}"
509+
481510
- run: ./script/publish.ts
482511
env:
483512
OPENCODE_VERSION: ${{ needs.version.outputs.version }}

.github/workflows/sync-zed-extension.yml

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

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ jobs:
6464
turbo-${{ runner.os }}-
6565
6666
- name: Run unit tests
67-
run: bun turbo test:ci
67+
timeout-minutes: 20
68+
run: bun turbo test:ci --log-order=stream --log-prefix=task
6869
env:
6970
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}
7071

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ts-dist
1515
.turbo
1616
**/.serena
1717
.serena/
18+
**/.omo
19+
.omo/
1820
/result
1921
refs
2022
Session.vim

.opencode/command/translate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: translate English to other languages
3-
model: opencode/claude-opus-4-7
3+
model: opencode/claude-opus-4-8
44
---
55

66
run git diff and translate changed english doc and UI copy files to other international languages. Translate all languages in parallel to save time.

AGENTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const { a, b } = obj
5252
- Never alias imports. Do not use `import { foo as bar } from "..."` or renamed imports like `resolve as pathResolve`.
5353
- Never use star imports. Do not use `import * as Foo from "..."` or `import type * as Foo from "..."`.
5454
- If a namespace-style value is needed, import the module's own exported namespace by name, for example `import { Project } from "@opencode-ai/core/project"`, then reference `Project.ID`.
55+
- Prefer dynamic imports for heavy modules that are only needed in selected code paths, especially in startup-sensitive entrypoints. Destructure dynamic import bindings near the top of the narrowest scope that needs them so they read like normal imports. Avoid inline chains such as `await import("./module").then((mod) => mod.value())` or `(await import("./module")).value()`. Keep branch-specific imports inside the branch that needs them to preserve lazy loading.
5556

5657
### Variables
5758

@@ -137,3 +138,15 @@ const table = sqliteTable("session", {
137138
## Type Checking
138139

139140
- Always run `bun typecheck` from package directories (e.g., `packages/opencode`), never `tsc` directly.
141+
142+
## V2 Session Core
143+
144+
- Keep durable prompt admission separate from model execution. `SessionV2.prompt(...)` admits one durable `session_input` row before scheduling advisory `SessionExecution.wake(sessionID)` unless `resume: false` requests admit-only behavior. The serialized runner promotes admitted inputs into visible user messages at safe boundaries.
145+
- Reusing a Session ID adopts the existing Session. Reusing a prompt message ID reconciles an exact retry only when Session, prompt, and delivery mode match; conflicting reuse fails. Historical projected prompts lazily synthesize promoted inbox records during exact retry.
146+
- Keep `SessionExecution` process-global and Session-ID based. Its local implementation owns the process-local Session coordinator and discovers placement through `SessionStore` plus `LocationServiceMap.get(session.location)` only when a drain starts; no layer should take a Session ID. V2 interruption targets the active process-local ownership chain for that Session; idle or missing interruption is a no-op.
147+
- Keep `SessionRunner`, model resolution, tool registry, permissions, and filesystem Location-scoped. Omitted `Location.workspaceID` means implicit-local placement; explicit workspace identity remains reserved for future placement semantics.
148+
- Preserve one explicit `llm.stream(request)` call per provider turn and reload projected history before durable continuation. Do not bridge through legacy `SessionPrompt.loop(...)` or delegate orchestration to an in-memory tool loop.
149+
- Keep local Session drains process-local until clustering is implemented. `SessionRunCoordinator` joins explicit same-Session resumes, coalesces prompt wakeups, and allows different Sessions to run concurrently. Advisory wakes drain eligible durable inbox rows only; post-crash activity recovery requires a separate explicit design before it may retry provider work.
150+
- Keep delivery vocabulary explicit. Prompts steer by default and coalesce into the active activity at the next safe provider-turn boundary. Explicit `queue` inputs open FIFO future activities one at a time after the active activity settles.
151+
- Keep EventV2 replay owner claims separate from clustered Session execution ownership.
152+
- Keep the System Context algebra, registry, and built-ins in `src/system-context`; keep Context Source producers with their observed domains, and keep Session History selection plus Context Epoch persistence Session-owned.

0 commit comments

Comments
 (0)