feat(agents): add GitHub Copilot agent provider#329
Merged
Conversation
- `internal/infrastructure/agents/copilot_provider.go`: Implement `github_copilot` provider with single-turn and multi-turn conversation support via `copilot` CLI - `internal/infrastructure/agents/copilot_provider_unit_test.go`: Add unit tests for provider construction, execution, and session handling - `internal/infrastructure/agents/copilot_provider_delegation_test.go`: Add delegation tests validating shared behavior contracts - `internal/infrastructure/agents/copilot_provider_extract_test.go`: Add extraction tests for session ID and output parsing - `internal/infrastructure/agents/copilot_provider_parse_display_events_test.go`: Add JSONL stream display event parsing tests - `internal/infrastructure/agents/copilot_provider_validation_unit_test.go`: Add option validation tests for mode and effort enums - `internal/infrastructure/agents/options.go`: Add Copilot-specific option keys (model, mode, effort, tools, allow_all) - `internal/infrastructure/agents/provider_options_test.go`: Extend provider options tests to cover Copilot options - `internal/infrastructure/agents/registry.go`: Register `github_copilot` as 6th provider in `RegisterDefaults()` - `internal/infrastructure/agents/registry_test.go`: Update registry tests to include Copilot provider assertions - `internal/infrastructure/agents/stream_filter.go`: Extend JSONL stream filtering to handle Copilot output format - `pkg/display/event.go`: Update display event parsing to support Copilot JSONL event structure - `CHANGELOG.md`: Document F089 GitHub Copilot provider addition - `CLAUDE.md`: Add provider name prefix rule and update project overview - `README.md`: Update feature descriptions to include GitHub Copilot - `docs/README.md`: Update agent steps documentation link description - `docs/user-guide/agent-steps.md`: Add GitHub Copilot provider documentation with options and auth - `docs/user-guide/conversation-steps.md`: Add `github_copilot` to conversation mode provider list Closes #328
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
github_copilotas the 6th agent provider, implementing the fullAgentProviderinterface via thecopilotCLI binary with single-turn and multi-turn (session resume) supportmodel,mode(interactive/plan/autopilot),effort(low/medium/high),allowed_tools,denied_tools, andallow_all, with enum validation atawf validatetimeassistant.message_delta,tool.execution_start) throughparseCopilotDisplayEventsChanges
Provider Implementation
internal/infrastructure/agents/copilot_provider.go: NewCopilotProviderstruct implementingAgentProviderviabaseCLIProviderhooks; builds CLI args for single-turn (-p <prompt> --output-format=json --silent) and multi-turn (--resume=<id>) modes; inlines system prompt for first turn (no--system-promptflag in Copilot CLI); validatesmodeandeffortenums; parses JSONL display events and extractsassistant.messagecontent; graceful fallback to raw output when session ID extraction failsinternal/infrastructure/agents/options.go: AddCopilotProviderOptionfunctional option type andWithCopilotExecutoroption for test injectioninternal/infrastructure/agents/registry.go: RegisterCopilotProviderinRegisterDefaults()as the 6th providerinternal/infrastructure/agents/stream_filter.go: Minor update to accommodate new provider integrationpkg/display/event.go: Update display event handling to support Copilot JSONL event typesTests
internal/infrastructure/agents/copilot_provider_unit_test.go: Unit tests for CLI arg construction, name/validate, and option delegationinternal/infrastructure/agents/copilot_provider_delegation_test.go: Delegation tests verifyingExecuteandExecuteConversationcorrectly delegate tobaseCLIProviderthrough hooks, covering first-turn, resume-turn, and system-prompt-inlining scenariosinternal/infrastructure/agents/copilot_provider_extract_test.go: Tests forextractCopilotTextContentandextractCopilotSessionIDcovering valid JSONL, missing fields, empty output, and camelCasesessionIdkeyinternal/infrastructure/agents/copilot_provider_parse_display_events_test.go: Tests forparseCopilotDisplayEventscoveringassistant.message_delta,tool.execution_start, unknown event types, and missing optional fieldsinternal/infrastructure/agents/copilot_provider_validation_unit_test.go: Enum validation tests formodeandeffortoptionsinternal/infrastructure/agents/provider_options_test.go: Updated to includeCopilotProviderOptioncoverageinternal/infrastructure/agents/registry_test.go: Updated registry assertions to expect 6 providersDocumentation
CHANGELOG.md: Add F089 entry documenting all Copilot provider capabilitiesCLAUDE.md: Add architecture rule for provider name prefixes on helper methods; update provider count to 6; remove stale ruleREADME.md: Add GitHub Copilot to feature bullets and provider listsdocs/README.md: Update agent-steps link description to include GitHub Copilotdocs/user-guide/agent-steps.md: Add GitHub Copilot section with YAML example, all supported options, authentication methods; update provider count to 6 throughoutdocs/user-guide/conversation-steps.md: Addgithub_copilotto provider table and session resume flag documentationTest plan
make test-unitpasses with all new Copilot provider tests greenawf validatereports enum errors for invalidmode/effortvalues on a Copilot agent stepcopilotCLI installed and authenticated,awf runexecutes a single-turngithub_copilotstep and returns agent outputcontinue_fromcorrectly passes--resume=<session-id>on subsequent turnsCloses #328
Generated with awf commit workflow