You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Copilot SDK sample driver reimplements the same multi-provider JSON validation and config shaping logic already present in the production driver. The overlap is large enough to create drift risk when the shape of GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON changes.
Duplication Details
Pattern: Multi-provider config parsing and validation
Maintainability: Any change to provider/model shape has to be updated in two places.
Bug Risk: One driver can accept a config the other rejects, or vice versa.
Code Bloat: The helper is repeated as near-identical boilerplate instead of being shared.
Refactoring Recommendations
Extract the parser and shape validators into a shared helper module in actions/setup/js/.
Reuse it from both the production driver and the sample driver.
Keep the sample thin so its customization surface is still clear.
If the sample must stay self-contained, at least import the validation helpers from the shared module and only keep the sample-specific wiring locally.
🔍 Duplicate Code Detected: Copilot SDK multi-provider parsing
Analysis of commit 23337a0
Summary
The Copilot SDK sample driver reimplements the same multi-provider JSON validation and config shaping logic already present in the production driver. The overlap is large enough to create drift risk when the shape of
GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSONchanges.Duplication Details
Pattern: Multi-provider config parsing and validation
.github/drivers/copilot_sdk_driver_sample_node.cjs(lines 46-85)actions/setup/js/copilot_sdk_driver.cjs(lines 48-85)Impact Analysis
Refactoring Recommendations
Extract the parser and shape validators into a shared helper module in
actions/setup/js/.If the sample must stay self-contained, at least import the validation helpers from the shared module and only keep the sample-specific wiring locally.
Implementation Checklist
Analysis Metadata
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.