Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

chore(opencode): sync upstream through the V2 promotion parent - #424

Merged
brentyates-swx merged 90 commits into
swxtchfrom
fm/oc-v2-sync-394
Nov 7, 2026
Merged

brentyates-swx merged 90 commits into
swxtchfrom
fm/oc-v2-sync-394

Conversation

@brentyates-swx

@brentyates-swx brentyates-swx commented Nov 6, 2026 •

Copy link
Copy Markdown

Stage 1 of swxtchio/swx-opencode#394. This PR merges only upstream history ending at the first parent of the V2 promotion; runtime promotion and migration qualification remain later stages.

Cut ruling and V1 runtime evidence

Firstmate ruled on 2026-11-06 that the clean-V1 condition is met when this range leaves the V1 runtime in place, even though it updates the existing Core V2 request producer. At target 055d95b, packages/opencode/src/cli/cmd/serve.ts calls Server.listen; the HTTP session handler imports SessionPrompt, server.ts registers SessionPrompt.node, and packages/opencode/src/session/prompt.ts still owns SessionPrompt.prompt and SessionPrompt.loop. The target also contains the separate Core SessionRunner.

The server/session/V1-entry path-filtered diff shown by the command below touches only packages/core/src/session/runner/llm.ts, packages/opencode/src/session/llm/request.ts, and packages/opencode/src/session/message-v2.ts. The broader runtime diff also includes packages/opencode/src/provider/provider.ts, which contains upstream’s timeoutFetch extraction and Cloudflare AI Gateway binding path with header/chunk timeouts; it composes over the fork’s wrapSSE. Upstream anomalyco#52370 adds namespaced Session identity headers to the Core and V1 producers, and anomalyco#53549 filters xAI-rejected tool-result image formats. Neither change alters the V1 CLI/server entry points, V1 prompt owner, or Core V1 Session implementation.

Dated upstream-history evidence (sampled 2026-11-06)

After git fetch origin and git fetch upstream refs/heads/dev:refs/remotes/upstream/dev, these commands were run in the task worktree:

git show -s --format=%H%n%P%n%cI%n%s 5caf1f9f6f5f30e13fc50a788ad953d97ae3748f
5caf1f9f6f5f30e13fc50a788ad953d97ae3748f
055d95bb7e278c94baf06235a52cac79dd13ba67 4617210822bdbb31e5749751afbfb4584ccedac8
2026-10-10T10:58:08-04:00
chore: promote v2 to dev

git rev-parse 5caf1f9f6f5f30e13fc50a788ad953d97ae3748f^1
055d95bb7e278c94baf06235a52cac79dd13ba67

git rev-parse refs/remotes/origin/swxtch
ced557a76389831e71840c285aadf43c7f5c1ec5

git merge-base refs/remotes/origin/swxtch 055d95bb7e278c94baf06235a52cac79dd13ba67
696f41bc8e7586657375d53390925fc54c25d34c

git rev-list --count refs/remotes/origin/swxtch..055d95bb7e278c94baf06235a52cac79dd13ba67
84

git rev-parse refs/remotes/upstream/dev
fe2cbf631f88ea882519b54594da9fdfc947c7d0

git merge-base --is-ancestor 5caf1f9f6f5f30e13fc50a788ad953d97ae3748f refs/remotes/upstream/dev
exit 0

git diff --stat 696f41bc8e7586657375d53390925fc54c25d34c 055d95bb7e278c94baf06235a52cac79dd13ba67 -- packages/opencode/src/cli/cmd/serve.ts packages/opencode/src/server/server.ts packages/opencode/src/server/routes/instance/httpapi packages/opencode/src/session packages/core/src/v1 packages/core/src/session
3 files changed, 14 insertions(+), 1 deletion(-)

git show -s --format=%H %P 6ce31486773dd3eff3a42f659080fae054fe11a6
6ce31486773dd3eff3a42f659080fae054fe11a6 6062435dc4d2f02d070ede56b2660f9c22df4203 055d95bb7e278c94baf06235a52cac79dd13ba67

git merge-base --is-ancestor refs/remotes/origin/swxtch 6ce31486773dd3eff3a42f659080fae054fe11a6
exit 0

git merge-base --is-ancestor 5caf1f9f6f5f30e13fc50a788ad953d97ae3748f 6ce31486773dd3eff3a42f659080fae054fe11a6
exit 1

Donor reconciliation

Conflict resolutions

  • .gitignore keeps the fork test-scratch ignore and upstream /artifacts/ ignore.
  • package.json and bun.lock retain fork Bun 1.4.4 and Solid 1.9.15 selections while taking upstream xAI 3.0.139 and its matching patch. The frozen install passed.
  • packages/core/src/session/runner/llm.ts applies namespaced headers to the provider-turn request and leaves the fork sessionHttp helper in place for title and compaction requests.
  • packages/opencode/script/build.ts retains the fork native FFF library copy and upstream macOS ad-hoc re-sign step.
  • packages/core/test/github-copilot/copilot-chat-model.test.ts and packages/opencode/test/mcp/browser.test.ts retain the more complete fork tests, which cover upstream stream/exit behavior and the fork replay/readiness cases.
  • packages/opencode/test/session/llm.test.ts replaces the prior parent-only header control with root/child cases for OpenCode and custom providers; the fork Foundry progress controls remain. packages/opencode/test/session/message-v2.test.ts retains existing checks plus upstream xAI request-conversion coverage. packages/opencode/test/cli/run/run-process.test.ts keeps the real child exit-code signal with a live harness deadline.

