Skip to content

Pin managed OpenCode to 2.2.7 so Sonar Pro replies finish and PDFs reach GitHub Copilot models - #4280

Merged
zeroliu merged 1 commit into
masterfrom
zeroliu/bug-bash-opencode-2.2.7
Nov 11, 2026
Merged

zeroliu merged 1 commit into
masterfrom
zeroliu/bug-bash-opencode-2.2.7

Conversation

@zeroliu

@zeroliu zeroliu commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Relates to #2921
Relates to #4116

Why

Agent Chat on OpenCode runs the OpenCode release Copilot downloads for the user, pinned to 2.0.32. Two failures come from code inside that release, not from Copilot:

What

Managed OpenCode moves to 2.2.7, the latest release. Users on the managed install get it on their next plugin load, as with earlier pins. Settings → Agents → OpenCode → Configure offers v2.2.7 for new installs.

Scenario 2.0.32 2.2.7
perplexity/sonar-pro, sonar-reasoning-pro (real API) Garbled reply after 51 s of retries Full reply in seconds; sonar-pro also calls tools
perplexity/sonar (real API) Garbled reply after 84 s of retries Fails at once: Tool calling is not supported for this model
GitHub Copilot model reads a vault PDF Fails with the PDF error before sending the request The PDF is sent as a file part and the model answers

Copilot's own OpenCode integration behaves the same on 2.2.7. A real turn showed each of these working:

  • The plugin still strips OpenCode's temp-folder line, worktree hint and report skill from the prompt.
  • Edit, write and patch still report the files' original text, so turn diffs are exact.
  • The session_move deny rule still holds.
  • Ask-first permission cards and "Always allow" rules still work, and the Approved rules page lists and removes saved rules.
  • Copilot's tool server connects, and its tools are offered as direct tools.
  • Chats created on 2.0.32 reopen and continue on 2.2.7.
  • Copilot Plus models (all 6 enabled for OpenCode, real license key): plain, tool and edit turns work on both versions, with no effort levels guessed. Copilot writes variants: [] for them, and OpenCode 2.2.7 only guesses when variants is absent.
  • A feature-map pass of everything that goes through the OpenCode binary (input, replies, queue, permission cards, error and report cards, Revoke all, projects, skills, chat lifecycle) found no difference from 2.0.32.

Non goal

Screenshot

Before is master with OpenCode 2.0.32; after is this branch with OpenCode 2.2.7. Perplexity runs use the real API; GitHub Copilot runs use a local stand-in server.

perplexity/sonar-pro, before:
live-before-sonar-pro

perplexity/sonar-pro, after:
live-after-sonar-pro

