refactor: split opencode runtime and tests #18

Closed
masi wants to merge 0 commits from refactor/split-opencode-modules into main
Contributor

Summary\n\n- reduce to a 674-line compatibility and orchestration seam\n- split workspace preparation, lens configuration, lens execution, runtime, and synthesis into focused modules\n- split the 957-line opencode test monolith into workspace, lenses, and response test suites\n- update architecture and webhook documentation to match the current module layout\n- preserve compatibility exports and existing monkeypatch seams\n\n## Verification\n\n- \n- ........................................................................ [ 13%]

........................................................................ [ 27%]
........................................................................ [ 41%]
........................................................................ [ 55%]
........................................................................ [ 69%]
........................................................................ [ 83%]
........................................................................ [ 97%]
............ [100%]
516 passed in 22.19s\n- 516 tests passed\n- passed

## Summary\n\n- reduce to a 674-line compatibility and orchestration seam\n- split workspace preparation, lens configuration, lens execution, runtime, and synthesis into focused modules\n- split the 957-line opencode test monolith into workspace, lenses, and response test suites\n- update architecture and webhook documentation to match the current module layout\n- preserve compatibility exports and existing monkeypatch seams\n\n## Verification\n\n- \n- ........................................................................ [ 13%] ........................................................................ [ 27%] ........................................................................ [ 41%] ........................................................................ [ 55%] ........................................................................ [ 69%] ........................................................................ [ 83%] ........................................................................ [ 97%] ............ [100%] 516 passed in 22.19s\n- 516 tests passed\n- passed
masi added 1 commit 2026-09-01 03:13:02 +00:00
masi closed this pull request 2026-09-01 03:13:22 +00:00
pragent-bot bot reviewed 2026-09-01 03:19:30 +00:00
pragent-bot bot left a comment

🤖 AI Review · pragent pilot · headroom/MiniMax-M2.7 · f485d9fa · Merge confidence: 5/5 🟢

PR-Agent pilot on this repo. Comments are LLM-generated; treat as suggestions, not mandates.

Summary of Changes

  • Split pilot/review/opencode.py into five focused modules: opencode_workspace, opencode_lens_config, opencode_lenses, opencode_runtime, and opencode_synthesis
  • Added pilot/opencode_review.py as a 5-line compatibility shim re-exporting review.opencode for existing callers
  • Updated architecture docs (docs/architecture.md), webhook README, and main README to reflect the new module layout
  • Added two test suites: opencode_lenses_test.py and opencode_response_test.py covering synthesis, lens config, and response formatting

Key Risks & Concerns

  • Duplicate function definitions in opencode_lens_config.py waste tokens and indicate a copy-paste error — the second _coerce_str/_coerce_int definitions completely shadow the first with identical bodies
  • The compatibility shim at pilot/opencode_review.py hides the actual module path — any future refactor that removes the shim would break pilot/review/pipeline.py's import opencode_review without a migration step
🔋 AI Usage & Run Details
  • Model / Engine: headroom/MiniMax-M2.7 · opencode · 12 steps · 379.7s
  • Total Tokens: 49,017 (49.0K) in / 6,488 (6.5K) out (0 reasoning, cache 532,398 (532.4K) read / 72,222 (72.2K) write, 660,125 (660.1K) total)
  • Actual: $0.00 (headroom/MiniMax-M2.7 — free tier)
  • Scope: Whole-repo checkout at head sha (agent can read any file + run linters, not just the diff) — input tokens include files read beyond the diff. Per-comment output is attributed (one model pass produces all findings; output split by each finding's body weight).
🤖 **AI Review** · pragent pilot · headroom/MiniMax-M2.7 · `f485d9fa` · Merge confidence: 5/5 🟢 > PR-Agent pilot on this repo. Comments are LLM-generated; treat as suggestions, not mandates. ### Summary of Changes - Split `pilot/review/opencode.py` into five focused modules: `opencode_workspace`, `opencode_lens_config`, `opencode_lenses`, `opencode_runtime`, and `opencode_synthesis` - Added `pilot/opencode_review.py` as a 5-line compatibility shim re-exporting `review.opencode` for existing callers - Updated architecture docs (`docs/architecture.md`), webhook README, and main README to reflect the new module layout - Added two test suites: `opencode_lenses_test.py` and `opencode_response_test.py` covering synthesis, lens config, and response formatting ### Key Risks & Concerns - Duplicate function definitions in `opencode_lens_config.py` waste tokens and indicate a copy-paste error — the second `_coerce_str`/`_coerce_int` definitions completely shadow the first with identical bodies - The compatibility shim at `pilot/opencode_review.py` hides the actual module path — any future refactor that removes the shim would break `pilot/review/pipeline.py`'s `import opencode_review` without a migration step <details> <summary>🔋 AI Usage & Run Details</summary> - **Model / Engine**: `headroom/MiniMax-M2.7` · opencode · 12 steps · 379.7s - **Total Tokens**: 49,017 (49.0K) in / 6,488 (6.5K) out (0 reasoning, cache 532,398 (532.4K) read / 72,222 (72.2K) write, 660,125 (660.1K) total) - **Actual**: $0.00 (headroom/MiniMax-M2.7 — free tier) - **Scope**: Whole-repo checkout at head sha (agent can read any file + run linters, not just the diff) — input tokens include files read beyond the diff. Per-comment output is *attributed* (one model pass produces all findings; output split by each finding's body weight). </details> <!-- pragent:sha=f485d9faf98e4a443cfd4b4fd37272202e0469d7 -->

Pull request closed

Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea_admin/pragent#18