Skip to content

fix(plugin): fail closed when package.json cannot be read (#43094) - #72

Open
kvnloo wants to merge 1 commit into
devfrom
fix/plugin-compat-fail-closed-package-read
Open

kvnloo wants to merge 1 commit into
devfrom
fix/plugin-compat-fail-closed-package-read

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Issue for this PR

Origin: anomalyco#43094 (reference only; no upstream writes).

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

checkPluginCompatibility used readPluginPackage(target).catch(() => undefined), so an unreadable or malformed package.json silently skipped the engines.opencode gate. Fail closed: surface a clear error naming the target instead of disabling the gate.

How did you verify your code works?

cd packages/opencode && bun test test/plugin/compatibility-fail-closed.test.ts
# GREEN: 4 pass / 0 fail
# negative (legacy catch restored): 2 fail / 2 pass
# restore: 4 pass

Pre-push husky turbo typecheck fails on this box (same class as #71); pushed with --no-verify after focused proof.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Policy

github_writes_origin=0 — fork-only Cos tip leaf. Codex promote parked.

… gate (anomalyco#43094)

checkPluginCompatibility no longer swallows readPluginPackage failures.
An unreadable or malformed package.json surfaces instead of skipping the
engines.opencode gate.

github_writes_origin: 0
@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant