Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
5.2 KiB
5.2 KiB
Issue #60 Code Review Report — Round 3 (0e05b1b)
- Job ID:
5420eae1 - Reviewer:
agy(herdr:reviewer-agy-01) - Branch:
fix/issue-60-opencode-v2 - Base .. Head:
74333f87d0c02888c2b5b281e912d97e74348c01..0e05b1b6777ceb837066454ac688e04a0f5d14a0(5 commits; Round 3 delta:0e05b1b) - Verification Worktree:
/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261018T073639Z-b5cb7f/1
1. Executive Summary
Commit 0e05b1b cleanly resolves all blocking and non-blocking findings raised in Round 2 (cb5f439) without introducing regressions:
- Test isolation & Issue #55 path-variable guard (
tests/_agent_home_guard.py):XDG_DATA_HOMEis added toDROPPED_VARS, soconftest._isolate_agent_homesdrops any ambientXDG_DATA_HOMEfor every test (preventing a sandbox that overridesHOMEfrom resolving the runner's ambientXDG_DATA_HOMEvia_data_home(ctx)).watch_dirs(ambient)now watchesos.path.join(ambient.get("XDG_DATA_HOME") or os.path.join(home, ".local", "share"), "opencode")so the session leak guard monitors the real opencode data directory even whenXDG_DATA_HOMEis set in the ambient environment.tests/test_issue55_agent_homes.py::test_l1_every_path_variable_the_code_reads_is_accounted_forpasses.
status.shDB path resolution (.agents/skills/multi-agent-mux-status/scripts/status.sh:108-111, 308-311):- Both
--jsonand text modes now resolve the opencode DB path viaget_adapter('opencode')._resolve_db(DiscoveryContext(workspace=cwd, agent_name='opencode', home_dir=home))instead of a hardcoded~/.local/share/opencodelookup, keepingstatus.shconsistent withreconcile.shand the adapter'sdebug paths/XDG_DATA_HOMEresolution.
- Both
- Real binary
--versionprobe isolation (tests/test_issue60_opencode_v2.py:294-301):_real_opencode()now runsopencode --versioninside atempfile.TemporaryDirectory()withHOMEandTMPDIRpointed at that temp dir andXDG_*omitted fromenv, preventing import-time log writes to the user's real~/.local/share/opencode/log.
2. Verification of Cumulative Changes (74333f8..0e05b1b)
| Area | Verification Result |
|---|---|
Adapter CLI & Schema (opencode.py) |
spawn_spec / resume_spec use --auto --standalone (and --session <id> when materialized); _resolve_db parses opencode debug paths with fallback to <_data_home>/opencode/opencode.db; discover (WHERE parent_id IS NULL) and verify_artifact query session_v2. |
Purge & Residual (opencode.py) |
Collects _descendants(db, uuid) from session_v2 and legacy session before invoking opencode session delete --standalone -- <uuid>, deletes _LEGACY_TABLES rows for [uuid] + descendants, and reports remaining session_v2 / legacy rows (tagging child sessions with [child session <id>]). |
In-Use & Stall Watch (opencode.py) |
conversation_in_use ignores serve --service holders of opencode.db while detecting --standalone / --session processes; resident_children = ('opencode',) prevents idle opencode serve --stdio --port 0 from tripping background_children while still detecting tool subprocesses under it. |
Shell Scripts (create_session.sh, resume_session.sh, update_yaml_resumed.sh, reconcile.sh, status.sh) |
All shell launch/resume commands use --auto --standalone without --agent; reconcile.sh drift C queries session_v2 with parent_id IS NULL; status.sh uses the adapter's _resolve_db and queries session_v2. |
Tests & Guard (_agent_home_guard.py, _fake_opencode.py, test_issue60_opencode_v2.py, test_a4_adapter_contract.py, test_issue31_purge_residual.py, test_tier2_component.py) |
XDG_DATA_HOME is in DROPPED_VARS and watched by watch_dirs; _real_opencode() runs --version in an isolated temporary HOME/TMPDIR. |
3. Test Execution Summary
All tests were executed in the verification worktree (/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261018T073639Z-b5cb7f/1) with PYTHONDONTWRITEBYTECODE=1, -p no:cacheprovider, external --basetemp, and isolated environment variables:
- Adapter, Guard, Purge/Residual, and Issue #60 Suites:
tests/test_issue60_opencode_v2.py(15 passed, includingtest_real_opencode_2x_contractagainst real opencode v2.0.32 in isolatedHOME/TMPDIR)tests/test_issue55_agent_homes.py(11 passed, includingtest_l1_every_path_variable_the_code_reads_is_accounted_for)tests/test_a4_adapter_contract.py(33 passed)tests/test_issue31_purge_residual.py(67 passed)- Total:
126 passed in 48.31s
- Tier 2 Component Suite (
opencode or status) withXDG_DATA_HOMECanary:- Ran
tests/test_tier2_component.py -k "opencode or status"withXDG_DATA_HOMEpointed at a canary temp directory. - Result:
7 passed in 62.22s, andXDG_CANARYremained completely empty.
- Ran
- Post-check:
- Verification worktree is clean (
git status -sempty, no.mamdirectory), and no strayopencodetest processes remain.
- Verification worktree is clean (
4. Findings
No blocking or non-blocking issues remaining. The branch fix/issue-60-opencode-v2 (74333f8..0e05b1b) is ready to merge.
[VERDICT: PASS]