feat: route OpenCode reviews through contextual gateway - #1170
feat: route OpenCode reviews through contextual gateway#1170seonghobae wants to merge 26 commits into
Conversation
|
Warning Review limit reachedNext included review available in 53 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughOpenCode 리뷰 워크플로우에 핀된 ChangesContextual Orchestrator 게이트웨이
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟡 Moderate · up to The workflow routes public-repository reviews through a pinned external gateway while preserving direct fallbacks and isolating credentials; however, merge readiness is moderate because the dependency is not yet on protected main, the activation contract does not fully pin authenticated non-empty model readiness, and the current license check can accept non-MIT text, creating avoidable supply-chain and compliance risk. Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant contextual_orchestrator
participant ModelPool
participant OpenCode
GitHubActions->>contextual_orchestrator: 핀된 코드로 격리된 loopback 게이트웨이 기동
GitHubActions->>contextual_orchestrator: 인증된 /healthz와 /models 확인
contextual_orchestrator-->>GitHubActions: 준비 상태와 모델 목록 반환
GitHubActions->>ModelPool: 게이트웨이 활성화 상태와 환경 변수 전달
ModelPool->>OpenCode: contextual-orchestrator 모델 후보 전달
OpenCode->>contextual_orchestrator: 리뷰 모델 요청 전송
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 79.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 7 files. (3 skipped: 3 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
Current-head verification for 0bd7630:\n\n- Gateway contract tests plus OpenCode model-pool/workflow-shell tests: 75 passed.\n- Added module/nested docstrings and verified changed Python contract coverage: 100%.\n- Ruff, Python compilation, bash -n, actionlint .github/workflows/opencode-review-dispatch.yml, and git diff --check: passed locally.\n- The loopback-only sidecar, pinned contextual-orchestrator revision, five provider-key wiring, no COPILOT token, and provider-qualified fallback contract remain intact.\n\nThe PR remains blocked until an independent current-head approval and terminal required Checks are present. No bypass or self-approval used. |
|
Exact-head root-cause fix pushed at Local evidence on the exact fix: full suite |
|
Exact-head causal repair published at
The two current Devin findings are addressed by source and regression coverage. Exact-head hosted Checks and an independent formal review remain authoritative; no predecessor evidence transfers. |
|
Current-head validation for The pinned contextual-orchestrator gateway integration was reviewed against the exact source contract. The pinned revision exposes Exact-head local evidence:
The scheduler |
|
@opencode-agent Review only current head d45d5c5, including the gateway security boundary and exact current Checks. |
|
Current-head repair evidence for
|
|
Current-head validation for :\n\n- |
|
Correction: validation for exact HEAD 595899d
The latest remote-agent commit and its pinned contextual-orchestrator gateway/fallback contract were reviewed. No merge is requested: the PR remains BLOCKED, has no independent approval, and required Checks are still queued. |
|
@opencode-agent Please review the current HEAD 595899d. Re-evaluate the complete PR against the repository rules and report only findings for this exact HEAD. |
|
Current HEAD 595899d was reviewed with CodeGraph across the workflow sidecar, pinned contextual-orchestrator gateway, and model-pool fallback path. No source defect was found: the gateway is pinned, loopback-only, bearer-authenticated, auto-discovers the five permitted provider credential classes, and is skipped safely when unavailable; the existing provider pool remains the fallback. Verification passed: 42 targeted Python tests, shell syntax, Python compileall, and git diff --check. actionlint was attempted but the large workflow process did not complete locally; hosted actionlint/Checks remain authoritative. |
|
@opencode-agent review |
|
Exact current HEAD |
Exact-head maintainer review disposition
|
Exact-head restack audit\n\n- Repository: ContextualWisdomLab/.github\n- Pull request: #1170\n- Exact head SHA:
|
Dependency restack update\n\nThe gateway predecessor ContextualWisdomLab/contextual-orchestrator#790 was normally restacked to exact head
|
…20260825 # Conflicts: # .github/workflows/opencode-review-dispatch.yml # tests/test_pr_review_autofix_nvidia_nim_contract.py
Exact-head maintenance audit
The normal OpenCode review and scheduler dispatches were requested for this exact head. Auto-merge remains protected by the repository ruleset. |
Exact-head maintenance attestation
|
Exact-head maintenance update
|
| export CONTEXTUAL_ORCHESTRATOR_ENABLED=false | ||
| CONTEXTUAL_ORCHESTRATOR_TOKEN="" | ||
| export CONTEXTUAL_ORCHESTRATOR_TOKEN |
There was a problem hiding this comment.
📝 Info: Gateway provider stays enabled with empty apiKey when sidecar unavailable
When the sidecar is unavailable the token is cleared to empty and the candidate is skipped by the runner, yet the generated config still lists contextual-orchestrator in enabled_providers with an apiKey that resolves to empty. This depends on OpenCode tolerating an enabled openai-compatible provider whose apiKey is empty at init. Tolerance is pre-established since the static opencode.jsonc has always enabled this provider with unresolved env, but if OpenCode ever fails init on an empty apiKey the entire pool breaks for all candidates.
Was this helpful? React with 👍 or 👎 to provide feedback.
| -H "Authorization: Bearer ${CONTEXTUAL_ORCHESTRATOR_TOKEN}" \ | ||
| -o "$models_file" \ | ||
| "${CONTEXTUAL_ORCHESTRATOR_BASE_URL}/models" && | ||
| python3 -c 'import json,sys; payload=json.load(open(sys.argv[1], encoding="utf-8")); models=payload.get("data") if isinstance(payload, dict) else None; raise SystemExit(0 if isinstance(models, list) and any(isinstance(model, dict) and str(model.get("id") or "").strip() for model in models) else 1)' "$models_file" |
There was a problem hiding this comment.
📝 Info: Readiness check prints tracebacks on malformed model responses
The readiness loop's inline python3 -c calls json.load without catching JSONDecodeError. A partial or non-JSON /models body raises an uncaught exception, correctly treated as not-ready and retried, but emits a Python traceback into the step log. Cosmetic only, no functional impact.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary\n- route public-repository OpenCode review through a loopback contextual-orchestrator gateway before the existing provider fallbacks\n- pin the gateway to protected contextual-orchestrator main commit \n- bootstrap runtime-only provider credentials into gateway discovery without exposing \n- preserve private-repository exclusion, source-license verification, bounded startup, session and cost lineage, and fail-closed schema handling\n\n## Dependency\n- ContextualWisdomLab/contextual-orchestrator#790 merged normally as .\n- The pinned protected-main tree contains ; generic local servers are not substitutes.\n\n## Verification\n- ........................................................................ [ 40%]
........................................................................ [ 81%]
................................ [100%]
176 passed in 58.15s — 176 passed\n- \n- \n- \n\nProtected-main merge still requires current-head terminal Checks and independent approval.