Skip to content

feat(opencode)!: target OpenCode v2 in Flow 10 - #197

Merged
vriesd merged 18 commits into
mainfrom
feat/opencode-v2
Oct 25, 2026
Merged

vriesd merged 18 commits into
mainfrom
feat/opencode-v2

Conversation

@vriesd

@vriesd vriesd commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

Flow 9 uses OpenCode 1 plugin APIs and cannot load on OpenCode 2. Flow 10 targets native OpenCode 2.1.4, with later 2.x releases supported after compatibility checks.

What changed

  • Port registration, tools, permissions, validation capture, continuation, and the model picker to the native server and TUI APIs.
  • Port evaluation and release tooling while preserving historical 9.x evidence. Retain native terminal outcomes and separate HTTP resource completion from input authority.
  • Keep queued preparation separate from execution authority. Recover from locally failed command reservations through fresh checked input, without reviving failed identities. Preserve checked compaction, stale-callback isolation, and authenticated automatic dispatch.
  • Add options.typesafeApiKeyEnv and update installation, configuration, migration, and maintainer documentation.
  • Pin exact Flow 10.0.0 release qualification to canonical openai/gpt-6.1-sol for manager and reviewer. Retain all 17 cases and their pass requirements; later release defaults stay unchanged.
  • Target Node 26 in CI while retaining Bun 1.4.0, OpenCode 2.1.4, and the existing Node.js 24-or-newer package support range.

Scope

  • This is the complete v2 implementation and documentation migration, with OpenCode 1 runtime support removed.
  • Paid release qualification, canary, publication, and public wiki updates follow after review and green CI. This PR authorizes no paid runs.

Tradeoffs

Keep one v2 runtime instead of maintaining a dual-version adapter. Historical serialized evidence remains readable. Native-only turns gain no Flow authority. Unknown-history automatic compaction and execution from summary-only checkpoints remain refused.

The 10.0.0 qualification scope is OpenAI-only and makes no cross-provider reliability claim. Its draft schedules 91 planned or 114 maximum top-level dispatches, with canary approval separate. No paid execution or budget authorization is included in this PR.

The native API exposes no atomic plugin admission mechanism for inputs arriving after the final local scheduling gate. That host race remains unqualified. The recorded intake-only event checks do not establish universal terminal-job completion.

Blast Radius

This changes host integration, execution identity, permissions, and proof tooling. Main's old v1 dependency graph fails its dependency audit; this branch removes that chain, upgrades Zod, and audits clean.

Verification

  • Local full checks pass 5,168 tests with 27 skipped and zero failures. The final Linux runner image is pinned to Node 26.12.1, Bun 1.4.0, and npm 11.20.0. Independent OpenAI source and comment reviews pass. Current provider-scope documentation was swept and corrected. All six historical 9.x policy and host digests and the changelog tail remain unchanged.
  • Qualification CLI admits only canonical openai/gpt-6.1-sol for exact 10.0.0 and rejects mixed providers before authorization. Strict canary and publication verification reject wrong manager or reviewer identities, including a self-consistent wrong pair. Current steps derive 72 primary cells and 17 reserves, 90 primary dispatches, 23 reserve dispatches, and one probe. The 114-dispatch draft is unapproved and needs refresh at final candidate freeze. It does not cap internal generation or cost; canary dispatches need separate approval. See the qualification policy.
  • All eight compiled runtime JS, map, and declaration files remain byte-identical to the tested 40356323 runtime. Its package af10177f passed the unchanged 119-assertion native smoke and all 23 failed-reservation recovery checks on OpenCode 2.1.4, using five loopback requests. These are retained runtime checks; changed policy and changelog still require a fresh release candidate and evaluator freeze before paid qualification. See the reservation recovery record.
  • Capture-failure reporting was verified at 0228d8af with the same armed persistence failure. The static notice reaches native tool content and the next model request, preserves raw output, and produces no false receipt. See the capture reporting record.
  • The queued-input fix was verified at c38dc14e with two provider requests for each input, literal shell output, and real flow_status success. Steer retains its separate one-and-two request control. Native idle marks execution-drain settlement. The original two-idle checker remains failed and preserved; the corrected completion contract still rejects the baseline. See the native queue proof.
  • Replay matches all 13 gated cassettes. Dependency audit reports no vulnerabilities across 276 packages. Documentation stays within its existing byte budgets. Fresh hosted CI and Sentry review remain required. Paid qualification remains on hold.

The execution record retains earlier migration and artifact identities. The queue source review records the new ownership boundary. ADR 0018 defines native-only execution and retained compaction limits. Same-model auxiliary retry and native overlapping contexts remain unqualified.

A completed Responses stream can stop its HTTP reader before EOF. End that captured resource without revoking its admitted input.

Retain bounded native terminal facts in V2 evaluation traces and keep question escalation scoped to its invocation. Port direct transport fixtures to the pre-dispatch transcript read.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T18:40:45.840179Z 58ef483 PR opened
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58ef483fed

ℹ️ 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".

Keep stable callback owners and immutable replay identities while retiring their transcript payloads. Release attribution state on native session deletion without changing HTTP completion or stale-owner cleanup.
Comment thread src/platform/opencode/lifecycle.ts Resolved
Comment thread src/platform/opencode/lifecycle.ts Resolved
@vriesd
vriesd merged commit a40a5d5 into main Oct 25, 2026
8 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.

2 participants