nix/hashes.json now records the four native nodeModules outputs from FFF native platform validation run 42331661816 at PR head 8c6ebf4803b6000c5c607f25f66bac9e774018fb; see the file for exact values confirmed by all four runner logs.

Focused verification (Bun 1.4.4)

  • bun install --frozen-lockfile --ignore-scripts --no-progress: passed, 2,358 packages installed.
  • Core namespaced header controls: root and child tests each passed (1 test); removing the corresponding header made each fail on the missing emitted field. V1 header matrix: bun test --timeout 30000 test/session/llm.test.ts -t "sends session identity headers" from packages/opencode: 4 passed, 39 filtered, 18 expectations. Removing the session header made all four fail; removing the parent header made both child cases fail.
  • xAI tool-result filter: bun test --timeout 30000 test/session/message-v2.test.ts -t "drops tool-result images xai rejects but keeps png and webp" from packages/opencode: 1 passed, 42 filtered, 3 expectations. Removing the filter made the producer request contain image/gif and the regression fail.
  • Browser: bun test --timeout 30000 test/mcp/browser.test.ts -t "browser launcher" from packages/opencode: 3 passed. Copilot: the interleaved selection in copilot-chat-model.test.ts passed 3 cases; the interleaved reasoning selection in convert-to-copilot-messages.test.ts passed 1.
  • CLI unknown-model control: bun test --timeout 30000 test/cli/run/run-process.test.ts -t "exits nonzero without hanging when the model is unknown" from packages/opencode: 1 passed. Three focused provider header/chunk timeout cases and the OpenAI ultrafast service-tier case each passed. Console marketing, stats-app format/catalog, and stats-core catalog/home/inference focused cases passed.
  • bun script/changeset-check.ts with PR chore(opencode): sync upstream through the V2 promotion parent #424 metadata: ok: #424 is recorded. /home/byates/fm-llmrouter/bin/fm-commit-identity-check.sh --crew .: passed. This repository has no bin/fm-lint.sh.

One initial xAI focused invocation omitted the package-configured 30-second timeout and hit Bun's 5-second default; rerunning with --timeout 30000 passed. No timeout or assertion was loosened.

Whole-file tests awaiting Firstmate after review convergence

Run from each package directory, once against the converged pre-ready head:

  • packages/console/app: bun test test/consoleMarketing.test.ts
  • packages/core: bun test test/session-runner.test.ts
  • packages/opencode: bun test --timeout 30000 test/cli/run/run-process.test.ts; bun test --timeout 30000 test/provider/header-timeout.test.ts; bun test --timeout 30000 test/provider/openai.test.ts; bun test --timeout 30000 test/session/llm.test.ts; bun test --timeout 30000 test/session/message-v2.test.ts
  • packages/stats/app: bun test test/agent-formats.test.ts; bun test test/model-catalog.test.ts
  • packages/stats/core: bun test src/domain/catalog-identity.test.ts; bun test src/domain/home.test.ts; bun test src/domain/inference.test.ts

PR CI owns typecheck. Firstmate owns the full ./tests/run.sh post-convergence gate through /home/byates/fm-llmrouter/bin/fm-final-suite.sh oc-v2-sync-394 <immutable-merge-head> --full. The PR remains a draft on fm/oc-v2-sync-394 and targets swxtch.

MrMushrooooom and others added 30 commits September 26, 2026 21:16
…co#51538)

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Cross-compiled darwin binaries ship with an invalid Bun signature, which breaks codesign verification and publisher-based allowlists. Sign them on macOS with the Developer ID certificate and hardened runtime, matching V2, then repack the release zips and publish the signed binaries to npm and Homebrew.

Refs anomalyco#46313
opencode-agent Bot and others added 21 commits October 6, 2026 21:57
Co-authored-by: slickstef11 <stefanavram22@gmail.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Verify the first parent of 5caf1f9 and preserve the reviewed clean-V1 cut.

Review upstream donors and retain V1 queue, tool execution, asks, usage, SQLite, process, and retention behavior.

Merge only the pinned target with --no-ff on fm/oc-v2-sync-394; record the actual range, resolutions, and focused proof.

Push only the assigned draft PR; leave the final suite and landing to firstmate.
@brentyates-swx

Copy link
Copy Markdown
Author

Session ID: unknown
Working repo: /home/byates/fm-worktrees/fm-llmrouter/oc-v2-sync-394/swx-opencode

Merge only 055d95b, the first parent of promotion 5caf1f9, across the 696f41b..055d95b range of 84 upstream commits.

Preserve the V1 CLI/server and SessionPrompt owners plus the fork queue, asks, usage, SQLite retry, process-group and retention paths.

Keep both .gitignore rules; retain Bun 1.4.4 and Solid 1.9.15 while taking the xAI 3.0.139 patch; keep the native FFF library copy and macOS ad-hoc re-signing.

Reconcile the in-range anomalyco#51538 and anomalyco#54207 backports at their existing production owners and retain the stronger fork browser and Copilot replay controls; keep anomalyco#54936 and anomalyco#45383 within the selected cut boundary.

nix/hashes.json refresh pending: values come from the FFF native platform validation nix-node-modules job logs (all four systems) once the PR leaves draft.

Claude-Session: unknown
@brentyates-swx
brentyates-swx marked this pull request as ready for review November 7, 2026 02:56
@brentyates-swx
brentyates-swx merged commit 84c0195 into swxtch Nov 7, 2026
8 of 10 checks passed
@brentyates-swx
brentyates-swx deleted the fm/oc-v2-sync-394 branch November 7, 2026 04:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.