Skip to content

chore: add biome.json lint config (WOP-1070)#18

Merged
TSavo merged 6 commits intomainfrom
feature/wop-1070-chore-add-reference-biomejson-to-all-channel-and-provider
Feb 28, 2026
Merged

chore: add biome.json lint config (WOP-1070)#18
TSavo merged 6 commits intomainfrom
feature/wop-1070-chore-add-reference-biomejson-to-all-channel-and-provider

Conversation

@TSavo
Copy link
Contributor

@TSavo TSavo commented Feb 28, 2026

Summary

Closes WOP-1070

  • Adds/aligns canonical biome.json (from wopr-plugin-discord reference) for provider plugins
  • Runs biome check --fix to auto-fix existing violations
  • All repos pass biome check with zero errors (warnings only for noExplicitAny/noNonNullAssertion)

Test plan

  • npm run check passes in each repo
  • biome check src/ shows zero errors

Generated with Claude Code

Note

Route model selection to dynamic provider IDs in OpencodeClient.query and add Biome lint config for WOP-1070

Switch OpencodeClient.query to resolve providerID from modelID prefixes and update validateCredentials to return true on errors; add biome.json and reformat code.

📍Where to Start

Start with resolveProviderID usage inside OpencodeClient.query in src/index.ts.

Macroscope summarized e1c1691.

@linear
Copy link

linear bot commented Feb 28, 2026

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

Warning

Rate limit exceeded

@TSavo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a7108bb and e1c1691.

📒 Files selected for processing (4)
  • biome.json
  • src/index.ts
  • src/opencode-sdk.d.ts
  • src/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/wop-1070-chore-add-reference-biomejson-to-all-channel-and-provider

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Feb 28, 2026

Greptile Summary

Adds canonical biome.json lint/format configuration and applies auto-fixes to achieve zero linting errors.

Key changes:

  • New biome.json config matching WOPR plugin standards (required per manifest requirements)
  • Removed deprecated tier: "byok" field from capability definition (correct per WOP-752)
  • Switched from ctx.registerLLMProvider() to ctx.registerProvider() API
  • Formatting standardization (tabs → spaces, consistent indentation)
  • Catch block already correctly uses (_error: unknown)

Note: The API change from registerLLMProvider to registerProvider should be verified against the latest @wopr-network/plugin-types to ensure it aligns with the capability provider pattern documented in conventions.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk after verifying the API change
  • Score reflects good adherence to WOPR plugin standards (biome.json added, deprecated tier field removed, correct error handling). One point deducted for needing to verify the API migration from registerLLMProvider to registerProvider aligns with capability provider conventions.
  • Pay attention to src/index.ts lines 330-331 to verify the provider registration API change

Important Files Changed

Filename Overview
biome.json Added canonical biome.json lint/format config matching WOPR plugin standards
src/index.ts Formatting changes + switched from registerLLMProvider to registerProvider API + removed deprecated tier field

Last reviewed commit: 69b84a3

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

src/index.ts Outdated
try {
const opencode = await import("@opencode-ai/sdk");
OpencodeSDK = opencode;
} catch (_error) {
Copy link

Choose a reason for hiding this comment

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

catch block missing explicit type annotation - should be catch (_error: unknown) per WOPR plugin conventions

Suggested change
} catch (_error) {
} catch (_error: unknown) {

Context Used: Context from dashboard - WOPR Plugins: Architecture Contract (flag violations as blockers)

PLUGIN STRUCTURE:

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/index.ts
Line: 82

Comment:
catch block missing explicit type annotation - should be `catch (_error: unknown)` per WOPR plugin conventions

```suggestion
    } catch (_error: unknown) {
```

**Context Used:** Context from `dashboard` - WOPR Plugins: Architecture Contract (flag violations as blockers)

PLUGIN STRUCTURE:
- Each plugin i... ([source](https://app.greptile.com/review/custom-context?memory=de4b562c-87ef-41c0-9a4d-78b8b2bc8d5e))

How can I resolve this? If you propose a fix, please make it concise.

@claude claude bot removed the auto-fixing label Feb 28, 2026
@claude claude bot enabled auto-merge (squash) February 28, 2026 00:41
src/index.ts Outdated
Comment on lines 330 to 331
ctx.log.info("Registering OpenCode provider...");
ctx.registerLLMProvider(opencodeProvider);
Copy link

Choose a reason for hiding this comment

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

Verify that registerProvider/unregisterProvider is the correct API. Per capability provider conventions, the pattern should be ctx.registerCapabilityProvider("llm", opencodeProvider). Confirm this change aligns with latest @wopr-network/plugin-types.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/index.ts
Line: 330-331

Comment:
Verify that `registerProvider`/`unregisterProvider` is the correct API. Per capability provider conventions, the pattern should be `ctx.registerCapabilityProvider("llm", opencodeProvider)`. Confirm this change aligns with latest `@wopr-network/plugin-types`.

How can I resolve this? If you propose a fix, please make it concise.

@TSavo TSavo disabled auto-merge February 28, 2026 01:06
@TSavo TSavo enabled auto-merge (squash) February 28, 2026 01:19
WOPR and others added 6 commits February 27, 2026 18:21
Also fixes pre-existing TS errors: remove unknown `tier` field from
ManifestProviderEntry, use registerProvider/unregisterProvider API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d names

- Add `_error: unknown` type annotation to catch block in loadOpencodeSDK (Greptile convention flag)
- Add missing `tier: "byok"` to ManifestProviderEntry (required field per plugin-types)
- Rename registerProvider/unregisterProvider → registerLLMProvider/unregisterLLMProvider (correct WOPRPluginContext API)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…c (WOP-1070)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Provider (WOP-1070)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace generic registerProvider/unregisterProvider with the typed
registerLLMProvider/unregisterLLMProvider API from plugin-types 0.7.1.
Also add missing required `tier: "byok"` on manifest provider entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rovider (WOP-1070)

- Remove tier: "byok" (field removed from ManifestProviderEntry in plugin-types 0.7.x)
- Upgrade @wopr-network/plugin-types from ^0.2.1 to ^0.7.0
- Use registerProvider/unregisterProvider (registerLLMProvider does not exist in 0.7.x)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TSavo TSavo force-pushed the feature/wop-1070-chore-add-reference-biomejson-to-all-channel-and-provider branch from adedd2d to e1c1691 Compare February 28, 2026 02:22
@TSavo TSavo merged commit 3f9bb7b into main Feb 28, 2026
5 checks passed
return health.data?.healthy === true;
} catch (error: unknown) {
logger.error("[opencode] Credential validation failed:", error);
return true; // Allow anyway, server might not be running yet
Copy link

Choose a reason for hiding this comment

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

🟡 Medium src/index.ts:143

Returning true on validation failure masks missing SDK errors. When query() later calls getClient() outside its try/catch, an unhandled rejection occurs. Consider returning false to fail fast during validation.

Suggested change
return true; // Allow anyway, server might not be running yet
return false; // Allow anyway, server might not be running yet
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file src/index.ts around line 143:

Returning `true` on validation failure masks missing SDK errors. When `query()` later calls `getClient()` outside its try/catch, an unhandled rejection occurs. Consider returning `false` to fail fast during validation.

Evidence trail:
src/index.ts lines 77-87 (loadOpencodeSDK throws error when SDK missing), lines 133-145 (validateCredentials catches error and returns true at line 143), lines 169-178 (getClient calls loadOpencodeSDK), lines 180-183 (query calls getClient at line 181, try block starts at line 183)

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