OpenCode v2.2.6 stops project files from running scripts on its server

2 days ago

OpenCode v2.2.6 for developers who code with OpenCode: the server API now serves files as sandboxed downloads and refuses cross-site requests, webfetch rejects URLs with credentials and checks redirects, opencode run waits for its background jobs, starts in a new git worktree with -w and archives CI sessions with --archived, and MCP servers can share one connection with pool: true. https://github.com/anomalyco/opencode/releases/tag/v2.2.6 https://github.com/anomalyco/opencode/blob/v2.2.6/CHANGELOG.md https://github.com/anomalyco/opencode/compare/v2.2.5...v2.2.6

Ask about this presentation

Chapters

  1. 0:00Project files can't run scripts on the server
  2. 0:14Webfetch checks more before it fetches
  3. 0:28opencode run waits for its background jobs
  4. 0:41Start a scripted run in a new worktree
  5. 0:52Scripted runs stay out of your inbox
  6. 1:06MCP servers can share one connection
  7. 1:17Three fixes
  8. 1:31Run OpenCode in CI? Upgrade, and set a timeout
Show transcript
  1. OpenCode shuts a hole in its server. Files and media from the server API now arrive as sandboxed downloads, and the API refuses cross-site requests, so a file in your project can't run scripts on the server.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #62422
    Files and media served by the server API as sandboxed downloads
    Requests to /api/* refused from other sites and disallowed origins
  2. Webfetch gets stricter too. It rejects URLs that carry credentials, ignores the fragment when it matches your permission rules, and in Code Mode, every redirect is checked against your webfetch rules.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #60502 · PR #61701 · PR #62373
    URLs with credentials rejected by webfetch and Code Mode fetch
    The #fragment ignored when matching permission rules
    Every redirect checked against your webfetch rules in Code Mode
  3. OpenCode run now waits for the shell commands and subagents its prompt started, then lets the model answer them. There's no time limit, so a dev server keeps the run open. Give CI jobs a timeout.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #60699 · PR #61911

    Shell commands, subagents and image jobs finish, and the model answers their results before the run exits

    No time limit: a dev server keeps the run open. Set a timeout on CI jobs.

  4. With the worktree flag, OpenCode run starts its session in a new git worktree, and you can give that worktree a name. It can't be combined with continuing an existing session.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #60712
    opencode run -w

    Name the worktree if you like. Not with --continue or --session.

  5. Add the archived flag, and OpenCode run creates the session already archived, so CI runs stay out of your inbox and session lists. Continuing your last session skips them too.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #61270
    opencode run --archived

    Hidden from the TUI session list, and skipped by --continue

  6. Turn on pooling for an MCP server, and every project with the same setup shares one connection to it. You run fewer processes, and OpenCode starts faster.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #61185
    "pool": true

    Projects with the same setup share it: fewer processes, faster starts

  7. Startup no longer hangs when the OpenCode Console never answers. Provider requests keep retrying while their host is unreachable. And Control Z suspends OpenCode even with a dialog open.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md · PR #62404 · PR #61880 · PR #62118
    Startup no longer hangs when the OpenCode Console never answers
    Unreachable hosts provider requests keep retrying
    Ctrl+Z suspends OpenCode even with a dialog open
  8. If you run OpenCode in CI, I'd upgrade now for the server and webfetch fixes, and give each job a timeout. The rest is in OpenCode's changelog.

    Slide text
    opencode
    anomalyco/opencode · CHANGELOG.md

    Run OpenCode in CI? Upgrade, and give the job a timeout.

    Everything else in this release: OpenCode's CHANGELOG.md on GitHub

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York