Repository navigation
fix(alfworld): execute the action the rollout records - #451
Open
Yiming Niu (neumyor) wants to merge 1 commit into
Open
Yiming Niu (neumyor) wants to merge 1 commit into
Yiming Niu (neumyor) wants to merge 1 commit into
Conversation
The projection found the first "<action>" and the first "</action>" separately. A "</action>" mentioned in the reasoning came before the real opening tag, so the environment got an empty action marked valid, while _extract_action recorded the real action in the trajectory. A format example such as "<action>look</action>" in the reasoning was executed instead of the final action, and upper-case tags were replaced with "look". Add extract_action(), which returns the last complete, case-insensitive <action>...</action> pair, and use it in both the projection and the rollout record.
Yiming Niu (neumyor)
force-pushed
the
fix/alfworld-action-parsing
branch
from
November 23, 2026 11:34
9c73224 to
3c3b2d1
Compare
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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
The ALFWorld projection took the first
<action>and the first</action>separately, while_extract_actionin the rollout used a case-sensitive regex. A</action>mentioned in the reasoning made the environment execute an empty action marked valid while the trajectory recorded the real one. A format example such as<action>look</action>in the reasoning was executed instead of the final action, and upper-case tags were replaced withlook.Changes
skillopt/envs/alfworld/actions.py: newextract_action()returns the last complete, case-insensitive<action>...</action>body (the body may not contain another<action>, as in the SearchQA evaluator), orNone. It has noalfworldimport.skillopt/envs/alfworld/vendor/alfworld_projection.py: usesextract_action(). Responses without an action and the existing<think>and Chinese-character validity rules are unchanged.skillopt/envs/alfworld/rollout.py:_extract_action()uses the same helper, so the recorded action is the executed one.CHANGELOG.md: entry under Fixed.Tests
tests/test_alfworld_action_parsing.py: the helper and_extract_actionon plain, closing-tag-in-reasoning, format-example, upper-case, multi-line and missing-tag responses; the projection executes the recorded action for the three cases from the issue and keeps its existing validity rules. The projection module is loaded from its file because the vendor package imports thealfworldsimulator, which CI does not install.The new tests fail on main (5 of 13) and pass with the fix. Full suite on macOS, Python 3.11: 2440 passed, 3 failed, 11 skipped, 4 xfailed. The 3 failures also fail on main on this machine and are unrelated:
test_backend_pi.py::test_default_model_from_envfindspion PATH, and twotest_sleep_adopt_skill_subset.pytests hit the macOS/tmpsymlink.ruff checkpasses on the changed files.Fixes #449