remove OpenCode serve+attach workaround for stateless CLI#326
Open
AdityaNair-jpg wants to merge 1 commit intoAgent-Field:mainfrom
Open
remove OpenCode serve+attach workaround for stateless CLI#326AdityaNair-jpg wants to merge 1 commit intoAgent-Field:mainfrom
AdityaNair-jpg wants to merge 1 commit intoAgent-Field:mainfrom
Conversation
Contributor
Performance
✓ No regressions detected |
1 task
Contributor
Manual Testing Failed — CLI Interface MismatchTested locally against OpenCode v0.0.55 (latest release as of 2026-04-01). The provider builds commands using Reproductionfrom dotenv import load_dotenv
load_dotenv()
import asyncio
from agentfield.harness.providers.opencode import OpenCodeProvider
async def test():
p = OpenCodeProvider()
r = await p.execute('say hello', {'model': 'openai/gpt-4o'})
print('error:', r.is_error)
print('failure_type:', r.failure_type)
print('output:', (r.result or '')[:200])
print('error_msg:', (r.error_message or '')[:200])
asyncio.run(test())OutputDetails
The refactor itself is structurally clean, but the target CLI interface ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the OpenCode harness provider to use a simple, stateless CLI subprocess pattern. This change removes the previous "serve+attach" workaround which was required to bypass a "Session not found" bug in headless mode (upstream issue opencode#13851).
Key improvements include:
opencode runcalls, aligning with the pattern used by Gemini and Codex providers.opencode_serverfield fromHarnessConfigand simplified directory routing in the core runner.--dirproject isolation support.Testing
./scripts/test-all.shsdk/python/tests/test_harness_provider_opencode.pypass using new mocks.tests/debug_complex_json.pycorrectly reaches execution phase.opencode runwithout a temp subdirectory correctly writes to the targetproject_dir.Checklist
CHANGELOG.md(or this change does not warrant a changelog entry).Screenshots (if UI-related)
No UI changes; logic refactor only.
Closes #221
Related issues
Fixes #206
References #210, #220