Skip to content

chore(sync): merge upstream v2 through v2.2.0 - #458

Merged
shuv1337 merged 676 commits into
integration-v2from
cursor/sync-upstream-v220
Oct 29, 2026
Merged

shuv1337 merged 676 commits into
integration-v2from
cursor/sync-upstream-v220

Conversation

@shuv1337

@shuv1337 shuv1337 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Issue for this PR

Sync of integration-v2 with upstream OpenCode tag v2.2.0. No tracked issue.

Type of change

Upstream sync. Not a product bug fix or feature.

What does this PR do?

Merges upstream tag v2.2.0 (1097e2668b1e08ad63bdf0b1c4860b9bc01e420c, release: v2.2.0, 2026-10-27) into integration-v2.

upstream/v2 stopped at 4617210822 on 2026-10-10 (chore(core): refresh bundled models.dev snapshot). That commit is an ancestor of the tag. The tag is not an ancestor of upstream/v2: 2567 commits are on the tag and not on upstream/v2, and none are on upstream/v2 and missing from the tag. V2 development left the v2 branch (it now lives on upstream dev). The release commit itself is off that branch, so this merges the tag, which already contains its v2 ancestry. Merge-base with the fork is 74f8d4860f (parent of the previous v2.1.4 release commit). 661 commits are on the tag since that base.

Regular merge commit 27e6bf399f (parents 6bab70f39a and 1097e2668b), plus follow-up commits that repair merge splices and the review findings. No rebase, squash, or force-push. Head b31307725342c04b2a93513b0ba94cb2fa54e59f. That commit also merges the current integration-v2 so the pull request can build a merge commit after #459.

Fork identity kept: package and bin shuvcode, CLI version 2.2.0-shuv.1, other workspaces 2.2.0, @shuvcode/* plugins, @opencode-ai/pty 0.3.1, ports 0x1337 / 0x1338, ShuvTunnel (https://shuv.zip, route shuvcode, data dir and websocket subprotocol shuvtunnel) on @opentunnel/* 0.6.1 via new patches. bun install --frozen-lockfile passes. Fork publish guard in packages/cli/script/pack.ts is unchanged.

Unmerged historical fork branches were inventoried and left in place. Their dispositions were already recorded on the v2.1.3 and v2.1.4 syncs. None were merged or deleted here.

Conflict resolutions

Mechanical: workspace package.json versions moved from 2.1.4 to 2.2.0, except the CLI, which is 2.2.0-shuv.1. bun.lock was regenerated from the resolved manifests.

Flagged, large or behavioral:

  • packages/cli/src/commands/commands.ts (556 lines), packages/cli/src/framework/spec.ts, packages/cli/src/services/server-connection.ts, packages/cli/test/server-connection.test.ts. Kept the fork global --server / --standalone flags (ServerSetting / StandaloneSetting applied once in the runtime). Removed upstream's per-command globalFlags. The upstream spec-level flag parse test was dropped. Heap dump reads ServerSetting.
  • packages/cli/script/pack.ts. Kept the fork publish guard (preflightForkPublish, requireForkRepository). Did not take upstream's release-archive packer. Upstream script/pack remains exported for their release scripts.
  • packages/cli/script/build.ts. OPENCODE_TARGET=linux-x64 matches shuvcode-linux-x64 via the existing targetName() prefix.
  • packages/core/src/tool.ts (392). Kept the fork executeCall repair hook (session-context removal and alias resolution) and upstream's code-mode definition cache.
  • packages/core/src/integration.ts (929) and packages/core/test/integration-refresh.test.ts. Took upstream credentials.lock plus a 30s refresh timeout, and kept the fork shuvcodeAuthImport === "access-only" guard both before and inside the lock. Both test suites are in the file.
  • Database: packages/core/src/database/migration.gen.ts, packages/core/schema.json (2236), packages/core/src/session/sql.ts, packages/core/src/session.ts, packages/core/src/session/projector.ts. Fork migration 20261005094821_subagent-operation stays m48. Upstream session_allowance, blob, and drop_session_pending are m51–m54. Dropped the SessionPendingTable definition so it matches the drop migration. Kept SubagentOperationTable and upstream message/blob ref readers. Took upstream snapshot id 44bd8ca5-689a-410e-a46a-958eb5accd97. bun run migration -- --check in packages/core reported no schema changes.
  • packages/core/src/config/plugin/provider.ts. Uses upstream overlayProvider and the fork variant check against source.package (not source.base.package).
  • packages/core/src/session/model-request.ts. Kept the fork error tool-result content path (Buffer.byteLength).
  • packages/ai/src/protocols/anthropic-messages.ts (1716) and its test (2653). Combined fork tool-error text-plus-blocks with upstream video lowering. A follow-up commit closed the tool-failure test that the splice left open.
  • packages/script/src/index.ts. Kept fork channel and <base>-shuv.<n> version resolution. Restored OPENCODE_BUMP and OPENCODE_RELEASE, which the env-object splice had dropped.
  • packages/client/src/promise/generated/types.ts. Kept the fork indexed prompt body type. packages/server/src/handlers/session.ts keeps both SessionPromptPayload and wantsMediaRefs.
  • packages/client/src/effect/api/api.ts (generated). permission.cancelled and session.tool.subagent.prepared are in the subscribe filter because they are on EventManifest.ServerDefinitions. bun run generate in packages/client reproduces those two lines. Durable-only session.message.content.updated and session.usage.recorded stay out.
  • packages/ai evaluation. Upstream deleted experimental/evaluation*.ts and experimental/system-one.ts and replaced the TypeSafe provider with a decision route. Restored the evaluation client and System One model, and attached experimental.evaluation beside decision. Re-exported LLM, AIError, ToolFailure, LanguageModel, LLMEvent, Message, ToolDefinition, and isRetryable from the package root for existing fork imports.
  • Workflows. Deleted upstream check-test.yml, blacksmith release.yml / release-dry-run.yml, triage, deploy, bot, and nix check workflows so this PR does not start paid GitHub Actions. Restored fork test.yml (full suite only on v* tags, workflow_call, and workflow_dispatch). Kept hygiene.yml, typecheck.yml, publish.yml, notify-discord.yml. Left .github/release/* and .github/nix-hashes/* in tree, unwired.
  • Deleted services/www/openapi.json, services/www/public/openapi.json, and packages/gui-extensions/README.md with upstream. jev remains in schema and protocol. Branding is on packages/gui-plugins/README.md.
  • Ports stay 0x1337 / 0x1338. Took upstream processEnv() which strips XDG_STATE_HOME. Port conflict text now names the PID when lsof can see the listener.

How did you verify your code works?

  • bun install --frozen-lockfile passed (Bun 1.4.4).
  • packages/core bun run migration -- --check: no schema changes.
  • oxlint: 0 errors (1579 existing warnings). ast-grep scan and sdk-docs passed.
  • bun turbo typecheck --concurrency=2: 40 successful, 40 total. The pre-push bun run check (lint + typecheck) passed on the pushed head.
  • Local tests, same filters as fork CI (GITHUB_ACTIONS=false bun turbo test --concurrency=2 --filter='!@opencode/desktop' --filter='!@opencode/update'): 34 packages passed, 34 total, about 10m14s. The Anthropic Messages suite then passed on fd2aa6d477, including the text-only error tool_result cases. Not run: @opencode/desktop, @opencode/update.

Visual

No UI change.

Screenshots / recordings

None.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Risks

  • Tool execution, OAuth refresh, and the migration chain are the behavioral merges. The refresh-lock test advances the test clock by 30 seconds and passes. Migration check matches drizzle. A bad tool-repair splice would show up as missing tools or skipped aliases.
  • OpenAI Chat still lowers error images beside the error text. Anthropic error tool_result blocks are text only; non-text items become notes such as [image omitted].
  • The subscribe filter comes from bun run generate. Stripping permission.cancelled and session.tool.subagent.prepared and regenerating puts both lines back.
  • .github/release and nix hash scripts are present and unused. Fork CI does not call them. A nix build can still fail a hash check, as before.
  • OPENCODE_TARGET short names now go through the shuvcode- prefix. Fork publish.yml does not set OPENCODE_TARGET.
  • Upstream blacksmith release workflows were not imported, so this PR does not publish or run paid runners. Publishing stays on the fork publish.yml path.
Open in Web Open in Cursor 

Hona and others added 30 commits October 24, 2026 19:06
…malyco#58723)

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
…alyco#58769)

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Co-authored-by: dc85 <83497+dc85@users.noreply.github.com>
Hona and others added 15 commits October 27, 2026 04:42
…alyco#59151)

Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com>
…#59148)

Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Merge tag v2.2.0 (1097e26). upstream/v2 stopped at 4617210
on 2026-10-10, and the release commit is not on that branch. The tag
contains its v2 ancestry, so this merges the tag rather than the
abandoned v2 tip.
The v2.2.0 merge dropped the closing of the fork tool-failure test
when the upstream video tests were inserted after it.
Heap dump reads the fork ServerSetting tag, and the script env keeps
OPENCODE_BUMP and OPENCODE_RELEASE so fork channel and release builds
still typecheck.
Upstream replaced the experimental evaluation client and dropped
System One from the TypeSafe provider. Keep that fork surface beside
the new decision route, re-export the Effect symbols fork tests import
from the AI package root, and add the public subagent and permission
events to the generated subscribe filter.
@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

shuv1337 and others added 11 commits October 27, 2026 17:48
The hygiene job matched six `@/home/...` module aliases and a committed
C:/Users/Lukem profiler import. Name the alias segments in the allowlist,
import @jridgewell/trace-mapping instead, and make the release scripts
pass shellcheck once that later step can run.
The cached runtime can call every active tool, including direct tools that
are not in the code-mode catalog. Keying the cache on catalog names alone
kept a disabled direct tool callable from a later snapshot.
Replace the global text rules for /home/projects, /home/start, /home/sessions,
and /home/route with pii entries for the files that import those aliases.
Record the @opencode/ai wildcard subpaths that upstream anomalyco#59183 no longer exports.
An is_error tool_result that also carries image or document blocks is
rejected. Keep the error text and replace each non-text item with a note
so the error path never inlines that media.
The base moved in #459 and the pull request could not build a merge commit,
so pull request checks did not start. Keep that reconnect behavior and the
browser skill permission from this branch.

# Conflicts:
#	packages/plugin-browser/src/connection.ts
@shuv1337
shuv1337 merged commit 4bdbe79 into integration-v2 Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.