Fix LMTerminal streaming and preserve config reads#6
Open
sderev wants to merge 2 commits into
Open
Conversation
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* Fall back to plain flushed writes when `rich.Live` cannot refresh streamed output. * Force per-chunk rich redraws with `live.update(..., refresh=True)` in refreshable terminals. * Use model-aware streamed `reasoning_effort`: keep `minimal` for `gpt-5`/`gpt-5-mini`/`gpt-5-nano`, use `low` for `gpt-5.1`/`gpt-5.2`, and skip it for `gpt-5-chat-latest`. * Add regression tests for terminal streaming behavior and GPT-5-family streamed request args. * Update changelog fragments for both streaming fixes. Summary: This keeps streamed output visible across terminal types and avoids streamed GPT-5-family request failures while preserving low-latency token delivery where supported. Co-authored-by: AI <ai@sderev.com>
* Keep `load_config()` read-only and fail-soft for missing, invalid, or non-object JSON. * Return default markdown theme values in getters without writing to disk. * Add regression tests for malformed and missing `config.json` scenarios. * Add a changelog fragment for the user-facing bug fix. Summary: This prevents theme reads from overwriting `~/.config/lmt/config.json` during normal usage. Co-authored-by: AI <ai@sderev.com>
e9a5b63 to
13f6bf4
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.
What changed
reasoning_effortfor thegpt-5*family: keepminimalforgpt-5/gpt-5-mini/gpt-5-nano, uselowforgpt-5.1/gpt-5.2, and omit the argument forgpt-5-chat-latest.rich.Livesurface and fall back to plain flushed chunk writes.auto_refresh=Falseandlive.update(..., refresh=True)in refreshable terminals.~/.config/lmt/config.jsonduring theme reads; malformed or missing config now falls back to defaults without modifying disk state.Why
gpt-5.1andgpt-5.2reject streamedreasoning_effort="minimal", whilegpt-5-chat-latestrejectsreasoning_effortentirely.~/.config/lmt/config.jsonwhen the file was malformed or missing.How to test
uv run pytest -q tests/lib_test.py tests/gpt_integration_test.pygateuv run lmt prompt "count from 1 to 10"and confirm visible output starts before full completion.uv run lmt prompt --raw "count from 1 to 10"and confirm raw chunks appear progressively.TERM=dumb uv run lmt prompt "count from 1 to 10"and confirm output still streams progressively.--model gpt-5.1and--model gpt-5-chat-latestand confirm noreasoning_effortrequest errors.~/.config/lmt/config.json, runuv run lmt prompt --no-stream "hello", and confirm LMTerminal falls back to defaults without rewriting the file.Risk/comp notes
lmterminal/gpt_integration.pyandlmterminal/lib.py.reasoning_effortvalues.config.json.Changelog fragment