forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Implement LIVE=1 smoke test for OpenCode CLI runtime #38
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
End-to-end smoke test validating the full pipeline with a real OpenCode CLI: message → ChannelBridge → OpenCodeCliRuntime → opencode CLI → NDJSON streaming → AgentDeliveryResult. Gated behind LIVE=1 environment variable. Mirrors the Claude smoke test (#34, PR #35).
Context
The Claude smoke test (PR #35) established the pattern: ChannelBridge → CLI runtime → real subprocess → assertion on result. This test applies the same pattern to OpenCode, additionally exercising OpenCodeMcpConfigManager's setup/teardown lifecycle (opencode.json merge-restore).
CLIs are pre-authenticated on the developer machine — no API key env var checks needed.
Acceptance Criteria
Given the middleware is implemented and ChannelBridge works (PR #33)
When a LIVE=1 smoke test is executed with a pre-authenticated opencode CLI
Then a test message is sent through ChannelBridge → OpenCodeCliRuntime
And a coherent text response is received via NDJSON streaming
And the session ID is captured and a follow-up message resumes the session
And the test is skippable in CI (gated behind LIVE=1 environment variable)Architecture
File
src/middleware/__smoke__/opencode.live.test.ts
Pattern
Same as claude.live.test.ts (PR #35):
describe.skipIf(!LIVE)guardbeforeAll: create temp dir, SessionMap, ChannelBridge withprovider: "opencode"- Test 1: single-turn response (assert payloads, text, sessionId, aborted=false)
- Test 2: session resumption (same channel/user → same sessionId)
afterAll: cleanup temp dir- 60s timeout per test
OpenCode-Specific
- No
CLAUDECODEenv var unset needed (only Claude has this concern) - OpenCode uses
OpenCodeMcpConfigManagerforopencode.jsonmerge-restore — this is exercised implicitly when MCP config is provided
Related
- Part of 4-CLI smoke test suite: Implement LIVE=1 smoke test for Claude CLI runtime #34 (Claude ✅), Implement LIVE=1 smoke test for Gemini CLI runtime #36 (Gemini), Implement LIVE=1 smoke test for Codex CLI runtime #37 (Codex), Implement LIVE=1 smoke test for OpenCode CLI runtime #38 (OpenCode)
Dependencies
- ChannelBridge orchestrator (PR feat(middleware): implement ChannelBridge orchestrator #33) ✅
Estimate
~80 LoC (reuses pattern from claude.live.test.ts)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request