Repository navigation
fix(editor): echo live session-trial content from GET /api/config/content (#97) - #106
Merged
Merged
Conversation
…tent GET /content returned an empty body for session-trial configs, so an editor reopened after Apply showed an empty document instead of the in-memory configuration the user had just applied (issue #97). The server parsed /load-content payloads into state and discarded the raw YAML -- there was nothing to echo back. - ServerState gains trial_content: the stored raw text of the current trial; cleared by every disk-anchoring path (_apply_config_from_disk, /reload) since a trial belongs to no real file. - /load-content stores the payload verbatim; /content echoes it with session_trial=True and config_path=None (contract shape unchanged). - The pre-existing drop-pinning test now also pins the echoed text, and a new test pins the disk-anchor clearing. Closes #97
This was referenced Nov 4, 2026
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.
Closes #97 (sub-issue of the config editor #95).
Problem
Edit the file in the Config Editor → Apply → close → reopen: the editor showed an empty document with "session trial (not anchored to disk)" instead of the configuration just applied. Root cause:
GET /api/config/contentreturnedcontent: ""for any session-trial config because/load-content(the Apply path) parsed the YAML into state and discarded the raw text.Fix
ServerStategainstrial_content: str | None— the stored raw YAML of the current trial, cleared by every disk-anchoring path (_apply_config_from_disk,/reload), since a trial belongs to no real file./load-contentstores the payload verbatim;/contentechoes it withsession_trial=Trueandconfig_path=None. Response contract shape unchanged — only the previously-emptycontentbecomes meaningful./save,/save-as,/load,/create,/reloadbehavior untouched (trial text dropped when the session anchors to disk).TDD evidence
'' != 'defaults:…'— the missing behavior, watched before implementation.uv run pytest tests/server/routes/test_config_editor.py→ 24 passed.tests/test_app.py/tests/web/test_build.py/ suffix-parity debt); failure sets diff as identical, so this change adds zero new failures.ruff format --check✓ ·ruff check✓ ·pylint10.00/10 on both touched modules · pre-commit hooks passed.Notes for reviewers
/contentreturns; the load-on-open path is covered by existing vitest (open/load cases).filenamefor a trial remains the config display name ("Dropped"), per the pre-existing pinning test.