Skip to content

Guard layout-review HTTP actions against unknown action names#87

Merged
thomaswantstobeaskeleton merged 1 commit intocodex/update-software-icon-and-readmefrom
codex/fix-issues-from-codex-review-#85
May 2, 2026
Merged

Guard layout-review HTTP actions against unknown action names#87
thomaswantstobeaskeleton merged 1 commit intocodex/update-software-icon-and-readmefrom
codex/fix-issues-from-codex-review-#85

Conversation

@thomaswantstobeaskeleton
Copy link
Copy Markdown
Owner

Motivation

  • Prevent crashes when external layout-review HTTP providers return unexpected action names that don't match the fixed ActionType set, which previously caused downstream grouping code to raise KeyError.

Description

  • Validate provider-returned action values before constructing ReviewAction in ui/mainwindow.py by importing ActionType and get_args and adding VALID_REVIEW_ACTIONS = set(get_args(ActionType)).
  • Skip any unsupported or non-string action names (with a LOGGER.debug entry) instead of passing them on to downstream logic.
  • Coerce and validate block_index as an int and continue to skip negative indices; preserve behavior for valid actions.
  • Changes are limited to ui/mainwindow.py around the HTTP provider response parsing and _build_review_result_from_provider_actions logic.

Testing

  • Ran python -m compileall -f -q ui/mainwindow.py, which completed (bytecode compiled) for the modified file.
  • Attempted a runtime smoke import with python -c "import ui.mainwindow; print('import ok')", which failed due to ImportError: libGL.so.1: cannot open shared object file from OpenCV in this environment; this runtime failure is unrelated to the patch and prevents a full import smoke-test here.

Codex Task

@thomaswantstobeaskeleton thomaswantstobeaskeleton merged commit 3edb300 into codex/update-software-icon-and-readme May 2, 2026
1 check passed
@thomaswantstobeaskeleton thomaswantstobeaskeleton deleted the codex/fix-issues-from-codex-review-#85 branch May 2, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant