Repository navigation
Remove unsafe logger persistence and escape viewer history - #385
Merged
Marc-Alexandre Côté (MarcCote) merged 3 commits intoOct 30, 2026
Conversation
Escape game text before building history HTML, render the objective fallback as text, and avoid redundant bootstrap entity decoding. Cover bootstrap, SSE, reload, and fallback in the browser regression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b4613e3-b8f1-4431-b118-4e2908961eed
Remove save/load and the pickle dependency while retaining statistics collection and reporting. This intentionally removes public persistence methods with no production callers in the repository. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b4613e3-b8f1-4431-b118-4e2908961eed
The SSE renderer can replace the objective node between Selenium lookup and text retrieval. Retry that transient stale reference while preserving the exact text assertion and timeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b4613e3-b8f1-4431-b118-4e2908961eed
Marc-Alexandre Côté (MarcCote)
merged commit Oct 30, 2026
223756a
into
microsoft:main
9 checks passed
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
GameLogger.save()andGameLogger.load(), eliminating the unrestricted pickle-loading API and its unusedpickleimport.GameLoggerand its statistics collection, aggregation, and reporting unchanged. The repository's production caller,tw-stats, uses only those statistics operations..text(); and remove redundant bootstrap entity decoding.Compatibility
Intentional public-API removal: downstream callers of
GameLogger.save()orGameLogger.load()must stop using these methods. Within this repository, the only persistence caller was the round-trip test; it now verifies statistics generation instead. No replacement serialization format or legacy fallback is introduced.The viewer retains its HTML history payload, paragraphs, CSS, line breaks, and trusted banner formatting. No renderer redesign or new dependency is introduced.
Validation
Using the existing
.venv:python -m pytest -q textworld/generator/tests/test_logger.py: 1 passed.python -m pytest -q textworld/envs/wrappers/tests/test_viewer.py: 1 passed, using a real headless browser.node --check textworld/render/tmpl/static/js/visualization.js: passed.GameLogger.save()/load()call sites remain and that the public statistics methods remain available.