You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee87e3b
Browse filesBrowse the repository at this point in the historyBrowse files
Andre Paat
committed
fix(tribunal-review): serialize OpenCode legs + run from non-repo cwd (v0.3.1)
Two distinct OpenCode deadlocks, both fixed in the tribunal-loop skill:
1. Concurrency deadlock (issue #31, upstream anomalyco/opencode#29395):
the two `opencode run` legs were launched as parallel Bash calls and
deadlocked on the shared ~/.local/share/opencode SQLite data dir, hanging
~20 min then failing. Fix: merge GLM + DeepSeek into ONE Bash call that runs
them back-to-back (Codex + Gemini stay parallel -> 3 parallel calls). The
call emits two JSON objects (GLM then DeepSeek). Deduped the two ~90-line
blocks into a shared review_opencode_leg() helper; added a real
`command -v opencode` guard.
2. git-cwd init deadlock (found this session): a SINGLE `opencode run` hangs at
init when its cwd is inside a git repo (internal deadlock - 2 threads parked,
no child process, log frozen at "loading internal plugin"; never reaches
model selection). Reproduced ~5x: hangs from any repo, works in ~2s from a
non-repo dir. Fix: after capturing the diff (which needs the repo), `cd
"$TMPDIR"` so opencode runs from a non-repo scratch dir. opencode needs no
repo context here -- the diff is embedded in the prompt and it runs --pure
with "do NOT use tools".
Verified end-to-end against real opencode: merged block run from a git repo
yields two valid GLM + DeepSeek reviews (~20s) instead of hanging. Also verified
serial execution (0 overlap), dual-JSON collection, and the empty-diff /
not-installed paths via a stubbed opencode. bash -n clean.
Closes#31
Copy file name to clipboardExpand all lines: plugins/tribunal-review/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# tribunal-review
2
2
3
-
Multi-provider code review plugin for Claude Code. Runs four reviewers in parallel — Codex (GPT-5.3), Gemini (3 Pro Preview), and two OpenCode Go models (GLM-5.1, DeepSeek-V4-Pro) — then uses Opus as the final arbiter to deduplicate findings, resolve conflicts, and issue a single authoritative verdict.
3
+
Multi-provider code review plugin for Claude Code. Runs four reviewers — Codex (GPT-5.3), Gemini (3 Pro Preview), and two OpenCode Go models (GLM-5.1, DeepSeek-V4-Pro) — then uses Opus as the final arbiter to deduplicate findings, resolve conflicts, and issue a single authoritative verdict.
4
4
5
5
## Prerequisites
6
6
@@ -27,7 +27,7 @@ On a feature branch with changes vs `origin/main`:
27
27
/tribunal-loop
28
28
```
29
29
30
-
The skill will verify you're on a feature branch, run all four reviews in parallel, and produce an arbitrated verdict.
30
+
The skill will verify you're on a feature branch, run the four reviews, and produce an arbitrated verdict.
31
31
32
32
When the verdict comes back `NEEDS_WORK` or `BLOCK`, the `closing-tribunal-loop` skill guides the iterative close-out: per-finding triage (fix-in-PR vs file-follow-up vs reject), committing fixes one finding at a time, and re-running the tribunal until the arbiter returns `APPROVE` with zero findings on the latest diff.
33
33
@@ -37,7 +37,7 @@ When the verdict comes back `NEEDS_WORK` or `BLOCK`, the `closing-tribunal-loop`
37
37
Verifies you're on a feature branch (not main) and that there are changes to review.
38
38
39
39
### Step 2: Parallel Review
40
-
Runs Codex, Gemini, GLM, and DeepSeek as four parallel Bash calls. Each analyzes the `git diff origin/main...HEAD` and returns structured JSON findings covering logic errors, security vulnerabilities, edge cases, performance issues, and architectural concerns. The two OpenCode reviewers run read-only (`opencode run --agent plan`).
40
+
Runs Codex, Gemini, and OpenCode as **three parallel Bash calls**. Each analyzes the `git diff origin/main...HEAD` and returns structured JSON findings covering logic errors, security vulnerabilities, edge cases, performance issues, and architectural concerns. The two OpenCode reviewers run read-only (`opencode run --agent plan`) and **sequentially within the single OpenCode call** — running them concurrently deadlocks on OpenCode's shared data dir (issue #31), so they are serialized (~8-15s each, back-to-back).
41
41
42
42
### Step 3: Inline Arbitration (Opus)
43
43
Opus deduplicates findings, resolves severity conflicts (always using the highest severity), marks any issue flagged by ≥2 reviewers as CONSENSUS, evaluates each finding for validity, and issues a final verdict: **APPROVE**, **NEEDS_WORK**, or **BLOCK**.
Run all four scripts below as **four parallel Bash tool calls**. No Task agents -- execute directly.
36
+
Run the three scripts below as **three parallel Bash tool calls**. No Task agents -- execute directly. The OpenCode call (Bash call 3) runs its two legs — GLM then DeepSeek — **sequentially within that one call**, because concurrent `opencode run` instances deadlock on the shared `~/.local/share/opencode` data dir (issue #31). It still yields four reviews total.
If `opencode` is not installed, the call emits one error object per leg and exits 0:
423
366
```json
367
+
{"error": "OpenCode CLI not found. Install from: https://opencode.ai", "provider": "glm"}
424
368
{"error": "OpenCode CLI not found. Install from: https://opencode.ai", "provider": "deepseek"}
425
369
```
426
370
427
-
Collect all four JSON outputs. Parse them. If any returned an error JSON, note it for arbitration.
371
+
Collect all four JSON outputs — Codex and Gemini from their calls, GLM and DeepSeek from the single OpenCode call (which prints two JSON objects, GLM first). Parse them. If any returned an error JSON, note it for arbitration.
0 commit comments