Skip to content

Commit 2602aff

Browse files
lacymorrowBrendonovichthdxrkitlangtonopencode-agent[bot]
authored
sync: merge upstream/dev catch-up (629 commits) (#31)
* fix(app): mount shortcuts per titlebar tab (anomalyco#33567) * fix(tui): normalize autocomplete attachments * refactor(core): drop filesystem entry mime * fix(app): use fixed titlebar tab widths (anomalyco#33572) * refactor(schema): extract shared public schemas (anomalyco#33571) * chore: update nix node_modules hashes * fix(app): throttle directory tree loading (anomalyco#33576) * refactor(core): remove schema forwarding facades (anomalyco#33577) * fix(app): create scoped drafts from home (anomalyco#33578) * feat(cli): add API request command * fix(tui): sort model picker by release date (anomalyco#33558) * chore: generate * fix(app): clear viewed session notifications (anomalyco#33574) * fix(app): route new sessions through tabs (anomalyco#33582) * fix(mcp): bind oauth callback to IPv4 loopback (anomalyco#30022) * fix(opencode): restore v1 account config (anomalyco#33590) Co-authored-by: Test <[email protected]> * refactor(app): simplify layout hierarchy (anomalyco#33588) * fix(mcp): restore legacy tool names (anomalyco#33593) * fix(skill): emit base directory as filesystem path, not file:// URL (anomalyco#33580) Co-authored-by: Aiden Cline <[email protected]> * chore: generate * fix(mcp): prevent resource key collisions (anomalyco#33596) * feat(app): update all components to use v2 tokens (anomalyco#33598) * chore: generate * deps: update OpenTUI to 0.4.2 (anomalyco#33610) * chore: update nix node_modules hashes * fix(app): make session navigation stable and fast (anomalyco#33569) Co-authored-by: Brendan Allan <[email protected]> * chore: generate * fix(app): share synced session data (anomalyco#33624) * refactor(app): rename cached context accessors (anomalyco#33627) * ci: notify the current Discord alert role * feat(console): add support actions (anomalyco#33492) * feat(tui): add diff viewer keybind (anomalyco#33365) * chore: generate * fix(app): always apply safe area insets (anomalyco#33619) * feat(tui): add main branch source to diff mode (anomalyco#30942) * fix(enterprise): use delete for remove share * tui: fix multi-day duration formatting (anomalyco#33651) Report elapsed days and remaining hours instead of showing zero days and the total duration as hours. Close anomalyco#32957 Close anomalyco#32956 * docs(llm): propose AI library design (anomalyco#33666) * chore: generate * refactor(ui): isolate session components (anomalyco#33670) * chore: update nix node_modules hashes * zen: migrate to new inference * fix(stats): strip locale prefixes from data routes * refactor(stats): simplify locale prefix stripping * feat(mcp): append server instructions to context (anomalyco#32490) Co-authored-by: Aiden Cline <[email protected]> * chore: generate * fix(mcp): hide denied resource template tool (anomalyco#33686) * refactor(core): simplify model requests * feat(core): generate model variants * chore: generate * zen: track model tier in stats * fix: restore dev CI (anomalyco#33701) * tui: remove logo animation (anomalyco#33633) Render branding as a static logo to avoid continuous redraws and mouse-driven visual effects. * sync release versions for v1.17.10 * refactor(schema): extract public event definitions (anomalyco#33579) * chore: generate * chore: update nix node_modules hashes * docs: add GMI Cloud provider entry to providers directory (anomalyco#32914) * fix(opencode): always print MCP OAuth URL (anomalyco#33716) * fix(core): scope fff broad scanning * fix(core): disable fff broad scanning * fix(core): handle unavailable fff index * fix(core): preserve unconfigured console models * fix(core): lower OpenAI text verbosity * feat(core): add session snapshot and revert system (anomalyco#33226) * chore: generate * fix(app): remove session loading stripe (anomalyco#33649) Co-authored-by: Test <[email protected]> * refactor(protocol): extract server contracts (anomalyco#33708) * refactor(app): centralize session state (anomalyco#33641) * chore: generate * fix(app): clear late session notifications (anomalyco#33753) Co-authored-by: Test <[email protected]> * chore: update nix node_modules hashes * feat(sdk): add HttpApi clients and embedded host (anomalyco#33445) * chore: generate * chore: update nix node_modules hashes * fix(app): separate provider lifetimes and reactive ownership (anomalyco#33739) * chore: generate * refactor(app): lift parent session navigation (anomalyco#33782) * chore: generate * feat(app): draggable tabs (anomalyco#31364) Co-authored-by: LukeParkerDev <[email protected]> * chore: generate * feat(app): ui improvements (anomalyco#32438) Co-authored-by: LukeParkerDev <[email protected]> * chore: generate * fix(app): close missing session tabs (anomalyco#33785) * fix(app): preserve todo dock across sessions (anomalyco#33778) * fix(app): remove produce default values in server session state (anomalyco#33793) * fix(app): update all v1 new-session icons (anomalyco#32017) Co-authored-by: LukeParkerDev <[email protected]> * fix(storybook): support prompt state capture (anomalyco#33798) * feat(app): no sesssions empty state (anomalyco#33315) * chore: generate * feat(app): restyle v2 jump-to-latest button (anomalyco#33809) * fix(app): improve home action availability (anomalyco#33805) * fix(app): restore tab layout consistency (anomalyco#33804) * fix(app): reveal tab avatar on hover (anomalyco#33824) Co-authored-by: Test <[email protected]> * feat(app): add Chrome tab cycle shortcuts (anomalyco#33838) * Revert "deps: update OpenTUI to 0.4.2 (anomalyco#33610)" (anomalyco#33842) * fix(app): use project server for prompt drafts (anomalyco#33850) * chore: update nix node_modules hashes * fix(client): exclude generated files from formatting (anomalyco#33832) Co-authored-by: Test <[email protected]> * feat(ui): publish ui package (anomalyco#33681) * sync release versions for v1.17.11 * fix(app): hide mobile titlebar setting in production (anomalyco#33894) * chore: update nix node_modules hashes * feat(server): add permission request endpoints (anomalyco#33774) * chore: generate * feat(app): improve titlebar tab layout (anomalyco#33914) * feat(stats): add i18n support (anomalyco#33693) * fix(app): suspend while recent models load (anomalyco#33921) * chore: generate * docs(schema): document package conventions (anomalyco#33768) * fix(app): restore new layout shortcuts (anomalyco#33929) * refactor(schema): normalize module patterns (anomalyco#33770) * chore: generate * zen: migrate to new inference * zen: new inference * fix(app): adjust home search and header layout (anomalyco#33923) * fix(tui): load root sessions in session switcher (anomalyco#33931) Request root sessions before applying the session list limit so child sessions cannot crowd roots out of the switcher. Keep the synchronized cache available while requests are pending or fail, reconcile results with live updates, and retain current and pinned sessions. Preserve selection by session ID when asynchronous results reorder the list. Closes anomalyco#16270 Closes anomalyco#32725 * fix(app): persist home project selection (anomalyco#33935) * chore: generate * refactor(schema): tighten public contracts (anomalyco#33771) * chore: generate * refactor(schema): isolate v1 contracts (anomalyco#33769) * feat(app): group prompt projects by server (anomalyco#33941) * feat(sdk): restore session runtime operations (anomalyco#33777) * chore: generate * refactor(core): support tiered layer nodes (anomalyco#33937) * chore: generate * fix(app): use tab-scoped servers in sessions (anomalyco#33946) * fix(app): enable composer shortcuts on drafts (anomalyco#33956) * refactor(app): split session composer (anomalyco#33954) * chore: generate * fix(mcp): scope auth status to server URL (anomalyco#33924) * chore: generate * feat(llm): pass strict through tool definitions for Codex parity (anomalyco#33392) * fix(app): simplify question prompt (anomalyco#33968) Co-authored-by: Test <[email protected]> * feat(core): split MCP timeout configuration (anomalyco#33977) Co-authored-by: Test <[email protected]> * fix(core): refine small model defaults (anomalyco#33926) * tweak: hide MCP access token prefix (anomalyco#33711) * fix(app): enable auto-accept in session settings (anomalyco#33974) * fix(app): suspend hidden terminal renderer (anomalyco#33990) Co-authored-by: Test <[email protected]> * fix(ui): normalize tooltip trigger layout (anomalyco#33979) Co-authored-by: Test <[email protected]> Co-authored-by: Brendan Allan <[email protected]> * refactor(opencode): stop legacy v2 event emission (anomalyco#33993) * fix(sdk): wake embedded session execution (anomalyco#33992) * feat(sdk): expose active sessions (anomalyco#33991) * chore: generate * fix(app): bump ghostty-web to prevent terminal resize hangs (anomalyco#34020) Co-authored-by: Luke Parker <[email protected]> * chore: update nix node_modules hashes * refactor(app): use dropdown for project selector (anomalyco#33984) * refactor(app): replace tab drag handling with dndkit (anomalyco#33880) Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> * chore: generate * feat(oauth): unify OAuth callback browser pages (anomalyco#34025) * chore: update nix node_modules hashes * feat(app): refine session UI styling (anomalyco#33860) Co-authored-by: Brendan Allan <[email protected]> * chore: generate * core: prevent UI imports compiling TSX source * fix(tui): preserve renderer initialization errors (anomalyco#33996) Co-authored-by: Shoubhit Dash <[email protected]> * fix(opencode): preserve skill resource paths (anomalyco#34052) * fix(core): refresh cached remote skills (anomalyco#34059) * fix(acp): surface prompt errors (anomalyco#34061) * feat(app): updates to design system (anomalyco#34066) * fix(acp): skip resume transcript replay (anomalyco#34070) * fix(mcp): refresh credentials on reauthentication (anomalyco#33717) * tweak: update OAuth callback branding (anomalyco#34081) * fix(llm): omit stateless response item ids (anomalyco#34027) * fix(core): enlarge OAuth callback card (anomalyco#34082) * feat(app): add new session workspace controls (anomalyco#34085) * fix(app): consolidate add project action (anomalyco#34086) * fix(acp): enrich permission prompts (anomalyco#34079) * docs(providers): document blacklist and whitelist model filtering (anomalyco#33792) * fix(app): wait for persisted home state before reading collapsed state (anomalyco#34088) * fix(acp): send partial completed tool updates (anomalyco#34091) * fix(data): canonicalize locale pages * docs: route enterprise contact links (anomalyco#34080) * fix(data): clarify unchanged rank * feat(stats): add clickable section headings (anomalyco#34095) * chore: generate * fix(core): resolve prompt attachment mime types * chore: generate * fix(core): authorize external read paths * fix(llm): end reasoning before responses * chore: generate * fix(app): animate prompt selectors after loading (anomalyco#34101) * feat(api): add finite durable session history pages (anomalyco#34097) * chore: generate * fix(app): slow tooltip display for models (anomalyco#30745) Co-authored-by: affanali2k3 <[email protected]> * chore: update nix node_modules hashes * feat(sdk): expose live event stream (anomalyco#34098) * chore: generate * fix(app): centralize notification state (anomalyco#34105) * zen: new inference * fix: apply lash-specific patches after upstream merge - Fix SolidJS accessor usage in question-dock (sdk → sdk()) - Remove dead session-prompt-dock.tsx (no imports, replaced by composer) - Update bun.lock * fix(tui): use generated event union (anomalyco#34118) Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> * fix(app): keep bare slash as plain inline code (anomalyco#34122) Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> * fix(app): hide home session archive action (anomalyco#34136) Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> * refactor(core): separate out location node functionality and integrate into v2 (anomalyco#34119) * chore: generate * fix(mcp): surface OAuth completion errors (anomalyco#34145) * fix(mcp): request refresh token scope (anomalyco#34125) * chore: update nix node_modules hashes * fix(app): migrate composer tooltips to v2 (anomalyco#34147) Co-authored-by: Jay V <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * feat(core): port v2 runtime fixes onto dev Cherry-picks the packages/core changes from the v2 branch onto dev: - combined ordered stdout/stderr in AppProcess + bash structured output - edit/apply-patch return FileDiff info with status and line stats - ignore no-op model switches; record reasoning timestamps - return unexpected local tool defects to the model and continue - keep OAuth account metadata out of request bodies - nest OpenAI reasoning effort/summary options - load OpenCode provider config asynchronously; batch plugin boot - export latest public event manifest Includes the supporting schema reasoning time field and regenerated client/SDK types. * chore: generate * fix(opencode): allow empty provider config default (anomalyco#34167) Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * chore: update nix node_modules hashes * fix(app): space home sessions from scrollbar (anomalyco#34132) Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> * fix(ui): make select hover feedback immediate (anomalyco#34121) Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> * feat(app): update home screen alignment + markdown styles (anomalyco#34172) * fix(desktop): recognize normal auth metadata input prompts in connect provider dialog (anomalyco#33024) * fix(app): reconcile session pages with concurrent events (anomalyco#34042) * chore: generate * fix(app): batch new session tab navigation (anomalyco#34196) * feat(app): minor visual updates (anomalyco#34205) * refactor(core): make node build bind maps conditionally (anomalyco#34218) * feat(app): new debug bar (anomalyco#34237) * chore: generate * fix(tui): register `prompt.skills` keybinds (anomalyco#34180) * refactor(core): rename app node modules (anomalyco#34238) * chore: generate * test(core): cover app node builder graphs (anomalyco#34244) * refactor(core): move session test to nodes (anomalyco#34245) * chore: generate * refactor(core): move more tests to nodes (anomalyco#34248) * chore: generate * fix(app): transition draft project updates (anomalyco#34252) * fix(sdk): preserve V2Event name for SSE streams (anomalyco#34171) * chore: update nix node_modules hashes * feat(client): generate complete protocol client (anomalyco#34164) * fix(app): disable `add project` when given server is offline (anomalyco#34294) * fix(desktop): avoid destroyed window permission checks (anomalyco#34300) * zen: new inference * zen: update alert role * fix(mcp): reconnect after OAuth even when server is disabled Closes anomalyco#33915 * fix(mcp): clarify debug oauth probe (anomalyco#34350) * feat(desktop): Display stored totals for Tokens and Cost in Desktop Session Context (anomalyco#28887) * chore: generate * fix(app): wrap model.set in startTransition (anomalyco#34351) * chore: generate * feat(tui): integrate ServerAuth headers into transport configuration for external served TUI thread (anomalyco#29876) * refactor(core): refine layer node replacements (anomalyco#34377) * chore: generate * test(core): fix layer node replacement type expectation (anomalyco#34386) Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * fix(app): disable empty server chevron (anomalyco#34292) * zen: budget * zen: budget * feat(app): sticky session list header (anomalyco#34220) Co-authored-by: Brendan Allan <[email protected]> * feat(app): show loader on session hover (anomalyco#34224) * chore: generate * fix(tui): use V2Event after upstream SSE name preservation (anomalyco#34171) Upstream renamed the SSE event union back to `V2Event` (no `V2Event1` suffix). Drop the alias import. LAC-2490 --------- Co-authored-by: Brendan Allan <[email protected]> Co-authored-by: Dax Raad <[email protected]> Co-authored-by: Kit Langton <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Yufeng He <[email protected]> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Test <[email protected]> Co-authored-by: Chris Yuan <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Aarav Sareen <[email protected]> Co-authored-by: Simon Klee <[email protected]> Co-authored-by: Luke Parker <[email protected]> Co-authored-by: Brendan Allan <[email protected]> Co-authored-by: vimtor <[email protected]> Co-authored-by: Shoubhit Dash <[email protected]> Co-authored-by: Frank <[email protected]> Co-authored-by: Adam <[email protected]> Co-authored-by: 4rcadia <[email protected]> Co-authored-by: opencode <[email protected]> Co-authored-by: Isaac Huang <[email protected]> Co-authored-by: Dax <[email protected]> Co-authored-by: James Long <[email protected]> Co-authored-by: usrnk1 <[email protected]> Co-authored-by: Ariane Emory <[email protected]> Co-authored-by: Stefan Avram <[email protected]> Co-authored-by: Affan Ali <[email protected]> Co-authored-by: affanali2k3 <[email protected]> Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <[email protected]> Co-authored-by: Jay V <[email protected]> Co-authored-by: OpeOginni <[email protected]> Co-authored-by: Ben Guthrie <[email protected]> Co-authored-by: Filip <[email protected]> Co-authored-by: Max Anderson <[email protected]>
1 parent 3c651ba commit 2602aff

1,633 files changed

Lines changed: 108198 additions & 99171 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/ISSUE_TEMPLATE/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: false
22
contact_links:
33
- name: 💬 Discord Community
44
url: https://discord.gg/opencode
5-
about: For quick questions or real-time discussion. Note that issues are searchable and help others with the same question.
5+
about: For support, troubleshooting, how-to questions, and real-time discussion.

‎.github/ISSUE_TEMPLATE/question.yml‎

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

‎.github/workflows/publish.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ jobs:
325325
run: bun run build
326326
working-directory: packages/desktop
327327
env:
328+
NODE_OPTIONS: --max-old-space-size=4096
328329
OPENCODE_CHANNEL: ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }}
329330
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
330331
SENTRY_ORG: ${{ vars.SENTRY_ORG }}

‎.github/workflows/storybook.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "bun.lock"
1010
- "packages/storybook/**"
1111
- "packages/ui/**"
12+
- "packages/session-ui/**"
1213
pull_request:
1314
branches: [dev]
1415
paths:
@@ -17,6 +18,7 @@ on:
1718
- "bun.lock"
1819
- "packages/storybook/**"
1920
- "packages/ui/**"
21+
- "packages/session-ui/**"
2022
workflow_dispatch:
2123

2224
concurrency:

‎.github/workflows/test.yml‎

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,35 +65,20 @@ jobs:
6565
6666
- name: Run unit tests
6767
timeout-minutes: 20
68-
run: bun turbo test:ci --log-order=stream --log-prefix=task
68+
run: GITHUB_ACTIONS=false bun turbo test
6969
env:
7070
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}
7171

72+
- name: Check generated client
73+
if: runner.os == 'Linux'
74+
working-directory: packages/client
75+
run: bun run check:generated
76+
7277
- name: Run HttpApi exerciser gates
7378
if: runner.os == 'Linux'
7479
working-directory: packages/opencode
7580
run: bun run test:httpapi
7681

77-
- name: Publish unit reports
78-
if: always()
79-
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
80-
with:
81-
report_paths: packages/*/.artifacts/unit/junit.xml
82-
check_name: "unit results (${{ matrix.settings.name }})"
83-
detailed_summary: true
84-
include_time_in_summary: true
85-
fail_on_failure: false
86-
87-
- name: Upload unit artifacts
88-
if: always()
89-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
90-
with:
91-
name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }}
92-
include-hidden-files: true
93-
if-no-files-found: ignore
94-
retention-days: 7
95-
path: packages/*/.artifacts/unit/junit.xml
96-
9782
e2e:
9883
name: e2e (${{ matrix.settings.name }})
9984
strategy:
@@ -119,7 +104,8 @@ jobs:
119104
- name: Setup Node
120105
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
121106
with:
122-
node-version: "24"
107+
# Playwright 1.59 hangs while extracting Chromium with Node 24.16.
108+
node-version: "24.15"
123109

