Conversation
…Conversation` in the ports interface and all provider implementations 2. Fixing CLI invocation flags (Claude/Gemini `--output-format stream-json`, Codex `exec --json`, OpenCode `--format json`/`--model`) 3. Removing dead validation helpers 4. Adding new tests for stream-json, codex exec, and codex resume fix(agents): fix CLI provider invocations and add io.Writer streaming - `CHANGELOG.md`: Document F078 breaking changes and additions - `CLAUDE.md`: Add rule for synchronizing options.go with provider changes - `internal/domain/ports/agent_provider.go`: Add stdout/stderr io.Writer params to Execute and ExecuteConversation - `internal/domain/ports/agent_provider_test.go`: Update port interface tests for new signature - `internal/domain/ports/cli_executor.go`: Propagate io.Writer to CLI executor - `internal/domain/ports/cli_executor_test.go`: Update executor tests for new signature - `internal/infrastructure/agents/claude_provider.go`: Map output_format json to --output-format stream-json - `internal/infrastructure/agents/claude_provider_stream_json_test.go`: Add stream-json output format tests - `internal/infrastructure/agents/claude_provider_session_test.go`: Update session tests for new signature - `internal/infrastructure/agents/claude_provider_unit_test.go`: Update unit tests for new signature - `internal/infrastructure/agents/cli_executor.go`: Wire stdout/stderr writers to process output - `internal/infrastructure/agents/cli_executor_test.go`: Update executor tests for new signature - `internal/infrastructure/agents/codex_provider.go`: Migrate from --prompt/--quiet to exec --json subcommand - `internal/infrastructure/agents/codex_provider_exec_test.go`: Add exec subcommand invocation tests - `internal/infrastructure/agents/codex_provider_resume_test.go`: Add resume --json flag tests - `internal/infrastructure/agents/codex_provider_session_test.go`: Update session tests - `internal/infrastructure/agents/codex_provider_unit_test.go`: Update unit tests for new invocation - `internal/infrastructure/agents/codex_provider_model_unit_test.go`: Update model tests - `internal/infrastructure/agents/gemini_provider.go`: Map output_format json to --output-format stream-json - `internal/infrastructure/agents/gemini_provider_session_test.go`: Update session tests - `internal/infrastructure/agents/gemini_provider_unit_test.go`: Expand unit tests for flag mapping - `internal/infrastructure/agents/helpers.go`: Remove dead validatePrompt/validateContext/validateState helpers - `internal/infrastructure/agents/helpers_test.go`: Remove tests for deleted helpers - `internal/infrastructure/agents/mock_provider.go`: Update mock to new Execute/ExecuteConversation signature - `internal/infrastructure/agents/mock_provider_test.go`: Update mock tests - `internal/infrastructure/agents/openai_compatible_provider.go`: Update to new interface signature - `internal/infrastructure/agents/openai_compatible_provider_test.go`: Update integration tests - `internal/infrastructure/agents/openai_compatible_provider_unit_test.go`: Update unit tests - `internal/infrastructure/agents/opencode_provider.go`: Add --format json and --model flag support - `internal/infrastructure/agents/opencode_provider_session_test.go`: Update session tests - `internal/infrastructure/agents/opencode_provider_unit_test.go`: Expand unit tests for new flags - `internal/infrastructure/agents/options.go`: Add output_format option declaration - `internal/infrastructure/agents/provider_options_test.go`: Update options tests - `internal/infrastructure/agents/registry_test.go`: Update registry tests - `internal/application/execution_service.go`: Pass stdout/stderr writers to provider calls - `internal/application/execution_service_conversation_step_test.go`: Rename from t009, update signature - `internal/application/execution_service_conversation_test.go`: Update for new signature - `internal/application/execution_service_dangerous_skip_audit_test.go`: Update for new signature - `internal/application/execution_service_hooks_test.go`: Update for new signature - `internal/application/execution_service_json_field_mapping_test.go`: Update for new signature - `internal/application/execution_service_output_format_test.go`: Update for new signature - `internal/application/agent_step_test.go`: Update all mock execute funcs for new signature - `internal/application/conversation_manager.go`: Add stdout/stderr params to executeTurn and ExecuteConversation - `internal/application/conversation_manager_helpers_test.go`: Update mock for new signature - `internal/application/conversation_manager_test.go`: Update all ExecuteConversation calls - `internal/testutil/mocks/mocks.go`: Update mock Execute/ExecuteConversation signatures - `internal/testutil/mocks/mocks_agent_test.go`: Update mock agent tests - `internal/testutil/mocks/mocks_cli_executor_test.go`: Update CLI executor mock tests - `tests/integration/execution/provider_interpolation_test.go`: Update for new signature Closes #301
stdout, stderr io.Writer params to Execute and ExecuteConversation in the ports interface and all provider implementations 2. Fixing CLI invocation flags (Claude/Gemini --output-format stream-json, Codex exec --json, OpenCode --format json/--model) 3. Removing dead validation helpers 4. Adding new tests for stream-json, codex exec, and codex resume
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
--output-format json→stream-json, Codex--prompt/--quiet→exec --json <prompt>, OpenCode gains--format jsonand--modelsupportstdout, stderr io.Writerparameters toExecuteandExecuteConversationin the ports interface and all provider implementations, enabling streaming output propagationvalidatePrompt,validateContext,validateState,validateCodexOptions) that became no-ops after previous provider refactoringChanges
Ports / Interface
internal/domain/ports/agent_provider.go: Addstdout, stderr io.Writerparams toExecuteandExecuteConversationsignaturesinternal/domain/ports/agent_provider_test.go: Update interface tests for new signatureinternal/domain/ports/cli_executor.go: Propagate writer params through CLI executor abstractioninternal/domain/ports/cli_executor_test.go: Update testsProvider Implementations
internal/infrastructure/agents/claude_provider.go: Mapoutput_format: json→--output-format stream-json; acceptstream-jsonpass-through; wirestdout/stderrwritersinternal/infrastructure/agents/codex_provider.go: Migrate from--prompt/--quiettoexec --json <prompt>; resume fromcodex resume <id> --prompttocodex resume <id> --json; removequietoptioninternal/infrastructure/agents/gemini_provider.go: Mapoutput_format: json→--output-format stream-json; wire writersinternal/infrastructure/agents/opencode_provider.go: Add--format jsonalways-on flag and--modeloption support; wire writersinternal/infrastructure/agents/openai_compatible_provider.go: Update signature to acceptstdout/stderrwritersinternal/infrastructure/agents/cli_executor.go: Wire writer params through CLI executioninternal/infrastructure/agents/helpers.go: Remove dead validation helpers (validatePrompt,validateContext,validateState)internal/infrastructure/agents/options.go: Addoutput_format/quietoption declarationsApplication Layer
internal/application/conversation_manager.go: ThreadstdoutW, stderrW io.WriterthroughexecuteTurnandExecuteConversationinternal/application/execution_service.go: Pass writers through agent step and conversation executionMocks & Test Infrastructure
internal/testutil/mocks/mocks.go: UpdateMockAgentProviderto match newExecute/ExecuteConversationsignaturesinternal/testutil/mocks/mocks_agent_test.go: Update mock testsinternal/testutil/mocks/mocks_cli_executor_test.go: Update CLI executor mock testsTests
internal/infrastructure/agents/claude_provider_stream_json_test.go(new): Tests forstream-jsonoutput format flag mappinginternal/infrastructure/agents/codex_provider_exec_test.go(new): Tests forcodex exec --jsoninvocationinternal/infrastructure/agents/codex_provider_resume_test.go(new): Tests forcodex resume --jsonconversation resumeinternal/infrastructure/agents/claude_provider_unit_test.go: Extend unit tests for new flag behaviorinternal/infrastructure/agents/codex_provider_unit_test.go: Extend unit tests; removequietoption testsinternal/infrastructure/agents/codex_provider_model_unit_test.go: Trim tests no longer applicable after exec migrationinternal/infrastructure/agents/codex_provider_session_test.go: Update session tests for resume flag changeinternal/infrastructure/agents/gemini_provider_unit_test.go: Extend tests forstream-jsonmappinginternal/infrastructure/agents/gemini_provider_session_test.go: Update session testsinternal/infrastructure/agents/opencode_provider_unit_test.go: Extend tests for--format jsonand--modelinternal/infrastructure/agents/opencode_provider_session_test.go: Update session testsinternal/infrastructure/agents/openai_compatible_provider_test.go: Update for new signatureinternal/infrastructure/agents/openai_compatible_provider_unit_test.go: Update unit testsinternal/infrastructure/agents/helpers_test.go: Remove tests for deleted helpersinternal/infrastructure/agents/cli_executor_test.go: Update for writer paramsinternal/infrastructure/agents/mock_provider.go: Update mock to new interfaceinternal/infrastructure/agents/mock_provider_test.go: Update mock testsinternal/infrastructure/agents/provider_options_test.go: Update option validation testsinternal/infrastructure/agents/registry_test.go: Minor updatesinternal/application/agent_step_test.go: Update allSetExecuteFunccallbacks to new signatureinternal/application/conversation_manager.go: Already covered aboveinternal/application/conversation_manager_helpers_test.go: Update internal mock to new interfaceinternal/application/conversation_manager_test.go: Passnil, nilwriters in allExecuteConversationcallsinternal/application/execution_service_conversation_step_test.go(renamed from t009): Rename for clarityinternal/application/execution_service_conversation_test.go: Minor updatesinternal/application/execution_service_dangerous_skip_audit_test.go: Minor updatesinternal/application/execution_service_hooks_test.go: Minor updatesinternal/application/execution_service_json_field_mapping_test.go: Minor updatesinternal/application/execution_service_output_format_test.go: Update for newstream-jsonmappingtests/integration/execution/provider_interpolation_test.go: Minor updatesDocumentation
CHANGELOG.md: Document F078 breaking changes (flag migrations, removedquietoption) and additions (OpenCode--model,--format json)CLAUDE.md: Add architecture rule to synchronize provider CLI flag changes withoptions.go; remove stale review sectionTest plan
make test-unit— all provider flag-construction tests passexec --json <prompt>and resume buildscodex resume <id> --json <prompt>: checkcodex_provider_exec_test.goandcodex_provider_resume_test.gooutput_format: jsonin a workflow YAML produces--output-format stream-jsonin the CLI command: checkclaude_provider_stream_json_test.gomake test-raceCloses #301
Generated with awf commit workflow