Skip to content

feat(conversation): replace automated loop with interactive user input#314

Merged
pocky merged 1 commit intomainfrom
feature/F083-interactive-conversation-mode-breaking-c
Apr 14, 2026
Merged

feat(conversation): replace automated loop with interactive user input#314
pocky merged 1 commit intomainfrom
feature/F083-interactive-conversation-mode-breaking-c

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented Apr 14, 2026

Summary

  • Breaking change: Conversation mode is redesigned from an automated multi-turn loop into a live, user-driven interactive loop — max_turns, max_context_tokens, strategy, stop_condition, inject_context, and initial_prompt are all removed; workflows using these fields must be updated
  • The conversation: sub-struct is decoupled from mode: conversation — a plain single-mode agent step can now opt into session tracking via conversation: {}, establishing a session that downstream steps resume with continue_from
  • A new UserInputReader port + StdinInputReader adapter handles interactive stdin/stdout prompting; ConversationManager is simplified (evaluator and tokenizer removed from constructor); context_window.go and its 1,000-line test file are deleted
  • Documentation, YAML fixtures, and tests are fully updated to reflect the new interactive model, with StopReasonUserExit replacing the three removed stop-reason constants

Changes

Domain

  • internal/domain/ports/user_input.go: New UserInputReader port interface for interactive input
  • internal/domain/ports/user_input_test.go: Tests for UserInputReader port
  • internal/domain/workflow/agent_config.go: Remove InitialPrompt field; prompt now serves as first user message in conversation mode
  • internal/domain/workflow/conversation.go: Remove max_turns, max_context_tokens, strategy, stop_condition, inject_context fields; keep only continue_from
  • internal/domain/workflow/context.go: Remove ContextWindowStrategy type and related constants
  • internal/domain/workflow/doc.go: Update package-level documentation to reflect new model
  • internal/domain/workflow/context_window.go: Deleted — context window management no longer exists
  • internal/domain/workflow/context_window_test.go: Deleted

Application

  • internal/application/conversation_manager.go: Simplify constructor to (logger, resolver, agentRegistry); replace automated loop with UserInputReader-driven interactive loop; add StopReasonUserExit
  • internal/application/execution_service.go: Wire UserInputReader through ExecuteConversation; remove evaluator/tokenizer wiring paths
  • internal/application/test_helpers.go: Update helper constructors for simplified ConversationManager
  • internal/application/conversation_manager_tdd_test.go: New TDD test file for ConversationManager interactive behavior
  • internal/application/conversation_manager_test.go: Heavily trimmed — remove all automated-loop test cases
  • internal/application/conversation_manager_helpers_test.go: Update helpers for new constructor signature
  • internal/application/execution_service_conversation_step_test.go: Update for removed fields and new wiring
  • internal/application/execution_service_conversation_test.go: Update assertions to match interactive model
  • internal/application/execution_service_helpers_test.go: Update helper setup
  • internal/application/execution_service_output_format_test.go: Update for signature changes
  • internal/application/dry_run_executor_output_format_test.go: Minor fixture alignment

Infrastructure

  • internal/infrastructure/repository/yaml_mapper.go: Reject removed conversation fields with actionable errors on parse
  • internal/infrastructure/repository/yaml_types.go: Remove removed fields from YAML struct definitions
  • internal/infrastructure/repository/yaml_mapper_test.go: Update mapper tests; remove cases for deleted fields
  • internal/infrastructure/repository/yaml_mapper_agent_config_command_removal_test.go: Update for removed initial_prompt field
  • internal/infrastructure/repository/yaml_mapper_output_format_test.go: Minor fixture alignment
  • internal/infrastructure/repository/yaml_mapper_prompt_file_test.go: Update prompt-file test fixtures

Interfaces

  • internal/interfaces/cli/run.go: Wire StdinInputReader via SetUserInputReader()
  • internal/interfaces/cli/ui/stdin_input_reader.go: New StdinInputReader adapter implementing UserInputReader over os.Stdin/os.Stdout
  • internal/interfaces/cli/ui/stdin_input_reader_test.go: Tests for StdinInputReader
  • internal/interfaces/cli/run_wiring_conversation_test.go: Update wiring tests for new constructor
  • internal/interfaces/cli/run_wiring_stdin_input_reader_test.go: New wiring tests verifying StdinInputReader is set

Mocks & Test Utilities

  • internal/testutil/mocks/mocks.go: Add MockUserInputReader mock
  • internal/testutil/mocks/mocks_test.go: Tests for new mock

Tests & Fixtures

  • tests/fixtures/workflows/conversation-*.yaml (10 files): Remove all deleted fields; align fixtures to new schema
  • tests/fixtures/workflows/conversation-invalid-summarize.yaml: Deletedsummarize strategy no longer exists
  • tests/fixtures/workflows/conversation-invalid-truncate-middle.yaml: Deletedtruncate_middle strategy no longer exists
  • tests/integration/features/interactive_conversation_test.go: New integration tests for interactive conversation mode
  • tests/integration/features/conversation_validation_test.go: Remove validation tests for deleted fields
  • tests/integration/features/session_resume_test.go: Update for new session tracking model
  • tests/integration/agents/display_matrix_test.go: Renamed from f082_display_matrix_test.go
  • tests/integration/validation/validation_providers_test.go: Align with updated provider validation

Documentation

  • CHANGELOG.md: Document F083 breaking changes with migration instructions
  • docs/user-guide/conversation-steps.md: Full rewrite — documents interactive mode vs cross-step session tracking
  • docs/user-guide/agent-steps.md: Update multi-turn conversation section with new three-approach overview
  • docs/user-guide/workflow-syntax.md: Update conversation sub-struct reference

Test plan

  • Run make test — all unit tests pass with no references to removed fields
  • Run a workflow with mode: conversation in a terminal — agent replies after first prompt, > appears for subsequent input, empty line exits cleanly
  • Run a YAML with a removed field (e.g., max_turns: 5) — YAML parsing returns an actionable error, not a silent skip
  • Run a two-step workflow using conversation: {} + continue_from — second step resumes the session and the agent recalls context from step one

Closes #313


Generated with awf commit workflow

- `CHANGELOG.md`: Document F083 interactive conversation mode breaking change
- `docs/user-guide/agent-steps.md`: Update conversation step documentation
- `docs/user-guide/conversation-steps.md`: Rewrite for interactive mode
- `docs/user-guide/workflow-syntax.md`: Remove removed config fields from syntax reference
- `internal/application/conversation_manager.go`: Simplify constructor, remove evaluator/tokenizer
- `internal/application/conversation_manager_tdd_test.go`: Add TDD tests for interactive loop
- `internal/application/conversation_manager_test.go`: Adapt tests for interactive mode
- `internal/application/conversation_manager_helpers_test.go`: Update helper tests
- `internal/application/execution_service.go`: Wire UserInputReader through execution paths
- `internal/application/execution_service_conversation_step_test.go`: Update conversation step tests
- `internal/application/execution_service_conversation_test.go`: Update conversation tests
- `internal/application/test_helpers.go`: Add mock UserInputReader support
- `internal/domain/ports/user_input.go`: Add UserInputReader port interface
- `internal/domain/ports/user_input_test.go`: Add port interface tests
- `internal/domain/workflow/agent_config.go`: Remove InitialPrompt and 5 ConversationConfig fields
- `internal/domain/workflow/conversation.go`: Remove max_turns, strategy, stop_condition, inject_context
- `internal/domain/workflow/context_window.go`: Delete ContextWindowStrategy type and logic
- `internal/domain/workflow/context_window_test.go`: Delete obsolete tests
- `internal/domain/workflow/context.go`: Remove context window references
- `internal/infrastructure/repository/yaml_mapper.go`: Reject removed fields with actionable errors
- `internal/infrastructure/repository/yaml_types.go`: Remove removed YAML fields from types
- `internal/interfaces/cli/run.go`: Wire StdinInputReader via SetUserInputReader
- `internal/interfaces/cli/run_wiring_conversation_test.go`: Update wiring tests
- `internal/interfaces/cli/run_wiring_stdin_input_reader_test.go`: Add stdin reader wiring tests
- `internal/interfaces/cli/ui/stdin_input_reader.go`: Add StdinInputReader adapter
- `internal/interfaces/cli/ui/stdin_input_reader_test.go`: Add stdin reader unit tests
- `internal/testutil/mocks/mocks.go`: Add MockUserInputReader
- `internal/testutil/mocks/mocks_test.go`: Add mock tests
- `tests/fixtures/workflows/conversation-*.yaml`: Update fixtures to remove removed fields
- `tests/fixtures/workflows/conversation-invalid-summarize.yaml`: Delete obsolete fixture
- `tests/fixtures/workflows/conversation-invalid-truncate-middle.yaml`: Delete obsolete fixture
- `tests/integration/features/interactive_conversation_test.go`: Add interactive mode integration tests
- `tests/integration/features/conversation_validation_test.go`: Update validation tests
- `tests/integration/features/session_resume_test.go`: Update session resume tests
- `tests/integration/agents/display_matrix_test.go`: Rename from f082_ prefix

Closes #313
@pocky pocky marked this pull request as ready for review April 14, 2026 10:17
@pocky pocky merged commit fb5725a into main Apr 14, 2026
5 checks passed
@pocky pocky deleted the feature/F083-interactive-conversation-mode-breaking-c branch April 14, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F083: Interactive Conversation Mode (Breaking Change)

1 participant