Merge upstream opencode v1.17.14

Merged
KE
3mo ago
+152603-38641

TL;DR

Upstream v1.17.14 merged into dev, every fork patch preserved. This unlocks code mode (dark by default) โ€” measured โˆ’51% session cost in the prod A/B. The merged tree is byte-identical to the fully-tested branch: nothing in this PR is untested.

flowchart TD
    UP["upstream v1.17.14<br/>152k lines, already shipped upstream"] --> M
    DEV["dev<br/>our 27-patch fork stack"] --> M
    M["THIS PR: merge commit<br/>only 9 files / 21 hunks hand-resolved"] --> A
    A["adaptation commits (this PR)<br/>API adapt + mock-free test + CI margin"] --> R
    R["cut release v1.17.14-1"] --> P
    P["andytown 25010<br/>fleet pins, 2 lines"] --> F
    F["andytown 25011<br/>code-mode flag = minus 51 percent cost"]

๐ŸŽฏ Review in 3 steps (~10 min)

  1. (https://github.com/replohq/replopencode/pull/16/commits/5af16e9ba2cda089088852280292c7c21142682f), this is what actually changed on this version vs what opencode has natively. โ† this is the actual review
  2. Our fork surface on the new base - sanity-check the 56-file footprint survived intact (+1,651/โˆ’106 โ€” 7 lines smaller than before the bump)
  3. Skim the upstream release notes (folded below) โ€” that code already shipped to upstream users; it is not ours to review

๐Ÿ”ฅ The 2 conflict files that matter

  • src/mcp/index.ts โ€” 10 hunks. Upstream added per-server instructions tracking in the exact spots our live-headers auth-rotation patch (REPL-29064) lives. Resolution: state, interfaces, storeClient signature, and every lifecycle callsite carry both.
  • src/session/processor.ts โ€” 4 hunks. Upstream deleted the v2 dual-write blocks our TTFT stamps sat next to. Resolution: firstTokenAt/requestStartAt re-anchored to the new reasoning-start/text-start cases; dropped the removed currentTextID field.
๐Ÿงฉ The other 7 conflict files (1 hunk each โ€” click to expand)
  • src/server/event.ts โ€” upstream moved server events into @opencode-ai/schema/server-event; our fork-only global.reloaded now composes { ...ServerEvent, Reloaded } via the schema package's Event.define
  • src/server/routes/instance/httpapi/server.ts โ€” upstream replaced LayerNode.buildLayer with AppNodeBuilderV1.build; our hoisted shared appLayer (the per-listener memoMap singleton sharing SIGHUP reload depends on) adopts the new API
  • src/lsp/lsp.ts โ€” import adjacency: our stall-watchdog breadcrumb (REPL-28760) beside upstream's new LspEvent import; union
  • src/session/tools.ts โ€” import adjacency: breadcrumb beside upstream's new MCP-resource constants; union
  • test/session/prompt.test.ts โ€” upstream rewrote the MCP mock into a makeMcp factory; our refreshHeaders mock line added to it
  • test/server/httpapi-v2-location.test.ts โ€” our REPL-30054 quarantine carried onto upstream's rewritten test (still asserts the exact surface the leak broke; un-skip candidate if CI proves it stable here)
  • bun.lock โ€” took upstream's wholesale; branch lockfile is byte-identical to v1.17.14's
๐Ÿ“ฆ What's in upstream 1.17.10 โ†’ 1.17.14 (already live upstream)
  • 1.17.10 โ€” MCP resources + resource templates, MCP server instructions in session context
  • 1.17.11 โ€” session snapshots + revert controls
  • 1.17.12 โ€” MCP OAuth fixes (reconnect, refresh-token scope, per-URL auth status), skill caching fixes
  • 1.17.13 โ€” reasoning-mode fixes for OpenAI-compatible deployments
  • 1.17.14 โ€” code-mode MCP adapter (execute tool, hidden unless enabled) + paginated MCP tool catalogs

โœ… Already verified โ€” on this exact tree

  • Typecheck + 176 targeted tests green under repo-pinned bun 1.3.14, including the serve SIGHUP subprocess lifecycle tests
  • Release build + throwaway-HOME installer verify (Replopencode vโ€ฆ, SIGHUP smoke)
  • Production sandbox soak: in-place SIGHUP reload (same pid), harness reload + mcp headers refreshed logs, full product sessions
  • A/B vs 1.17.9-8 on real customer prompts: โˆ’51% cost, 1.2โ€“2ร— faster, zero errors (thread)

๐Ÿšฆ Landing order

This PR (now carries the #17 adaptations โ€” GitHub shows #17 as merged into this branch) โ†’ cut v1.17.14-1 โ†’ andytown#25010 (pins) โ†’ andytown#25011 (flag). Merge normally โ€” no force-push choreography.

Supersedes #14/#15 โ€” the rebase-style split could never merge green into a dev that already carries the patch stack. This merge-train sets the convention for future base bumps.

๐Ÿค– Generated with Claude Code