124110
- name: Setup Bun
125111
uses: ./.github/actions/setup-bun
@@ -151,7 +137,6 @@ jobs:
151137
run: bun --cwd packages/app test:e2e:local
152138
env:
153139
CI: true
154-
PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.settings.name }}.xml
155140
timeout-minutes: 30
156141

157142
- name: Upload Playwright artifacts
@@ -162,6 +147,5 @@ jobs:
162147
if-no-files-found: ignore
163148
retention-days: 7
164149
path: |
165-
packages/app/e2e/junit-*.xml
166150
packages/app/e2e/test-results
167151
packages/app/e2e/playwright-report

‎.opencode/agent/triage.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
mode: primary
33
hidden: true
4-
model: opencode/gpt-5.4-nano
4+
model: opencode/gpt-5.4-mini
55
color: "#44BA81"
66
tools:
77
"*": false

‎.opencode/opencode.jsonc‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
"$schema": "https://opencode.ai/config.json",
33
"provider": {},
44
"permission": {},
5-
"reference": {
6-
"effect": "github.com/Effect-TS/effect-smol",
5+
"references": {
6+
"effect": {
7+
"repository": "github.com/Effect-TS/effect-smol",
8+
"description": "Use for Effect v4 and effect-smol implementation details",
9+
},
10+
"opencode-local": {
11+
"path": "~/.local/share/opencode",
12+
"description": "Contains opencode logs and data",
13+
},
714
},
815
"mcp": {},
916
"tools": {

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
sst-env.d.ts
22
packages/desktop/src/bindings.ts
3+
packages/client/src/generated/
4+
packages/client/src/generated-effect/

‎AGENTS.md‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
- To regenerate the JavaScript SDK, run `./packages/sdk/js/script/build.ts`.
1+
- To regenerate the legacy JavaScript SDK, run `./packages/sdk/js/script/build.ts`.
2+
- After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. Do not edit `src/generated` or `src/generated-effect` directly.
3+
- Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. Client runtime code may depend on Schema and Protocol but never Core or Server; `sdk-next` composes Client, Core, and Server.
24
- The default branch in this repo is `dev`.
35
- Local `main` ref may not exist; use `dev` or `origin/dev` for diffs.
46

7+
## Branch Names
8+
9+
Use a short branch name of at most three words, separated by hyphens. Do not use slashes or type prefixes such as `feat/` or `fix/`.
10+
11+
Examples: `session-recovery`, `fix-scroll-state`, `regenerate-sdk`.
12+
513
## Commits and PR Titles
614

715
Use conventional commit-style messages and PR titles: `type(scope): summary`.
@@ -22,6 +30,7 @@ Examples: `fix(tui): simplify thinking toggle styling`, `docs: update contributi
2230
- Rely on type inference when possible; avoid explicit type annotations or interfaces unless necessary for exports or clarity
2331
- Prefer functional array methods (flatMap, filter, map) over for loops; use type guards on filter to maintain type inference downstream
2432
- In `src/config`, follow the existing self-export pattern at the top of the file (for example `export * as ConfigAgent from "./agent"`) when adding a new config module.
33+
- In Effect generators, bind services to named variables before calling methods. Do not use nested service yields such as `yield* (yield* Foo.Service).bar()`.
2534

2635
Reduce total variable count by inlining when a value is only used once.
2736

@@ -131,7 +140,7 @@ const table = sqliteTable("session", {
131140

132141
## Testing
133142

134-
- Avoid mocks as much as possible
143+
- Avoid mocks as much as possible, you shouldn't be using globalThis.\* at all unless it's the only option.
135144
- Test actual implementation, do not duplicate logic into tests
136145
- Tests cannot run from repo root (guard: `do-not-run-tests-from-root`); run from package dirs like `packages/opencode`.
137146

@@ -146,7 +155,7 @@ const table = sqliteTable("session", {
146155
- 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.
147156
- 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.
148157
- 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.
158+
- 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 continuation recovery requires a separate explicit design before it may retry provider work. A drain has no durable identity or transcript boundary.
159+
- Keep delivery vocabulary explicit. Prompts steer by default and promote at the next safe provider-turn boundary while the current drain requires continuation. An explicit `queue` input remains pending until the Session would otherwise become idle; promote one queued input at that boundary, then reevaluate continuation before promoting another. Promoting any new user input resets the selected agent's provider-turn allowance; a batch of steers resets it once.
151160
- Keep EventV2 replay owner claims separate from clustered Session execution ownership.
152161
- 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)