Skip to content

feat: v2.4 Phase 32 — OpenCode CLI Tests#20

Merged
RichardHightower merged 9 commits intomainfrom
feature/phase-32-opencode-cli-tests
Mar 5, 2026
Merged

feat: v2.4 Phase 32 — OpenCode CLI Tests#20
RichardHightower merged 9 commits intomainfrom
feature/phase-32-opencode-cli-tests

Conversation

@RichardHightower
Copy link
Contributor

Summary

  • 25 bats E2E tests across 4 files (smoke, hooks, pipeline, negative) validating the OpenCode CLI hook-to-query pipeline
  • 6 CchEvent fixture JSON files with agent=opencode (5 event types — no PreToolUse)
  • Added run_opencode wrapper to cli_wrappers.bash using opencode run --format json with timeout guards
  • All hook tests use direct CchEvent ingest (OpenCode uses TypeScript plugin, not bash hook script)
  • Negative tests cover memory-ingest fail-open for daemon-down, malformed, empty stdin, unknown event, and timeout

Test plan

  • bats tests/cli/opencode/smoke.bats — 8 tests (binary detection, daemon health, basic ingest, graceful skip)
  • bats tests/cli/opencode/hooks.bats — 7 tests (all 5 event types via direct CchEvent ingest, two-layer proof)
  • bats tests/cli/opencode/pipeline.bats — 5 tests (full ingest-to-query cycle with agent=opencode)
  • bats tests/cli/opencode/negative.bats — 5 tests (daemon-down, malformed, empty, unknown, timeout)
  • CI e2e-cli matrix passes for opencode job

🤖 Generated with Claude Code

RichardHightower and others added 9 commits February 26, 2026 00:36
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 6 compact single-line CchEvent fixtures for all 5 OpenCode event types + malformed
- run_opencode wrapper added to cli_wrappers.bash with timeout guard and JSON output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- smoke.bats: 8 tests (binary checks, daemon health, plugin file, ingest, CLI detection)
- hooks.bats: 7 tests (all 5 event types + sequence + agent field via direct ingest)
- Two-layer proof pattern: Layer 1 = ingest continue:true, Layer 2 = gRPC storage
- No HOOK_SCRIPT piping (OpenCode uses TypeScript plugin, not bash)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SUMMARY.md with 2 task commits, 1 deviation documented
- STATE.md updated to Phase 32, plan 1/2, with decisions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 5 pipeline tests: session lifecycle, TOC browse, cwd metadata, agent field, concurrent sessions
- 5-event OpenCode session (no PreToolUse): SessionStart, UserPromptSubmit, PostToolUse, AssistantResponse, Stop
- Direct CchEvent format with agent=opencode
…ndling tests

- 5 negative tests: daemon down, malformed JSON, empty stdin, unknown event, timeout
- memory-ingest fail-open only (no hook script layer for OpenCode TypeScript plugin)
- All ingest fail-open tests assert exit 0 + {"continue":true}
- SUMMARY.md with 2 task commits, 25 total tests passing
- STATE.md updated: plan 2/2 complete, progress 69%

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant