Skip to content

Commit 2c7a94c

Browse files
authored
refactor(tui): prompt deep-module PR 1 — frame snapshot + height budgets (#218)
* chore(tasks): record delegation-lane and verification lessons * docs: prohibit deferring applicable fixes * test(tui): characterize prompt compatibility contract * docs(tui): design content rendering standardization * docs(tui): plan content rendering standardization * refactor(tui): snapshot prompt delegates once per frame * fix(tui): keep prompt scenes within terminal height Add prompting/renderer.py with PromptSceneBudget and a priority-ordered row allocator (modal > input > footer > pinned > body > status > shortcuts). Rendering is unchanged for scenes that fit; on overflow the scene is clipped tail-first per priority, pinned allocation is zero-safe, and the interactive preview no longer derives a competing body budget. * test(tui): cover mid-turn terminal shrink in PTY layout e2e Resize the live PTY through heights 12/8/6/4 during a running turn and assert the redrawn frame stays within the new geometry, never fossilizes the input card, and the turn still completes after the size is restored. * chore(tasks): record codex-lane operating contract lessons * fix(tui): refresh shell-mode footer budget and strengthen resize assertion Shell-mode rendering never set _prompt_footer_row_budget, so _fit_toolbar_to_terminal clipped the bottom toolbar against a stale agent-mode value (or the initial 0, hiding the footer entirely in a pure shell session). Refresh it every shell render. Replace a trivially-true pyte row-count assertion in the resize e2e with a width-overflow check. * fix(tui): refresh shell-mode update-notice frame snapshot The per-frame _prompt_frame_update_notice snapshot was refreshed only by the agent render path and never cleared with the frame, so shell frames suppressed a live update notice (initial None) or replayed a stale agent-mode notice after a mode switch. Refresh the snapshot in the shell render like the agent path and reset it in _clear_prompt_frame. * test(tui): cover after-render update-notice snapshot cleanup Extract the after_render frame-clear closure into a named _clear_prompt_frame_snapshot method so the lifecycle cleanup is directly testable, and assert a completed frame leaves _prompt_frame_update_notice as None.
1 parent b5cfe09 commit 2c7a94c

15 files changed

Lines changed: 2477 additions & 132 deletions

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ contract and C01–C15 tripwires below; ship the matching tests and verification
4141
`uv run ...` or `uv run --directory <package> ...`.
4242
- **Keep changes surgical.** Do not perform drive-by refactors, formatting churn, dependency
4343
upgrades, or generated-file rewrites unless the task requires them.
44+
- **Never propose deferring an applicable issue or fix.** If a problem is real and a fix applies,
45+
do the fix now — even when it requires a redesign or significantly more work. "Defer",
46+
"follow-up later", "out of scope for now", and equivalents are prohibited recommendations; the
47+
only permitted alternative to fixing immediately is stopping to request expanded scope, then
48+
fixing.
4449
- **Do not expose secrets or PII.** Never print, commit, or copy API keys, OAuth tokens, session
4550
data, user config, or logs that may contain credentials.
4651
- **Do not add new telemetry, hosted endpoints, external services, or third-party dependencies**

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ GitHub Releases page; `0.8.0` is the new starting line.
1515

1616
## Unreleased
1717

18+
- Freeze the public shell prompt compatibility contract with constructor and rendering coverage.
1819
- Add xAI Grok OAuth login (browser loopback and device-code).
1920
- Add GitHub Copilot device-code OAuth login for individual github.com accounts.
2021
- Add DigitalOcean Gradient AI browser OAuth login with dynamically discovered Inference Routers; router-discovery failures (unauthorized, outage, malformed, empty) are now reported distinctly instead of silently yielding no models.
@@ -24,6 +25,7 @@ GitHub Releases page; `0.8.0` is the new starting line.
2425
- Fix queued follow-up input showing a bordered ghost; pressing Enter during an active turn now shows one intentional queued row.
2526
- Harden provider OAuth credential handling: scope token refresh to the active/selected provider, serialize persistence under a lock with atomic config replacement, roll back replaced credentials when a save fails, fail closed on credential migration, and validate OAuth token and implicit-state responses.
2627
- Fix an intermittent doubled/"ghost" copy of the running-prompt block (agent tree, spinner, and tip) on long streaming turns: after a scrollback handoff the suppressed live body now waits for the terminal's re-requested absolute cursor position to settle before it re-expands, so it repaints against a correct cursor model instead of the mis-anchored frame left behind by `run_in_terminal`.
28+
- Fix the "update available" footer notice being suppressed on shell-mode frames (and a stale agent-mode notice replaying after a mode switch): the shell prompt render now refreshes the per-frame update-notice snapshot like the agent path, and the snapshot is cleared with the frame.
2729

2830
## 0.60.0 (2026-07-18)
2931

0 commit comments

Comments
 (0)