sync: upstream 195f59264 (between v1.14.50 and v1.14.51)
Summary
Brings anomalyco/opencode from ce66b191d (v1.14.48, our previous anchor) to 195f59264 (refactor(server): simplify listener lifecycle, between v1.14.50 and v1.14.51). 379 upstream commits.
Did NOT target v1.14.51. Upstream's chore: generate commit e62ebd8fe (the parent of 4e7a60dac/v1.14.51) regenerated packages/sdk/openapi.json + the v2 SDK in a way that drops EventMessageUpdated/EventMessagePartUpdated from the SDK's Event union — while cli/cmd/run.ts, acp/agent.ts, cli/cmd/run/{demo,session-data,stream.transport}.ts, etc. still string-compare against those types. A pristine checkout of 4e7a60dac produces 207 typecheck errors. The parent commit 195f59264 is the last clean point that still includes the upstream image-fix PR #26805 we wanted, so I anchored there. Recommend retrying once upstream re-aligns its event consumers with the new SyncEvent shape.
Why this sync now
User pointed at our PRs #64 (fix/strict-temperature-required-models) and #69 (fix/photon-load-and-typed-omitted-message) and asked whether upstream had fixed those independently and if so to adopt upstream and drop our exceptions.
- PR #69 (image fix). ✅ Upstream's
981e00971(PR #26805) fixes the photon WASM loading bug differently and more cleanly — top-levelimport photonWasm from ".../photon_rs_bg.wasm" with { type: "file" }thenpath.isAbsolute/fileURLToPathto compute__OPENCODE_PHOTON_WASM_PATH, replacing our runtimenew Function/createRequireeval path. Upstream also renamedImagePhotonUnavailableError→ImageResizerUnavailableErrorand changedloadPhotonto fail-fast (nonullfallback). Adopted upstream'simage.tsverbatim. Our PR #69 exception onimage.tscan be removed fromEXCEPTIONS.mdafter this lands. - PR #69 (processor.ts typed-omitted-message). ❌ Upstream's
processor.tsfalls back to[N image(s) omitted: could not be resized below the image size limit.]regardless of whichImage.Errorfired. Our PR #69 surfaces typed reasons (decode / size / unavailable / malformed URL) grouped by_tag. Kept our version, just updated thecaselabel fromImagePhotonUnavailableErrortoImageResizerUnavailableError. - PR #64 (temperature). ❌ Upstream did NOT include the operand swap. Kept our fix.
Conflicts resolved
| File | Resolution |
|---|---|
packages/opencode/package.json | Kept @browser-use/browsercode-core, bumped version string to 1.14.51 |
bun.lock | --theirs, regenerated via bun install |
30 .github/workflows/*.yml | Re-deleted per PR #14 |
src/agent/agent.ts | Kept Skills + Flag imports + Scout referencePrompt/referenceDescription block. Added missing Reference import (auto-merge dropped it). |
src/cli/cmd/tui/feature-plugins/home/tips-view.tsx | Kept brand strings (bcode.json, ~/.config/bcode, .bcode/commands/agents/tools/plugins/themes, BrowserCode). Adopted upstream's dynamic-shortcut refactors + formatter/lsp tip rewordings. Dropped the new docker/zen marketing tips. |
src/image/image.ts | Adopted upstream verbatim (PR #26805). |
src/index.ts | Combined trace + isRecord imports. |
src/installation/index.ts | Kept our curl-only Method surface but rebuilt on upstream's new appProcess.run shape + userAgent(client) factory. Added back Flag import for the UA default. |
src/plugin/index.ts | Combined Laminar + DigitalOcean plugins in INTERNAL_PLUGINS. |
src/provider/provider.ts | Kept bcode.sh / bcode headers for nvidia. Dropped upstream's new X-BILLING-INVOKE-ORIGIN: OpenCode (would phone home wrong brand). |
src/server/shared/ui.ts | Adopted upstream's embeddedUI(disableEmbeddedWebUi) signature. Kept F7 phone-home removal (dropped requestBody/proxyResponseHeaders/upstreamURL). |
src/session/processor.ts | Kept our typed-message UX. Renamed ImagePhotonUnavailableError case to ImageResizerUnavailableError. |
src/storage/db.ts | Adopted upstream's flags: ChannelDbFlags signature. Kept bcode.db / bcode-<channel>.db filenames. |
src/tool/registry.ts | Adopted upstream's SessionStatus + BackgroundJob + RuntimeFlags additions. Split FetchUse.layer into its own .pipe() call (Effect caps .pipe() at 20 args; pre-piped with FetchHttpClient.layer so its HttpClient dep doesn't escape). |
src/tool/webfetch.ts | Combined FetchUse + Config + Parser imports. |
test/storage/db.test.ts | Adopted upstream's new it.effect + RuntimeFlags.layer shape. Kept bcode.db filenames. |
test/tool/registry.test.ts | Adopted upstream's factory shape. Same FetchUse pipe-split as the source. |
test/tool/webfetch.test.ts | Adopted upstream's Effect.acquireUseRelease test shape. Promoted top it = testEffect(...) to include FetchUse + Config layers. |
Brand sweep
packages/core/src/models.ts is a NEW file from upstream that includes USER_AGENT = \"opencode/...\". Rebranded to browsercode/... in the F7-style sweep so it doesn't ship as a regression of that work.
Verification
bun install: clean, regenerated lockfile.bun run typecheck: 7/7 packages passed in ~10s (one-time cold run).- Pristine 195f59264 standalone also typechecks clean (sanity check that we hit the right anchor and aren't compounding upstream's regression).
Yellow-zone audit
12 files touched upstream + at our zone: customizations preserved across the board (banner/title BC, bcode.sh HTTP-Referer/X-Title/X-Source across 8 providers, Cerebras X-Cerebras-3rd-Party-Integration: bcode, .bcode/plans, .bcode/agent-workspace, Skills import, BrowserExecute renderer, bcode.db filenames, bcode.sh/install curl bootstrap, Method surface stays curl-only, userAgent(client) returns browsercode/...).
EXCEPTIONS.md follow-up
Not in this PR (lives outside this repo in the maintainer's agent memory). To be updated to:
- Remove the implicit PR #69
image/image.tsexception (now adopted upstream). - Keep the PR #69
session/processor.tstyped-message exception (BrowserCode-specific UX). - Keep the PR #64
session/llm.tstemperature exception (still slated to be opened upstream).
Summary by cubic
Sync with upstream to a clean pre-v1.14.51 point to pull in image handling and core/server updates, and add console-side TPS limiting + sticky provider persistence. Kept our typed image error UX and temperature fix; skipped v1.14.51 due to an upstream SDK event regression.
-
New Features
- Console
- Per-model TPS limiter and DB-backed sticky provider tracking; new Cloudflare Worker
Statfor TPS history. - Honeycomb webhook handles low TPS alerts.
- Per-model TPS limiter and DB-backed sticky provider tracking; new Cloudflare Worker
- App
- Project quick-switch hotkeys (
mod+1…mod+9); improved “session working” state; review panel unmounts when closed. - Todo dock collapse state is remembered per session.
- Palette/keybinds hide
hiddencommands; dialog excludes hidden options. - MCP shows “needs client registration” and click-to-auth; toggle/connect flow hardened; popover prioritizes MCP issues.
- Clearer server errors by unwrapping SDK-wrapped causes.
- Project quick-switch hotkeys (
- Core
- New
aisdkbridge (adds SSE timeout guard) andcatalogmodule for providers/models. - Auth storage migrated to v2 with on-write migration from legacy file.
- Removed
effect-zod; moved/renamed GitHub Copilot helpers.
- New
- Console
-
Dependencies
- Updated to
effect/@effect/*4.0.0-beta.65 and@opentui/{core,keymap,solid}0.2.10. - Package versions bumped to 1.14.50 where applicable;
bun.lockand Nix hashes refreshed. - CI hardening: pin
actions/checkout,actions/create-github-app-token, andoven-sh/setup-bun; split cache restore/save;bunfig.tomladdsminimumReleaseAge.
- Updated to