fix: route OpenCode reviews through hush proxy using built-in provider#34
Conversation
The previous workflow sent reviews directly to ZhipuAI without PII protection. This restores hush proxy routing using a simple baseURL override on the built-in zai-coding-plan provider — no custom provider definition needed. Verified locally that OpenCode v1.2.15 correctly propagates options.baseURL on built-in providers through all merge phases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Redirect hush process output to a log file and add a verification step that checks for "Starting stream proxy" in the logs — proving traffic actually went through hush rather than directly to the upstream API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `always()` condition so the "Verify Hush Proxy Was Used" step runs regardless of whether the review step succeeded or timed out. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR #34 Review: Route OpenCode reviews through hush proxyScope: This PR modifies only ✅ What works wellWorkflow design: Clean setup with health check loop, explicit PR number in prompt, and Proxy integration: Using 🔍 Findings on underlying code (src/)Redaction Logic (
Streaming (
Security:
Reliability:
|
…-sent Two bugs found in CI hush proxy logs: 1. ERR_HTTP_HEADERS_SENT: When a streaming response fails mid-stream, the catch block tried to send a 502 JSON error after SSE headers were already written. Now checks res.headersSent first. 2. TimeoutError after 30s: LLM code review calls can take well over 30s. Bump AbortSignal.timeout from 30s to 120s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review: PR #34OverviewThis PR restores hush gateway proxy routing for OpenCode AI reviews and improves error handling for long-running streaming responses. 1. Redaction Logic ✓Strengths:
Minor concern: IPv4 pattern 2. Streaming Integrity ✓Strengths:
3. Security ✓Strengths:
No PII leak vectors identified. 4. Reliability ✓Changes reviewed:
if (!res.headersSent) {
res.status(502).json({ error: 'Gateway forwarding failed' });
} else {
res.end(); // Headers already sent — just end the response
}This prevents the "Can't set headers after they are sent" error during streaming failures. Workflow ChangesThe CI workflow correctly:
SummaryApproval: ✅ The changes are well-designed and address the streaming edge cases properly. Recommendations (optional, non-blocking):
Reviewed SHA: 3ea8a7e |
Summary
options.baseURLoverride on the built-inzai-coding-planprovider instead of defining a customhush-zhipuproviderWhat changed
The workflow now:
:4000{"provider":{"zai-coding-plan":{"options":{"baseURL":"http://127.0.0.1:4000/api/coding/paas/v4"}}}}zai-coding-plan/glm-5— traffic goes through hush for PII interceptionVerification
Tested locally with both a debug build from OpenCode source and the installed v1.2.15 binary. Confirmed that
options.baseURLon a built-in provider is correctly propagated through all merge phases and hush proxy receives traffic at/api/coding/paas/v4/chat/completions.Test plan