feat(agents): normalize option keys to snake_case#303
Merged
Conversation
- `CHANGELOG.md`: Document F077 breaking changes, added features, and removed helpers - `CLAUDE.md`: Add per-provider flag mapping rule and dead helper cleanup pitfall - `docs/user-guide/agent-steps.md`: Document `allowed_tools` and `dangerously_skip_permissions` for Claude, Codex, Gemini - `internal/application/execution_service.go`: Update audit log key from `dangerouslySkipPermissions` to `dangerously_skip_permissions` - `internal/application/execution_service_dangerous_skip_audit_test.go`: Add audit log key regression tests (snake_case vs camelCase) - `internal/infrastructure/agents/claude_provider.go`: Rename `allowedTools`→`allowed_tools`, `dangerouslySkipPermissions`→`dangerously_skip_permissions` - `internal/infrastructure/agents/claude_provider_test.go`: Update option key references to snake_case - `internal/infrastructure/agents/claude_provider_unit_test.go`: Expand unit tests for snake_case option keys - `internal/infrastructure/agents/cli_executor.go`: Update option key reads to snake_case - `internal/infrastructure/agents/codex_provider.go`: Add `dangerously_skip_permissions` support via `--yolo` - `internal/infrastructure/agents/codex_provider_unit_test.go`: Add unit tests for Codex `dangerously_skip_permissions` - `internal/infrastructure/agents/gemini_provider.go`: Add `dangerously_skip_permissions` support via `--approval-mode=yolo` - `internal/infrastructure/agents/gemini_provider_unit_test.go`: Add unit tests for Gemini `dangerously_skip_permissions` - `internal/infrastructure/agents/helpers.go`: Remove dead `getWorkflowID` and `getStepName` helpers - `internal/infrastructure/agents/helpers_test.go`: Remove tests for deleted dead helpers - `tests/integration/validation/validation_providers_test.go`: Update option key references to snake_case Closes #300
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
allowedTools→allowed_tools,dangerouslySkipPermissions→dangerously_skip_permissions) — this is a breaking change; old keys are silently ignoreddangerously_skip_permissionssupport to Gemini (--approval-mode=yolo) and Codex (--yolo), making permission bypass available uniformly across all three CLI providersgetWorkflowID()andgetStepName()whose keys were never injected by any caller, and simplify audit log entries by dropping redundant workflow/step fieldsChanges
Application Layer
internal/application/execution_service.go: Update audit log key lookup fromdangerouslySkipPermissionstodangerously_skip_permissionsinternal/application/execution_service_dangerous_skip_audit_test.go: New test suite verifying snake_case key fires audit warning and camelCase key does notAgent Providers
internal/infrastructure/agents/claude_provider.go: Rename option key lookups toallowed_toolsanddangerously_skip_permissions; removeworkflow/stepfields from audit loginternal/infrastructure/agents/gemini_provider.go: Adddangerously_skip_permissionssupport mapping to--approval-mode=yolointernal/infrastructure/agents/codex_provider.go: Adddangerously_skip_permissionssupport mapping to--yolointernal/infrastructure/agents/cli_executor.go: Related cleanupDead Code Removal
internal/infrastructure/agents/helpers.go: RemovegetWorkflowID()andgetStepName()dead helpersinternal/infrastructure/agents/helpers_test.go: Remove tests for deleted helpersTests
internal/infrastructure/agents/claude_provider_unit_test.go: Update all option key references to snake_case; add CLI argument construction tests for both renamed keysinternal/infrastructure/agents/claude_provider_test.go: Update integration test option key toallowed_toolsinternal/infrastructure/agents/codex_provider_unit_test.go: Add tests fordangerously_skip_permissionsflag mappinginternal/infrastructure/agents/gemini_provider_unit_test.go: Add tests fordangerously_skip_permissionsflag mappingtests/integration/validation/validation_providers_test.go: Update option keys in validation fixturesDocumentation & Config
docs/user-guide/agent-steps.md: Documentallowed_toolsanddangerously_skip_permissionsfor Claude, Codex, and Gemini with security warningsCHANGELOG.md: Add breaking change notice and feature/removal entries under UnreleasedCLAUDE.md: Add architecture rule for per-provider flag mapping; add pitfall rules for dead helper cleanup and consistent option key namingTest plan
make test-unit— all provider option key tests passdangerouslySkipPermissions: truein a workflow YAML and confirm no permission skip occursdangerously_skip_permissions: truefor each provider and confirm the corresponding CLI flag is passedmake lint— no camelCase option key references remainCloses #300
Generated with awf commit workflow