feat(sdk/go): add Codex and Gemini harness providers#305
Merged
Conversation
…er factory Implements the remaining two CLI-based harness providers for the Go SDK, completing the feature parity with Python/TS implementations. - codex.go: Codex provider using `codex exec --json` with JSONL event parsing - gemini.go: Gemini provider using `gemini -p` with plain text output - factory.go: BuildProvider() factory for all 4 providers - Refactored runner.buildProvider() to delegate to BuildProvider() - Full test coverage for both providers and the factory Fixes #207 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Performance
✓ No regressions detected |
Codex: https://github.com/openai/codex Gemini: https://github.com/google-gemini/gemini-cli Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Real Codex CLI uses thread_id (not session_id) in thread.started events and text (not content) in agent_message items. Fixed parser to handle both field names. Added integration test (build tag: integration). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run with: go test ./harness/ -tags=integration Requires: codex CLI auth'd, GEMINI_API_KEY env var set with gemini settings.json auth type set to gemini-api-key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
codex.go) — invokescodex exec --json, parses JSONL event stream for turns, session IDs, and agent messagesgemini.go) — invokesgemini -p, captures plain text output (single-turn)BuildProvider()factory (factory.go) — unified constructor for all 4 providersrunner.buildProvider()to delegate to the factoryCompletes the Go SDK harness checklist from #207 (all 13 items now done).
Test plan
go test ./harness/— all tests pass (including 12 new tests)go test ./...— full Go SDK test suite passesOPENAI_API_KEYrequired)GEMINI_API_KEYrequired)How to test manually
Fixes #207
🤖 Generated with Claude Code