Skip to content

chore: sync dev with upstream anomalyco/opencode dev — 4846 commits behind (merge-base 2026-09-11), 68 conflicting files #342

Closed

Description

@terisuke

State (2026-10-18)

  • fork dev = 1237acfb (feat(guardrails): add DeepSeek V4.1 Flash, retire V4 ids #337, 2026-10-01); upstream anomalyco/opencode dev = da9d436c.
  • origin/dev vs upstream/dev: ahead 257 / behind 4846; merge-base 95daf90 (2026-09-11). The local build in use (~/.local/bin/opencode → packages/opencode/dist/opencode-darwin-arm64) is from 2026-09-12 (0.0.0-dev-202609120902).
  • A dry-run git merge upstream/dev on a throwaway worktree stops with 68 conflicting files; the merge was aborted and nothing was pushed.

Conflicts by directory

   4 .github/workflows
   3 packages/opencode/src/session
   3 packages/opencode/src/cli/cmd/run
   2 packages/opencode/test/provider
   2 packages/opencode/test/cli/run
   2 packages/opencode/src/tool
   2 packages/opencode/src/provider
   2 packages/opencode/src/cli/cmd
   2 packages/core/test
   2 packages/core/src/tool
   2 packages/core/src
   2 packages/app
   1 turbo.json
   1 script
   1 patches
   1 packages/tui/src/component/prompt
   1 packages/tui/src/component
   1 packages/tui/src
   1 packages/tui
   1 packages/storybook/.storybook/mocks
   1 packages/session-ui
   1 packages/sdk
   1 packages/script/src
   1 packages/plugin/src
   1 packages/plugin
   1 packages/opencode/test/tool
   1 packages/opencode/test/session
   1 packages/opencode/test/lib
   1 packages/opencode/test/config
   1 packages/opencode/test/cli/help/__snapshots__
   1 packages/opencode/test/cli/help
   1 packages/opencode/test/agent
   1 packages/opencode/src/server/routes/instance/httpapi/handlers
   1 packages/opencode/src/plugin/openai
   1 packages/opencode/src/config
   1 packages/opencode/src/agent
   1 packages/opencode/src
   1 packages/opencode/script
   1 packages/opencode/bin
   1 packages/opencode
   1 packages/llm
   1 packages/http-recorder
   1 packages/effect-drizzle-sqlite
   1 packages/core/test/plugin/fixtures
   1 packages/core/test/plugin
   1 packages/core/src/plugin
   1 packages/core
   1 packages/app/src/runtime/i18n
   1 package.json
   1 bun.lock
   1 .gitignore
   1 .github/actions/setup-bun
files
.github/actions/setup-bun/action.yml
.github/workflows/generate.yml
.github/workflows/publish.yml
.github/workflows/test.yml
.github/workflows/typecheck.yml
.gitignore
bun.lock
package.json
packages/app/package.json
packages/app/playwright.config.ts
packages/app/src/runtime/i18n/desktop-native.ts
packages/core/package.json
packages/core/src/event.ts
packages/core/src/models-dev.ts
packages/core/src/plugin/variant.ts
packages/core/src/tool/edit.ts
packages/core/src/tool/write.ts
packages/core/test/plugin/fixtures/models-dev.json
packages/core/test/plugin/variant.test.ts
packages/core/test/tool-edit.test.ts
packages/core/test/tool-write.test.ts
packages/effect-drizzle-sqlite/package.json
packages/http-recorder/package.json
packages/llm/package.json
packages/opencode/bin/opencode
packages/opencode/package.json
packages/opencode/script/build.ts
packages/opencode/src/agent/subagent-permissions.ts
packages/opencode/src/cli/cmd/attach.ts
packages/opencode/src/cli/cmd/run/footer.permission.tsx
packages/opencode/src/cli/cmd/run/footer.view.tsx
packages/opencode/src/cli/cmd/run/permission.shared.ts
packages/opencode/src/cli/cmd/session.ts
packages/opencode/src/config/config.ts
packages/opencode/src/index.ts
packages/opencode/src/plugin/openai/codex.ts
packages/opencode/src/provider/provider.ts
packages/opencode/src/provider/transform.ts
packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts
packages/opencode/src/session/processor.ts
packages/opencode/src/session/prompt.ts
packages/opencode/src/session/session.ts
packages/opencode/src/tool/invalid.ts
packages/opencode/src/tool/task.ts
packages/opencode/test/agent/plan-mode-subagent-bypass.test.ts
packages/opencode/test/cli/help/__snapshots__/help-snapshots.test.ts.snap
packages/opencode/test/cli/help/help-snapshots.test.ts
packages/opencode/test/cli/run/permission.shared.test.ts
packages/opencode/test/cli/run/run-process.test.ts
packages/opencode/test/config/config.test.ts
packages/opencode/test/lib/cli-process.ts
packages/opencode/test/provider/provider.test.ts
packages/opencode/test/provider/transform.test.ts
packages/opencode/test/session/processor-effect.test.ts
packages/opencode/test/tool/task.test.ts
packages/plugin/package.json
packages/plugin/src/index.ts
packages/script/src/index.ts
packages/sdk/.gitignore
packages/session-ui/package.json
packages/storybook/.storybook/mocks/solid-router.tsx
packages/tui/package.json
packages/tui/src/component/prompt/index.tsx
packages/tui/src/component/spinner.tsx
packages/tui/src/runtime.tsx
patches/[email protected]
script/beta.ts
turbo.json

Why it matters

The H17 common control reaches OpenCode through ~/.config/opencode/plugins/aidd-cc.ts (claude-code-skills opencode/aidd-cc.ts), which relies on experimental.text.complete, session.idle, tool.execute.before/after and chat.message. Upstream plugin-API changes since September are not reflected in the fork or in the binary we run, so the live OpenCode lane is tested against a September build.

Proposal

A dedicated session: merge upstream/dev into a chore/sync-upstream-dev-<date> branch, resolve the 68 conflicts (guardrails package vs. core moves), run bun run local:check (note #338/#339 pre-existing failures), rebuild packages/opencode/dist/opencode-darwin-arm64, re-run the H17 OpenCode replay arm and one live lane, then PR to dev. Owner decision needed on whether fork-side core patches are kept or re-based as guardrails-only.

Opened by the H17 landing session (claude-code-skills anomalyco#420–anomalyco#424) while checking whether the fork reflects upstream; it does not.

Activity

  1. terisuke commented on Oct 18, 2026

    @terisuke
    Author

    Re-platform decision (owner, 2026-10-18) and what is in place

    Merging upstream is not the path: upstream removed packages/opencode (the fork's binary and 15,417 lines of fork patches) and replaced the plugin API — none of the five 1.x hook names exist in @opencode/plugin 2.0.32. The fork is re-platformed on the upstream CLI instead.

    Done so far:

    • @opencode/[email protected] installed in a separate prefix (~/.opencode-2/pkg) with its own config/data/state (~/.opencode-2/{config,data,state}), launcher ~/.local/bin/opencode2.
    • H17 plugin ported to the 2.x promise API: claude-code-skills Random characters in text box show up when scrolling the TUI. anomalyco/opencode#426 (opencode/aidd-cc-v2, loaded as a directory; mapping table in the PR). Driver test against the real oracle passes; a server-side spike showed the directory plugin loading and session.prompt firing.

    Open:

    • Live 2.x lane with a real key (tool call → Status re-prompt) from the owner's terminal.
    • packages/guardrails (fork, 95 files): its plugins are 1.x shape and import fork internals (packages/opencode/src/util/background) — needs the same kind of port (ctx.model.transform for the whitelist, ctx.tool.hook for gates, ctx.session.hook("prompt") for issue gates). Not started.
    • Fork dev re-base: proposal = new branch from upstream/dev carrying only packages/guardrails (ported) + docs; the 1.x binary stays available as the September build until the guardrails port lands.
  2. terisuke commented on Oct 18, 2026

    @terisuke
    Author

    2026-10-18 23:05Z: H17 2.x plugin confirmed live on upstream @opencode/cli 2.0.32 from the owner's terminal via opencode2 (tool call → no status declared after tool use block → re-prompt → Status: complete without Evidence → block). Details on claude-code-skills anomalyco#426. Remaining: guardrails port and fork re-base.

  3. terisuke commented on Oct 19, 2026

    @terisuke
    Author

    Re-platform progress (2026-10-19):

    • feat(guardrails): re-platform fork dev onto upstream 2.x (guardrails on the 2.x plugin API) #343 feat(guardrails): re-platform fork dev onto upstream 2.x — branch feat/replatform-upstream-2x = upstream anomalyco/opencode dev da9d436c36 + packages/guardrails on the 2.x plugin API (bridge in profile/src/v2/, entries profile/plugins/{guardrail,team}/index.ts, 1.x sources moved to profile/src/ because 2.x auto-discovers every top-level *.ts under plugins/). Fork history kept as ancestor via merge -s ours, so the PR merges without the 68 conflicts of a plain sync. bun test profile/src profile/plugins 104 pass; live load with @opencode/cli 2.0.32: three plugin directories load, 0 failed loads.
    • claude-code-skills#426 — the AIDD H17 common control as a 2.x directory plugin (aidd-cc-v2) + opencode2 launcher; the guardrails launcher passes it through OPENCODE_GUARDRAILS_EXTRA_PLUGINS.
    • Local entrypoint: ~/.local/bin/opencode → opencode2 (2.x + guardrails profile + H17), the 1.x wrapper stays as opencode1.

    Not carried onto the new dev: scripts/local-dev-deploy.sh (1.x dist pinning) and the fork's 1.x patches inside upstream packages. Open until #343 merges and the owner runs the real-key lane.

  4. terisuke commented on Oct 19, 2026

    @terisuke
    Author

    クローズ条件 3 つがそろったので閉じます(2026-10-19)。

    • (a) fork 独自の guardrails を 2.x に移植:profile/src/v2/ の橋渡しで、1.x の guardrail.ts / team.ts をそのまま 2.x プラグイン API に載せた。bun test profile/src profile/plugins 117 pass。
    • (b) fork の dev を上流に載せ替え:feat(guardrails): re-platform fork dev onto upstream 2.x (guardrails on the 2.x plugin API) #343 を 7cca54fdb1 でマージ。上流 anomalyco/opencode dev(da9d436c36)+ packages/guardrails。旧 dev は merge -s ours で祖先として残した。
    • (c) 無印 opencode を 2.x に切り替え:本機の ~/.local/bin/opencode → opencode2(2.x+guardrails+H17)。1.x は opencode1。

    実キーでの確認(本人の端末、2026-10-19 12:46–12:50Z):H17 が Status なしの完了を block し、guardrails が保護ブランチへの push を実行前に拒否した。記録は aidd-governance#205(h17-common-control.md §18.2)。

    持ち越さなかったもの:fork の 1.x コアへのパッチ、scripts/local-dev-deploy.sh、artifacts/。上流のワークフローのうち test / check / storybook / nix-eval は上流専用のランナー(blacksmith-4vcpu-ubuntu-2404)を要求するため、この fork では起動しない(dev の必須チェックは gitleaks のみ)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions