Skip to content

fix(acp): derive VALID_CONFIRMATION_MODE from type using get_args - #835

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/derive-valid-confirmation-modes-from-type
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/derive-valid-confirmation-modes-from-type

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Uses typing.get_args() to derive VALID_CONFIRMATION_MODE from the ConfirmationMode Literal type, keeping the list automatically in sync with the type definition.

Changes

  • Import get_args from typing
  • Replace hardcoded list with list(get_args(ConfirmationMode))

Why This Matters

Previously, the VALID_CONFIRMATION_MODE list was manually duplicated from the ConfirmationMode Literal type. If someone adds or removes a mode from the type, they might forget to update the list (or vice versa), leading to subtle bugs. Now the list is automatically derived from the type.

Related Issue

Addresses findings from #833 (Low-Hanging Fruit item #2)

Testing

  • Linting passes (make lint)
  • Tests pass (make test - 1361 tests passed)

This PR was automatically generated by the Code Quality Report workflow.

This PR was created by an AI agent (OpenHands) on behalf of the repository maintainers.

Use typing.get_args() to derive VALID_CONFIRMATION_MODE from the
ConfirmationMode Literal type, keeping the list automatically in sync
with the type definition.

Addresses item from code quality report.

Closes #833

Co-authored-by: openhands <openhands@all-hands.dev>
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.

0 participants