feat(action): add fail action type for infeasible tasks#13
Merged
gwynbleidd003 merged 1 commit intoagiopen-org:mainfrom Feb 5, 2026
Merged
feat(action): add fail action type for infeasible tasks#13gwynbleidd003 merged 1 commit intoagiopen-org:mainfrom
gwynbleidd003 merged 1 commit intoagiopen-org:mainfrom
Conversation
4b5776c to
645e599
Compare
Add FAIL action type to allow models to signal a task is infeasible: - Add FAIL="fail" to ActionType enum - Set stop=True for fail() in output parser (same as finish()) - Handle FAIL in pyautogui/ydotool handlers (reset state like FINISH) - Handle FAIL in socketio server (emit finish event) - Add fail() to prompt template instruction - Add test coverage for all changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
645e599 to
611bea4
Compare
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
FAIL = "fail"toActionTypeenum, allowing models to explicitly signal a task is infeasiblefail()across the full pipeline: output parser, action handlers, socketio server, prompt templateMotivation
During task evaluation, models sometimes encounter infeasible tasks (e.g., requested application not installed, required file missing). Previously, models had no way to express "this task cannot be completed." The
fail()action gives models an explicit escape hatch, which downstream evaluators can use to score infeasible task detection.Changes
types/models/action.pyFAIL = "fail"toActionTypeenumutils/output_parser.pyfail()setsstop=True(same asfinish())utils/prompt_builder.py11. fail()to instruction templatehandler/pyautogui_action_handler.pyFINISH | FAILjoint match casehandler/ydotool_action_handler.pyFINISH | FAILjoint match caseserver/socketio_server.pyFAILcase emitsfinisheventtests/Test plan
test_parse_fail_action_sets_stop— parser correctly sets stop flagtest_parse_basic_actions[fail()]— parametrized action parsingtest_fail_with_other_actions— fail combined with other actionstest_multiple_fail_actions_stop_true— multiple fail in sequencetest_step_with_failed_response— Actor.step() handles fail responsetest_fail_action— pyautogui handler accepts fail actiontest_fail_action_resets_handler— fail resets capslock state🤖 Generated with Claude Code