fix(execution): add SCOPE_TOO_WIDE enum value and guard artifact_writer .value call - #281
Merged
ProtocolWarden merged 1 commit intoJun 13, 2026
Conversation
…er .value call Root cause: workspace.py set failure_category to literal string "scope_too_wide" because FailureReasonCategory lacked the SCOPE_TOO_WIDE member. Pydantic stored it as a plain str; artifact_writer.py then crashed with AttributeError when calling .value on the string (reproduced in review watcher log at 12:39:58 UTC 2026-06-13). Three-file fix: - contracts/enums.py: add SCOPE_TOO_WIDE = "scope_too_wide" to FailureReasonCategory - execution/workspace.py: import FailureReasonCategory; use enum member instead of str - execution/artifact_writer.py: guard fc.value with hasattr check as defensive belt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ProtocolWarden
deleted the
oc-watchdog/20260613-1838-artifact-writer-scope-too-wide
branch
June 13, 2026 22:10
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
SCOPE_TOO_WIDE = "scope_too_wide"toFailureReasonCategoryenum incontracts/enums.pyartifact_writer.py.valuecall to handle string values safelyworkspace.pyto use the enum member instead of raw stringRoot Cause
WorkspaceManager.finalize()setsfailure_category = "scope_too_wide"(a string), butartifact_writer.pycalls.valueon it expecting an enum member. This causedAttributeError: 'str' object has no attribute 'value'in the review watcher logs.Test plan
pytest tests/unit/er000_phase0_golden/ tests/unit/execution/ tests/unit/entrypoints/ -q(1334 passed)🤖 Generated with Claude Code