perplexity/sonar, after (fails fast; still open in #2921):
live-after-sonar-low

GitHub Copilot model reading a PDF, before:
before-4116-pdf

GitHub Copilot model reading a PDF, after:
after-4116-pdf

Managed install through Configure:
after-install-done

Turn diff after write and edit on 2.2.7:
after-turn-diff-edit-write

Risk

High

Criterion Status Reason
No behavior change, or a cosmetic/copy/docs/config change visible where it renders, or deterministic tests cover the changed behavior ❌ Every OpenCode Agent Chat turn runs a different third-party runtime; cannot be covered by an automated test because CI does not download or run the OpenCode binary
A defect would fail CI or be obvious on first use ❌ Most breakage would show on the first turn, but a changed provider route (such as Perplexity now receiving tools and an effort level) only shows with real provider traffic
A revert fully restores prior state, including persisted data ❌ 2.2.7 migrates OpenCode's own session database; going back to 2.0.32 on the same data was not tested
No auth, permissions, secrets, or input-handling surface changes ✅ Copilot's permission rules and config are unchanged, and saved rules behave the same on 2.2.7
No public API, plugin API, message, or on-disk contract changes ❌ Copilot depends on OpenCode's ACP, config, plugin hook and server API contracts, which change across 2.0.32 → 2.2.7
No core-path concurrency, async-lifecycle, or state-machine changes ✅ Copilot's session lifecycle code is unchanged
No hot-path behavior lacks deterministic coverage ❌ The agent runtime is the hot path; its behavior is covered only by the real turns in Verification
No new dependency ✅ Dependency manifests are unchanged; only the pinned download version moves
Human-only behavior stays in one feature area and surfaces quickly ✅ Limited to Agent Chat on OpenCode

Review: run Verification steps 1-6, including the Sonar and PDF variants. The only production change is OPENCODE_PINNED_VERSION in src/agentMode/backends/opencode/ui/opencodeVersion.ts.

Verification

  1. On a vault set to managed OpenCode 2.0.32, load this build. A notice says OpenCode updated to 2.2.7, and Settings → Agents → OpenCode → Configure shows v2.2.7 (pinned) as Ready.
  2. Start an Agent Chat on a free opencode/*-free model and send Reply with the single word: pong. The reply arrives.
  3. In Safe mode, ask the agent to create a note and then edit an existing one. Each write and edit asks for permission. After the turn, "Files changed" lists both files with the right line counts. Choosing "Always allow" adds a rule to Settings → OpenCode → Edit approved rules, and Remove deletes it.
  4. Ask the agent to run its Obsidian CLI tool. A permission card for obsidian-copilot · Obsidian cli appears, and the answer uses the tool's result.
  5. With a Perplexity key, chat on perplexity/sonar-pro. The full answer arrives without a validation error. On perplexity/sonar the turn fails at once with Tool calling is not supported for this model.
  6. With a GitHub Copilot account, attach a PDF to a chat on a GitHub Copilot model and ask about it. The model answers instead of failing with the PDF error.

Note

  • On 2.2.7, OpenCode guesses effort levels (low, medium, high) for a model whose config has no variants field. Copilot leaves that field to OpenCode for providers OpenCode knows natively, so the Perplexity models get · low in the picker and send reasoning_effort. Perplexity accepted it at every level in real requests. Copilot Plus and custom providers are not affected.
  • Citations: Perplexity streams source URLs, but Agent Chat shows only the [1] markers, on both versions.
  • Keep OpenCode's loopback traffic off HTTP proxies #4276 (NO_PROXY for loopback) becomes redundant for managed installs: from 2.2.4 OpenCode adds 127.0.0.1,localhost,::1 to NO_PROXY itself. With HTTP(S)_PROXY set to a proxy that rejects everything, 2.2.7 still started, connected to Copilot's tool server and answered from a local model; the proxy saw only external hosts. It still helps custom installs older than 2.2.4.

…each GitHub Copilot models

OpenCode 2.0.32 bundles @ai-sdk/perplexity 3.0.26, which rejects Sonar
stream chunks without delta.role, and runs GitHub Copilot's chat models
through a vendored converter that refuses PDF file parts. 2.2.7 routes
Perplexity through its openai-compatible protocol and runs GitHub Copilot
on its native protocols (anomalyco/opencode#62034).

Relates to #2921
Relates to #4116

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zeroliu

zeroliu commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@vercel

vercel Bot commented Nov 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
obsidian-copilot-docs Ignored Ignored Nov 11, 2026 1:26am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T06:15:09.113846Z d55cce9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: d55cce92b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zeroliu zeroliu changed the title Pin managed OpenCode to 2.2.7 so Sonar replies finish and PDFs reach Copilot models Pin managed OpenCode to 2.2.7 so Sonar Pro replies finish and PDFs reach GitHub Copilot models Nov 11, 2026
@zeroliu
zeroliu marked this pull request as ready for review November 11, 2026 06:11
@zeroliu
zeroliu merged commit bef17b8 into master Nov 11, 2026
20 checks passed
@zeroliu
zeroliu deleted the zeroliu/bug-bash-opencode-2.2.7 branch November 11, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant