Skip to content

sync: upstream v1.14.48 (ce66b191d on dev)#58

Merged
Alezander9 merged 220 commits into
mainfrom
sync/upstream-v1.14.48
May 12, 2026
Merged

sync: upstream v1.14.48 (ce66b191d on dev)#58
Alezander9 merged 220 commits into
mainfrom
sync/upstream-v1.14.48

Conversation

@Alezander9
Copy link
Copy Markdown
Member

Summary

Brings anomalyco/opencode up to v1.14.48 (ce66b191d on dev). 219 upstream commits across v1.14.42 – v1.14.48. Follow-up to PR #57 which stopped at v1.14.41.

Per admin call, adopted the three large upstream features in this window rather than skipping them:

  1. Native LLM core foundation (PR #24712) — new packages/core/src/... LLM primitives.
  2. Scout agent (PR #24149) — new built-in scout agent for repo research, wired into agent.ts via PROMPT_SCOUT from prompt/scout.txt.
  3. OPENCODE_EXPERIMENTAL_WORKSPACES routing rewrite — workspace fence headers, fixed-id routing, claim-detached-sessions, plus new packages/opencode/src/server/shared/workspace-routing.ts + httpapi/{middleware,groups,handlers}/workspace* surface. Flag-gated, safe when off.

Major upstream removal pulled through

PR #25667 deleted the Hono backend (~7600 LOC, 57 files removed under packages/opencode/src/server/routes/{control,global,instance/*}.ts + adapters/error/fence/middleware/proxy). The httpapi-server (Effect HttpRouter) is the sole server now. Took deletions verbatim — our previous in-tree edits to those files were only OpenAPI title strings (bcode / browsercode api), no real divergence to preserve. Also dropped our openapiHono() helper from server/server.ts which was explicitly marked "delete once the Hono backend is removed."

Other notable upstream changes pulled in

  • Schema utilities relocated packages/opencode/src/util/{effect-zod,schema}.tspackages/core/src/{effect-zod,schema}.ts (PR #26565 — mechanical import-string rewrites).
  • Session schema loosened to tolerate negative token counts / legacy numeric data (PRs #26620, #26622).
  • Image handling auto-resize + max size constraints (PR #26401).
  • Websearch parallel provider rollout (PR #26227).
  • Opentui keymap replaces legacy keybind system (PR #26053 + #26421 — removed cli/cmd/tui/config/legacy-keymap-transform.ts, cli/cmd/tui/context/{keybind,plugin-keybinds}.tsx, config/keybinds.ts, tui/component/{dialog-command,textarea-keybindings}.ts).

Conflicts resolved (7 + 8 modify/delete)

File Resolution
bun.lock took theirs, regenerated via bun install
.github/workflows/test.yml + 7 server-route files modify/delete — took upstream deletions (Hono cleanup); our edits were only OpenAPI brand strings
package.json kept filtered typecheck script, took upstream's new upgrade-opentui script
packages/opencode/package.json kept @browser-use/browsercode-core, bumped to 1.14.48
packages/opencode/bin/bcode kept BCODE_BIN_PATH env var + .bcode cache dir, adopted upstream's consolidated resolved pattern (dropped the eager run() blocks — now centralized at line ~190)
packages/opencode/src/agent/agent.ts kept Skills import, added upstream's new Flag import
packages/opencode/src/cli/cmd/tui/app.tsx re-shaped our docs.open command-palette entry to upstream's new {name, title, category, run} schema (was using the legacy {value, onSelect} shape); positioned next to upstream's new app.console toggle
packages/opencode/src/server/server.ts dropped our openapiHono() helper — explicitly marked for removal once Hono went away
packages/opencode/src/session/retry.ts kept neutralized GO_UPSELL_MESSAGE = "Free usage exceeded", added neutralized GO_UPSELL_URL = "", adopted upstream's new RetryReason / Retryable types (now used by cli/cmd/tui/routes/session/index.tsx:104 and elsewhere)

Yellow-zone audit

8 files touched upstream: core/src/global.ts, agent/agent.ts, cli/cmd/run.ts, cli/cmd/tui/{app.tsx,routes/session/index.tsx}, config/config.ts, provider/provider.ts, session/session.ts.

Customizations preserved: app = "bcode", BC | … terminal title, BrowserCode GitHub link, 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 tool registration + renderer, "run bcode with a message" describe.

Verification

  • bun install: clean (lockfile regenerated)
  • bun run typecheck: 6/6 passed in 10.2s

Sync state

After this lands, UPSTREAM.md shows ce66b191d as the latest opencode anchor — fully caught up with the latest release point.

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 12, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Google API Key 5bb7b23 packages/http-recorder/test/record-replay.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 702 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/app/src/pages/layout/sidebar-project.tsx">

<violation number="1" location="packages/app/src/pages/layout/sidebar-project.tsx:307">
P2: Using `globalSync.child()` inside `isWorking` pins every scanned workspace store. In the sidebar this can accumulate long-lived pinned stores and cause avoidable memory/cache pressure.</violation>
</file>

<file name="packages/console/app/src/routes/zen/util/variant.ts">

<violation number="1" location="packages/console/app/src/routes/zen/util/variant.ts:1">
P2: Guard `body` in this parser; direct property access on an undefined payload will throw at runtime.</violation>

<violation number="2" location="packages/console/app/src/routes/zen/util/variant.ts:10">
P2: Add a default object for `body` to prevent runtime crashes when payload is missing.</violation>

<violation number="3" location="packages/console/app/src/routes/zen/util/variant.ts:19">
P2: This function should handle an undefined payload; otherwise variant parsing can throw before fallback logic runs.</violation>
</file>

<file name="packages/console/app/src/routes/workspace/[id]/usage/usage-section.tsx">

<violation number="1" location="packages/console/app/src/routes/workspace/[id]/usage/usage-section.tsx:56">
P2: Output token total now excludes reasoning tokens, making the displayed total inconsistent with the output breakdown and underreporting usage.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.
Fix all with cubic

const projectStore = createMemo(() => globalSync.child(props.project.worktree, { bootstrap: false })[0])
const isWorking = createMemo(() =>
dirs().some((directory) => {
const [store] = globalSync.child(directory, { bootstrap: false })
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Using globalSync.child() inside isWorking pins every scanned workspace store. In the sidebar this can accumulate long-lived pinned stores and cause avoidable memory/cache pressure.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/app/src/pages/layout/sidebar-project.tsx, line 307:

<comment>Using `globalSync.child()` inside `isWorking` pins every scanned workspace store. In the sidebar this can accumulate long-lived pinned stores and cause avoidable memory/cache pressure.</comment>

<file context>
@@ -301,6 +302,12 @@ export const SortableProject = (props: {
   const projectStore = createMemo(() => globalSync.child(props.project.worktree, { bootstrap: false })[0])
+  const isWorking = createMemo(() =>
+    dirs().some((directory) => {
+      const [store] = globalSync.child(directory, { bootstrap: false })
+      return Object.values(store.session_status).some((status) => status?.type === "busy" || status?.type === "retry")
+    }),
</file context>
Suggested change
const [store] = globalSync.child(directory, { bootstrap: false })
const [store] = globalSync.peek(directory, { bootstrap: false })
Fix with Cubic

return budget > 16_000 ? "max" : "high"
}

export function parseOpenAiVariant(body: any) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This function should handle an undefined payload; otherwise variant parsing can throw before fallback logic runs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/console/app/src/routes/zen/util/variant.ts, line 19:

<comment>This function should handle an undefined payload; otherwise variant parsing can throw before fallback logic runs.</comment>

<file context>
@@ -0,0 +1,21 @@
+  return budget > 16_000 ? "max" : "high"
+}
+
+export function parseOpenAiVariant(body: any) {
+  return body.reasoningEffort ?? body.reasoning_effort ?? body.reasoning?.effort
+}
</file context>
Suggested change
export function parseOpenAiVariant(body: any) {
export function parseOpenAiVariant(body: any = {}) {
Fix with Cubic

return budget > 16_000 ? "max" : "high"
}

export function parseGoogleVariant(body: any) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Add a default object for body to prevent runtime crashes when payload is missing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/console/app/src/routes/zen/util/variant.ts, line 10:

<comment>Add a default object for `body` to prevent runtime crashes when payload is missing.</comment>

<file context>
@@ -0,0 +1,21 @@
+  return budget > 16_000 ? "max" : "high"
+}
+
+export function parseGoogleVariant(body: any) {
+  const thinkingConfig = body.generationConfig?.thinkingConfig ?? body.thinkingConfig
+  if (thinkingConfig?.thinkingLevel) return thinkingConfig.thinkingLevel
</file context>
Suggested change
export function parseGoogleVariant(body: any) {
export function parseGoogleVariant(body: any = {}) {
Fix with Cubic

@@ -0,0 +1,21 @@
export function parseAnthropicVariant(body: any) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Guard body in this parser; direct property access on an undefined payload will throw at runtime.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/console/app/src/routes/zen/util/variant.ts, line 1:

<comment>Guard `body` in this parser; direct property access on an undefined payload will throw at runtime.</comment>

<file context>
@@ -0,0 +1,21 @@
+export function parseAnthropicVariant(body: any) {
+  const effort = body.effort ?? body.output_config?.effort ?? body.outputConfig?.effort ?? body.thinking?.effort
+  if (effort) return effort
</file context>
Suggested change
export function parseAnthropicVariant(body: any) {
export function parseAnthropicVariant(body: any = {}) {
Fix with Cubic


const calculateTotalOutputTokens = (u: Awaited<ReturnType<typeof getUsageInfo>>[0]) => {
return u.outputTokens + (u.reasoningTokens ?? 0)
return u.outputTokens
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Output token total now excludes reasoning tokens, making the displayed total inconsistent with the output breakdown and underreporting usage.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/console/app/src/routes/workspace/[id]/usage/usage-section.tsx, line 56:

<comment>Output token total now excludes reasoning tokens, making the displayed total inconsistent with the output breakdown and underreporting usage.</comment>

<file context>
@@ -53,7 +53,7 @@ export function UsageSection() {
 
   const calculateTotalOutputTokens = (u: Awaited<ReturnType<typeof getUsageInfo>>[0]) => {
-    return u.outputTokens + (u.reasoningTokens ?? 0)
+    return u.outputTokens
   }
 
</file context>
Suggested change
return u.outputTokens
return u.outputTokens + (u.reasoningTokens ?? 0)
Fix with Cubic

@Alezander9 Alezander9 merged commit ce8cf48 into main May 12, 2026
2 of 3 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.