Skip to content

chore: pin every third-party version a preset installs - #59

Merged
trick77 merged 1 commit into
masterfrom
chore/pin-preset-versions
Jul 29, 2026
Merged

chore: pin every third-party version a preset installs#59
trick77 merged 1 commit into
masterfrom
chore/pin-preset-versions

Conversation

@trick77

@trick77 trick77 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Why

opencode resolves a plugin spec once and caches it keyed on the full spec string, then never re-checks:

const directory = (pkg) => path.join(global.cache, "packages", sanitize(pkg))
if (yield* afs.existsSafe(path.join(dir, "node_modules", name)))
  return resolveEntryPoint(...)   // no install, no registry call, no version check

So an unpinned ref is not "tracks latest" — it freezes at whatever resolved on first run, differs per user depending on install date, and can't be named without grepping the cache. Changing the spec string is the only thing that triggers a re-fetch, which makes an explicit pin the only working update path.

@fetch behaved the same way: src/fetch-asset.ts returns a cached file untouched when no sha256= is declared.

Changes

Preset Before After
plugin-superpowers no git ref #v6.2.0
plugin-litellm-pricing @0.1.1 @0.2.0
mcp-playwright @latest @0.0.78
jdtls-lombok lombok.jar, no checksum lombok-1.18.46.jar + sha256=

Notes:

  • plugin-litellm-pricing was two releases behind. 0.1.2 fixed a 20-second startup stall; 0.2.0 stopped probing localhost. Commit 00df0c4 had already rewritten this preset's @description for post-0.2.0 behaviour while the pin still shipped 0.1.1.
  • mcp-playwright was the only genuinely floating one — npx re-resolves @latest on every MCP server start, so it pulled new unreviewed code into a browser-driving server continuously.
  • jdtls-lombok versions the dest filename as well as the URL. fetchAsset returns an existing dest untouched, so reusing lombok.jar would make a future bump a silent no-op. Hash cross-checked against Maven Central: byte-identical jar, matching published sha1, manifest reads Lombok-Version: 1.18.46.

Also: transitive fast-uri 3.1.0 → 3.1.4, clearing four high-severity advisories (path traversal, host confusion ×3); AGENTS.md gains the pinning rule that would have caught this, and its stale "one runtime dep" line is corrected.

Verification

  • 101/101 tests pass
  • All four install into a temp config with pinned specs; -javaagent path tracks the versioned dest; validate passes
  • Re-install is a no-op — preserve 1, no backup written
  • remove prunes back to bare $schema
  • Appending garbage to the cached jar and re-installing forces a re-download and restores the correct hash, so sha256= is actually enforced rather than merely declared

Out of scope: migrating users who already installed these presets. This changes what new installs resolve to.

opencode resolves a plugin spec once and caches it keyed on the full spec
string, then never re-checks. An unpinned ref therefore is not "tracks
latest" — it freezes at whatever resolved on first run, differs per user,
and cannot be named. Changing the spec string is the only thing that
triggers a re-fetch, which makes an explicit pin the only working update
path.

- plugin-superpowers: pin the git spec to #v6.2.0
- plugin-litellm-pricing: 0.1.1 -> 0.2.0, picking up the startup-stall
  and localhost-probe fixes the shipped @description already described
- mcp-playwright: @latest -> 0.0.78. npx re-resolves on every server
  start, so this one really did pull new upstream code continuously
- jdtls-lombok: pin lombok 1.18.46 and verify it by sha256. The dest
  filename is versioned too: fetchAsset returns an existing dest
  untouched, so reusing the name would make a future bump a silent no-op

Hash cross-checked against Maven Central (byte-identical jar, matching
published sha1).

Also bumps the transitive fast-uri to 3.1.4, clearing four high-severity
advisories, and records the pinning rule in AGENTS.md so this is caught
next time.
@trick77
trick77 merged commit bd5312e into master Jul 29, 2026
3 checks passed
@trick77
trick77 deleted the chore/pin-preset-versions branch July 29, 2026 08:07
@trick77 trick77 mentioned this pull request Jul 29, 2026
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.

1 participant