Skip to content

Comments

OpenCode E2E tests#465

Open
Soph wants to merge 2 commits intomainfrom
soph/opencode-refactor-e2e
Open

OpenCode E2E tests#465
Soph wants to merge 2 commits intomainfrom
soph/opencode-refactor-e2e

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Feb 23, 2026

Adding OpenCode E2E tests

Entire-Checkpoint: 2baba34463b5
@Soph Soph requested a review from a team as a code owner February 23, 2026 15:00
Copilot AI review requested due to automatic review settings February 23, 2026 15:00
@cursor
Copy link

cursor bot commented Feb 23, 2026

PR Summary

Medium Risk
Adds a new external-agent execution path (opencode) and changes OpenCode hook dispatch to run synchronously at session/turn end, which can affect shutdown timing and E2E stability across environments.

Overview
Adds OpenCode as a supported E2E test agent by introducing an OpenCodeRunner that invokes opencode run, wiring it into the NewAgentRunner factory, and adding a dedicated mise task (test:e2e:opencode).

Hardens the OpenCode Entire plugin by switching turn-end detection from deprecated session.idle to session.status (idle) and running turn-end/session-end hooks synchronously via Bun.spawnSync to ensure hooks complete before opencode run exits. Also updates E2E repo setup to write opencode.json to allow external_directory permissions in non-interactive mode, and makes minor assertion cleanups (assert.Len).

Written by Cursor Bugbot for commit 90148a5. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive E2E test support for the OpenCode AI coding agent, making it the third agent supported alongside Claude Code and Gemini CLI. The implementation follows the established multi-agent pattern and includes necessary fixes to the OpenCode plugin for reliable hook execution in non-interactive mode.

Changes:

  • Added new test:e2e:opencode task to mise.toml for running OpenCode E2E tests
  • Implemented OpenCodeRunner following the existing agent runner pattern with proper timeout handling and model configuration
  • Fixed OpenCode plugin to use synchronous hook calls for turn-end and session-end events to prevent premature process exit
  • Added OpenCode-specific test environment configuration to handle permission settings
  • Improved test assertions to use assert.Len instead of assert.Equal for slice length checks

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mise.toml Adds E2E test task for OpenCode agent with appropriate timeout and test tags
cmd/entire/cli/e2e_test/testenv.go Adds OpenCode permission configuration to test environment setup and removes redundant gosec linter directive
cmd/entire/cli/e2e_test/agent_runner.go Implements OpenCodeRunner following established patterns for agent CLI integration
cmd/entire/cli/agent/opencode/entire_plugin.ts Migrates from deprecated session.idle to session.status events and adds synchronous hook execution to prevent race conditions
cmd/entire/cli/e2e_test/scenario_checkpoint_workflows_test.go Improves test assertions to use assert.Len per testifylint best practices

squishykid
squishykid previously approved these changes Feb 23, 2026
Base automatically changed from soph/opencode-refactor to main February 23, 2026 16:20
@Soph Soph dismissed squishykid’s stale review February 23, 2026 16:20

The base branch was changed.

Entire-Checkpoint: a054e0b1c569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants