Skip to content

Comments

Prevent text generation process from overwriting quest's description and game's objective.#240

Merged
MarcCote merged 2 commits intomicrosoft:masterfrom
MarcCote:fix_239
Jun 11, 2020
Merged

Prevent text generation process from overwriting quest's description and game's objective.#240
MarcCote merged 2 commits intomicrosoft:masterfrom
MarcCote:fix_239

Conversation

@MarcCote
Copy link
Contributor

This PR addresses #239

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2020

Codecov Report

Merging #240 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #240      +/-   ##
==========================================
+ Coverage   82.84%   82.86%   +0.01%     
==========================================
  Files          56       56              
  Lines        6944     6951       +7     
==========================================
+ Hits         5753     5760       +7     
  Misses       1191     1191              
Impacted Files Coverage Δ
textworld/generator/game.py 94.56% <100.00%> (+0.03%) ⬆️
textworld/generator/maker.py 79.69% <100.00%> (+0.10%) ⬆️
textworld/generator/text_generation.py 84.28% <100.00%> (+0.04%) ⬆️

@MarcCote MarcCote merged commit 02b37ae into microsoft:master Jun 11, 2020
@MarcCote MarcCote deleted the fix_239 branch June 11, 2020 01:45
gregyoto added a commit to gregyoto/TextWorld that referenced this pull request Feb 8, 2026
…exist

PR microsoft#240 (fixing microsoft#239) added code to preserve a manually-set objective
across build() calls. However, the preservation happens before
change_grammar() is called, which unconditionally overwrites the
objective via describe_event(). This means the fix only worked for
games without quests (no winning policy = no describe_event call).

The fix: only auto-generate the objective in change_grammar() if one
hasn't already been set (self._objective is None).

Fixes microsoft#373

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants