Repository navigation
deps: bump @opencode/codemode to 2.2.6 - #6
Merged
Merged
Conversation
Match the published exact Effect 4.1.0 dependency so the extension and CodeMode share one Effect instance. Reject require before runtime construction: 2.2.6 binds it and can load url, util, and crypto. Dynamic import stays outside the syntax allowlist. The default engine stays the legacy interpreter. Co-authored-by: hyein.sophia.cho <hyein.sophia.cho@gmail.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Avoid the removed pi-ai Type re-export while retaining compatibility with older Pi SDKs. Validation: Node 22.23.1, CodeMode 2.2.6 / Effect 4.1.0, Pi/TUI 1.5.0; full staged-tree suite passed 94 tests with no skips.
Build highlighted source lazily and reuse stable output children across updates. Invalidate embedded styles with the component, preserve width-aware wrapping, and use bounded raw previews for streaming or oversized source without changing execution input. Add deterministic work-count, theme, Unicode, expansion, output replacement and row-isolation regressions. Validation: full staged-tree suite passed 104 tests with no skips on Node 22.23.1 / Pi 1.5.0, CodeMode 2.2.6 and Effect 4.1.0.
Batch presentation notifications at 16ms without delaying host dispatch or record mutations. Flush synchronously on every exit and close timers before returning the root result. Cover detached snapshots, observer failures, concurrent logs, cancellation cleanup and no late callbacks; distinguish frame-spanning live states from fast-call final records in SDK tests. Validation: full staged-tree suite passed 109 tests with no skips on Node 22.23.1 / Pi 1.5.0, CodeMode 2.2.6 and Effect 4.1.0.
Share the CodeMode/Effect module-load promise only; retain fresh runtimes, tools, contexts, signals and call logs. Allow a caller to abort its wait without poisoning other roots or dispatching late host work. Add fresh-process dependency guards, actual Pi file/jiti loading, concurrent cold-call isolation, and loading cancellation/late-rejection regressions. Validation: full staged-tree suite passed 115 tests with no skips on Node 22.23.1 / Pi 1.5.0, CodeMode 2.2.6 and Effect 4.1.0.
Bump manifest and root lockfile versions to 0.2.0 without changing the CodeMode 2.2.6 / Effect 4.1.0 / Acorn 8.15.0 pins. Check release metadata consistency in the package regression. Document safety boundaries, cache/coalescing/streaming/loading behavior, scoped measurements, upgrade instructions and pending release checks. Distinguish the prepared source from published installation commands. Validation: full staged-tree suite passed 115 tests with no skips on Node 22.23.1 / Pi 1.5.0; Python CI regressions passed 13 tests; dry-run package is pi-opencode-mode-0.2.0.tgz with 11 files. No tag or publication performed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump the exact
@opencode/codemodepin from 2.2.6's predecessor 2.2.5 to 2.2.6, and move Effect from 4.0.6 to the published exact dependency 4.1.0. Acorn stays 8.15.0. The default engine remains the legacy interpreter;engine: "vm"is not enabled.requireis now a CodeMode builtin that can loadurl,util, andcrypto. Preflight rejects that name before runtime construction or host effects, including after a would-be host call and when the name is shadowed. Dynamicimport()stays outside the syntax allowlist.for...inbehavior is unchanged and stays rejected.0c144cf232f1850f602423cf2b740eff0b9bdb02101f98cc3c7dc7f22a3c5054fdec355655f569c2Artifacts
Registry
https://registry.npmjs.org/.npm view @opencode/codemode dist-tags.latest --json --prefer-onlinereturned"2.2.6"during the 2026-11-07T15:01Z run (exact stable semver; semver 7.7.4compare("2.2.6", "2.2.5") === 1). Published 2026-11-06T23:33:15.623Z. The published package has nogitHead,engines, or peer dependencies. Repository:git+https://github.com/anomalyco/opencode.git(packages/codemode).@opencode/codemode(old)sha512-oqZXynEO71nOpM9kOVacyRY6qOceYdk2p9Q0667kwSP4ZXgKSKtxV2HkI0iUBh3ci+TueO88BxIb2CgL1slpGw==@opencode/codemode(new)sha512-pOV+PwhZbcVySVgKY29LThmdhVSkx/HC3/A+a9KbrhZx/sgxQTXMXthu6P/hWCcER5hGKiGU6g8P7m6bV/kKMg==effectsha512-lGx2MJJyrXA8RZb2UpQ/0Nkb5Utaimby7oD92+18noBxLPE85IFOvptdzau8dvcxAOwfwHo9iqapbKeFzqQM/Q==Both CodeMode tarballs were integrity-checked and extracted with path-escape rejection. Lockfile diff is only those version and integrity lines. One Effect module is loaded by the extension and by CodeMode (
node_modules/effect).The published package diff is the comparison baseline. The monorepo compare is hundreds of commits and is supporting context only.
Effect
2.2.6 depends on
effectexactly4.1.0(2.2.5 depended on exact4.0.6). The extension pin moves to that exact version so both sides share one Effect runtime. It is not widened, and it is not a speculative upgrade past the published dependency. Acorn stays the shared exact8.15.0.Change-to-test map
package.jsondependencies). The bridge usesEffect.tryPromise,ensuring,promise, andrunPromiseon the same instance CodeMode runs. Existing cancellation, deadline, and host-cleanup tests cover that, plus a resolved-module check that the extension and CodeMode load the sameeffectpath. No second copy in the lockfile.CodeMode.makewithoutenginestill returns only catalog +execute. Newprogram/resume/ snapshot APIs exist only forengine: "vm". The extension does not passengine. Assertion: default runtime has noprogramorresume. VM implementation is out of scope and not enabled.requireglobal and module loader (dist/interpreter/globals.js,modules.js, import evaluation).require("url")returns{URL, URLSearchParams},require("util")returnsTextEncoder/TextDecoder, andtypeof require("crypto")is"object". Documented contract already excludesrequire.requirewas not inNATIVE_NAMES, so it was admitted and executed. Fix: addrequiretoNATIVE_NAMES. Assertions rejectrequire("url"),require("crypto"),typeof require, a shadowedrequire, andrequireafterawait tools.write({})before runtime construction, with empty tool-call lists. A property namedrequirestill executes and returns1. Direct runtime calls on the installed 2.2.6 artifact show why the rejection is required.import()now executes if it reaches the interpreter (typeof import("url") === "object"). It was alreadyunsupported-syntax:ImportExpression. The no-host-effects path now also coversimport()after a would-be host call. Staticimportremains a script-mode syntax error. The allowlist is not expanded.for...inunchanged on 2.2.6 (inherited keys visited; keys deleted during iteration still visited). Existing preflight and no-host-effects tests still apply. No new for-in test.Extension.makeobject globals, extra index exports (fromBytes,toBytes,toolExpression, snapshot/suspend types), and export parse-message wording. This extension does not use those APIs. Tool schemas,Tool.make,toolError, limits, and the tool bridge source are unchanged.Fail-before on 2.2.6 without the
NATIVE_NAMESchange:node --test test/preflight.test.js test/route.test.jshad 26 tests, 24 pass, 2 fail (return require("url")stayed supported, and routing selectedcodemode_o). After the change: 26 pass, 0 fail, exit 0.Verification
Local scope only. Linux 6.12.113+ x64. CodeMode 2.2.6, Effect 4.1.0, one shared Effect instance, Acorn 8.15.0.
PI_OPENCODE_UPSTREAM_VERSIONandPI_OPENCODE_TEST_VERSIONwere unset.PI_OPENCODE_SDKwas set only to the isolated install under test. Scripted assistant stream; no live model API.npm ci --ignore-scriptsin a fresh copynpm test(noPI_OPENCODE_SDK), Node v22.23.4PI_OPENCODE_SDK=$PWD/node_modules/@earendil-works/pi-coding-agent npm test, Node v22.23.4npm run test:pi-versions, Node v22.23.4npm testfor Pi/TUI 0.99.0, 1.3.0, 1.4.0 on Node v22.19.0, v22.23.4, and v24.22.2npm pack --dry-run --jsonpi-opencode-mode-0.1.5.tgz, 11 files (runtime sources plus LICENSE, README, SECURITY, TESTING, CHANGELOG). No lockfile,node_modules, or secretsgit diff --checkParent matrix counts are the 3 Pi cells. Inner-suite counts are the 94-test
npm testruns. The literal deadline probe still runs (about 30s) inside each SDK suite.Verified for that local Node/OS/Pi/TUI scope. Pending: hosted Modal CI (Node 22.19.0 and 24.x × Pi 0.99.0, 1.3.0, 1.4.0) has not run on this revision. macOS was not exercised. No live-provider run and no new benchmark.
Docs
README compatibility text, the Unreleased changelog entry, and the current TESTING baseline now name CodeMode 2.2.6 and Effect 4.1.0. Historical changelog entries and dated verification sections are unchanged.
Note
Medium Risk
Combines a dependency upgrade with lazy backend loading and stricter preflight around
require, plus coalesced UI updates that change visible cadence without altering execution contracts.Overview
Prepares 0.2.0 (unreleased on npm): bumps pins to
@opencode/codemode2.2.6 and Effect 4.1.0, and expands changelog, README, testing notes, and the maintainer release checklist for the new version and behavior.Execution and safety: Preflight now rejects
require(including shadowed names and uses after a would-be host call) because 2.2.6 exposes a realrequire; dynamicimport()stays disallowed. CodeMode and Effect load only after preflight passes, via a shared module promise—rejected programs and registration no longer pull in the backend. Concurrent runs share that import only; each execution still gets its own runtime, signal, and call log, with abort during load isolated from other waiters.TUI / presentation: Nested-call
onUpdatenotifications are coalesced on a 16ms timer (host dispatch stays immediate;close()flushes before the final result). The renderer caches highlighted source and output per tool row, defers expensive highlighting until paint, invalidates on theme/proxy changes, shows raw previews while args stream, and caps collapsed source at 8,192 UTF-8 bytes without changing executed source.New regression suites cover lazy loading, renderer caching/coalescing, and
requirepreflight; the default test script gainsrenderer-performance.test.jsandlazy-loading.test.js.Reviewed by Cursor Bugbot for commit 92d6bcc. Configure here.