fix: patch xml2js CVE, integrate hush gateway into OpenCode review workflow#33
Closed
byapparov wants to merge 10 commits into
Closed
fix: patch xml2js CVE, integrate hush gateway into OpenCode review workflow#33byapparov wants to merge 10 commits into
byapparov wants to merge 10 commits into
Conversation
…hush - Add npm override for xml2js ^0.6.2 (fixes Dependabot alert #1, prototype pollution in transitive dep blessed-contrib → map-canvas → xml2js) - Integrate hush@0.1.7 into the OpenCode AI review workflow: install and start the hush gateway on :4000, copy the hush plugin, configure opencode.json to route API calls through the proxy. Defense-in-depth: plugin blocks sensitive file reads, proxy redacts PII from normal file content before it reaches the model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Running bare `hush` in the repo checkout resolves to the local package.json bin entry (dist/cli.js) which doesn't exist in CI since this workflow doesn't build. Use $(npm prefix -g)/bin/hush to reliably invoke the globally-installed binary. Also adds a health-check with ::error:: annotation so the job fails fast with a clear message if the gateway doesn't start. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ns them Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
OpenCode's built-in providers ignore options.baseURL from opencode.json (anomalyco/opencode#5674). Define a custom "hush-zhipu" provider with npm adapter @ai-sdk/openai-compatible so the baseURL is actually respected and all LLM traffic routes through the hush gateway. Verified locally: hush logs show requests at /api/coding/paas/v4/chat/completions with tokenCount > 0 (PII redaction active). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GLM-5 takes 3-8 minutes per inference, making it impossible to complete a multi-file code review within the 15-minute timeout. GLM-4.7-flash responds in seconds and is sufficient for code review quality. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OpenCode wasted 12 minutes trying to discover the PR number via `gh pr view` (fails in detached HEAD) and `gh pr list --branch` (flag not available in CI's gh version). Pass $PR_NUMBER directly in the prompt so it can post the comment immediately. Also bump the proxy fetch timeout from 30s to 120s — LLM first-token latency can exceed 30s for large prompts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review: PR #33✅ ApprovedThe changes are well-structured and address the xml2js CVE while properly integrating the Hush gateway into the OpenCode review workflow. 1. Redaction Logic (
|
Contributor
Author
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
blessed-contrib→map-canvas→xml2js):4000opencode.jsonto route API calls through the proxyChanged files
package.json/package-lock.json— npm override forxml2js ^0.6.2.github/workflows/opencode-review.yml— hush integration, build step, prompt + timeout tweaksTest plan
npm auditno longer flags xml2js prototype pollution🤖 Generated with Claude Code