Conversation
a722241 to
fe976b5
Compare
- `internal/infrastructure/agents/stream_filter.go`: Add `streamFilterWriter` io.Writer decorator and `LineExtractor` func type for NDJSON-to-text filtering - `internal/infrastructure/agents/base_cli_provider.go`: Wire `parseStreamLine` hook and `DisplayOutput` extraction into shared execution flow - `internal/infrastructure/agents/claude_provider.go`: Implement `parseClaudeStreamLine` extracting `content_block_delta` text events - `internal/infrastructure/agents/gemini_provider.go`: Add stub `parseStreamLine` hook for future NDJSON extraction - `internal/infrastructure/agents/codex_provider.go`: Add stub `parseStreamLine` hook for future NDJSON extraction - `internal/infrastructure/agents/opencode_provider.go`: Add stub `parseStreamLine` hook for future NDJSON extraction - `internal/domain/workflow/agent_config.go`: Add `DisplayOutput` field (json:"-") to `AgentResult` - `internal/domain/workflow/context.go`: Add `DisplayOutput` field (json:"-") to `StepState` - `internal/domain/workflow/conversation.go`: Add `DisplayOutput` field (json:"-") to `ConversationResult` - `internal/application/execution_service.go`: Use `DisplayOutput` in `showStepOutputs`; clone options before injecting `output_format` - `internal/application/conversation_manager.go`: Propagate `DisplayOutput` from conversation result - `internal/interfaces/cli/run.go`: Pass output format context to execution service - `internal/infrastructure/agents/base_cli_provider_display_output_unit_test.go`: Add 629-line unit test suite for stream filter and base provider display output - `internal/infrastructure/agents/claude_provider_display_output_unit_test.go`: Add unit tests for Claude NDJSON parser - `internal/infrastructure/agents/gemini_provider_display_output_unit_test.go`: Add unit tests for Gemini display output stub - `internal/infrastructure/agents/codex_provider_display_output_unit_test.go`: Add unit tests for Codex display output stub - `internal/infrastructure/agents/opencode_provider_display_output_unit_test.go`: Add unit tests for OpenCode display output stub - `internal/infrastructure/agents/stream_filter_unit_test.go`: Add unit tests for `streamFilterWriter` - `internal/application/execution_service_display_output_test.go`: Add 424-line tests for display output cross-layer wiring - `internal/domain/workflow/context_json_test.go`: Verify `DisplayOutput` is excluded from JSON serialization - `pkg/interpolation/resolver_data_test.go`: Verify `DisplayOutput` not resolvable in template context - `tests/integration/agents/f082_display_matrix_test.go`: Add integration test matrix across all providers - `docs/user-guide/agent-steps.md`: Document `output_format` field and streaming display behavior - `docs/user-guide/commands.md`: Update run command docs with output mode behavior - `CHANGELOG.md`: Add F082 entry - `README.md`: Update feature list - `docs/README.md`: Update docs index Closes #311
fe976b5 to
242bea9
Compare
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 streamingor--output buffered, agent NDJSON responses are filtered to plain text instead of showing raw wire formatoutput_formatfield now serves dual purpose — post-processing (code fence stripping) AND terminal display routing:text/omitted filters to readable output,jsonpasses raw NDJSON throughDisplayOutputfield propagates fromAgentResultthroughConversationResult→StepState→ CLI summary;state.Outputretains raw NDJSON for template interpolation unchangedcloneAndInjectOutputFormatnow normalizesOutputFormatNone→textso the display-matrix pipeline always receives an explicit format value, and is applied consistently to bothexecuteAgentStepandExecuteConversationpathsChanges
Infrastructure — Agent Providers
internal/infrastructure/agents/base_cli_provider.go: WireparseStreamLinehook into streaming I/O path; applystreamFilterWriterwhenoutput_formatis notjson; populateDisplayOutputin returnedAgentResultinternal/infrastructure/agents/stream_filter.go: SimplifystreamFilterWriter— remove redundant buffering logic, tightenLineExtractorcontractinternal/infrastructure/agents/opencode_provider.go: Add stubparseStreamLinehook to satisfy updatedcliProviderHooksstructApplication Layer
internal/application/execution_service.go: NormalizeOutputFormatNone→OutputFormatTextincloneAndInjectOutputFormatso downstream always sees an explicit valueinternal/application/conversation_manager.go: Replace inline options map construction withcloneAndInjectOutputFormatto apply identical display routing to conversation turns (F082 cross-path consistency)Tests
internal/application/execution_service_display_output_test.go: Add table-driven tests foroutput_formatinjection (text/json/none→text), nil-options handling, and option map immutability (FR-009)internal/infrastructure/agents/claude_provider_display_output_unit_test.go: Refocus tests onparseClaudeStreamLineextraction; remove obsolete streaming-path tests superseded by base providerinternal/infrastructure/agents/opencode_provider_display_output_unit_test.go: Update to reflect stub extractor behavior after OpenCode gainsparseStreamLinehookinternal/infrastructure/agents/stream_filter_unit_test.go: Align with simplifiedstreamFilterWritercontract; add benchmark for throughput and 1 MB buffer constraintinternal/domain/workflow/context_json_test.go: AssertDisplayOutputis NOT resolvable in template interpolation context (prevents accidental exposure)internal/interfaces/cli/run.go: Remove unused import/variable introduced during earlier wiringpkg/interpolation/resolver_data_test.go: AddDisplayOutputto excluded-fields coveragetests/integration/agents/f082_display_matrix_test.go: New integration test matrix covering all provider × output-mode × output-format combinationsDocumentation
docs/user-guide/agent-steps.md: AddStreaming Output Displaysection with mode/format matrix table and examples for streaming, buffered, and silent modesdocs/user-guide/commands.md: Update--outputflag table to document agent-step display filtering behaviordocs/README.md: Add link to newStreaming Output DisplaysubsectionREADME.md: Update feature bullet to mention human-readable streaming displayCHANGELOG.md: Add F082 entry underAddedProject Config
CLAUDE.md: Add architecture rules for cross-path hook wiring and test conventions forDisplayOutputfield isolation and benchmark requirements; remove stale rulesTest plan
make test— all unit and integration tests pass including newf082_display_matrix_test.goawf run <workflow-with-agent-step> --output streaming— terminal shows readable text, not raw{"type":"content_block_delta",...}NDJSONawf run <workflow-with-agent-step> --output streamingwithoutput_format: json— raw NDJSON appears unchanged on terminal{{states.step.display_output}}returns empty/unresolved —DisplayOutputis not exposed to workflowsCloses #311
Generated with awf commit workflow