Addresses Copilot + Codex review on #2521:
- computeEditorMaxHeight returned 1 on terminals too small to host both the
editor and the chrome reserve, but the bordered editor never renders fewer
than 3 rows (2 border + 1 content). The cap now floors at that real minimum
(EDITOR_MIN_RENDERED_ROWS) so it no longer misreports the rows the editor
occupies; rendering is unchanged, and the contract is documented honestly
(reserve holds once terminalRows >= 7).
- #resolveOverlayLayout now always resolves maxHeight (?? availHeight), so the
maxHeight !== undefined branch in effectiveHeight, the composite slice guard,
and the number | undefined return type were dead. Tightened all three.
- Mirrored the maxHeight-default contract in the render stress oracle
(resolveExpectedOverlayLayout + compositeExpectedOverlays) so the randomized
sweep validates the real clipped geometry instead of the obsolete unclipped
one; updated the oracle helper test expectation accordingly.
Editor-height tests rewritten to assert the real contract (reserve when the
terminal can host both; pinned to the bordered minimum below that).
Two bounded TUI overlap fixes:
- Editor max-height (coding-agent): the [6,18] clamp's floor of 6 exceeded
available space on terminals <=18 rows, letting the editor crowd the
transcript/status. Extracted a pure computeEditorMaxHeight(rows) with an
EDITOR_MIN_CHROME_ROWS=4 upper bound; identical for rows >=18.
- Overlay overflow (tui): #resolveOverlayLayout left maxHeight undefined when
the option was unset, so a tall overlay's bottom rows were dropped
off-screen. maxHeight now defaults to availHeight so every overlay is
sliced to fit and re-clamps on resize.
- Added tail-only transcript rendering via `renderViewportTail`, stopping at `maxRows` and returning `EMPTY_TAIL`.
- Added `ViewportTailProvider`/`asViewportTailProvider` API and resize getters for viewport state.
- Implemented viewport-only painting during non-mux resize with deferred full repaint after settle.
- Added settle-resize helpers and coverage for deferred repaint timing and cancel paths.
- Queued steering now drains after session settlement, so aborted auto-continued turns no longer leave queued messages stranded.
- Resumable-state detection now treats tool-result messages as resumable so continue can process queued steering after an interrupted tool execution.
- Regression tests were added for queued steer draining after abort and after an interrupted tool result.
- Added a reusable notice constant for executable write operations.
- Appended the executable notice to write-result output whenever a file was made executable.
InteractiveMode.refreshSlashCommandState() built the autocomplete
provider from builtins, hook/custom/skill commands, and file-based
slash commands but never read session.promptTemplates, so templates
loaded from cwd/.omp/prompts/ and the agent prompts directory expanded
when typed manually yet never appeared in the / picker. Pass them
through alongside file commands; filter out templates whose names
collide with an existing command so the picker mirrors the runtime
expansion order (expandSlashCommand precedes expandPromptTemplate in
AgentSession.prompt).
Added a regression test that constructs InteractiveMode with a session
that carries a prompt template, spies on editor.setAutocompleteProvider,
and asserts the captured provider returns the template for both the
empty / menu and a fuzzy /rev prefix, plus the collision-dedup contract
against the builtin /exit.
Fixes#2462
Bare `omp --list-models` (or any other stale/typoed --flag) was silently
consumed by `parseArgs` and the agent went on to start a real session,
connect to the configured MCP servers, and hang waiting on the model.
Any positional after the unknown flag was reinterpreted as the initial
prompt, so a documentation drift turned into an unintended LLM invocation.
`parseArgs` now tracks flag-shaped tokens that did not match any built-in
or extension-registered flag in a new `unrecognizedFlags: string[]` field,
and `reportUnrecognizedFlags` prints a clean `Error: unknown flag(s): …`
line plus the `--help` hint. `runRootCommand` invokes the helper right
after the post-extension reparse and `process.exit(2)`s before any
session, MCP, or initial-message work runs.
The validation is gated on the extension-aware reparse, so extension
flags (`--spawn-peer`, `--headless`, `--plan`, …) still pass through
the same way `applyExtensionFlags` already handles them. `-` (stdin
marker) and `--` (POSIX separator) are deliberately allowed through.
Fixes#2459
- docs/models.md: retitled the '/model and --list-models' section and
updated the bullet to describe 'omp models' plus 'omp models canonical'.
- docs/providers.md: updated the troubleshooting note to validate
models.yml with 'omp models' (and 'omp models find <substr>').
- packages/coding-agent/CHANGELOG.md: noted the doc fix under Unreleased.
Fixes#2458
- Refactored status-line context caching to be keyed by message, tail, and window.
- Updated context usage flow to pass breakdown tokens and expose null usage when unknown.
- Adjusted context percentage handling so zero or unknown windows yield nullable values.
- Expanded status-line cache tests for usage provenance, memoization, and invalidation.
- Reworked createAbortableStream to forward abort signals to the source stream reader.
- Added cleanup logic so abort/cancel/error paths release locks and emit AbortError consistently.
- Updated related tests to verify source-stream cancellation and handoff escape-handler behavior.
- Extended gateway stream control to pass abort signals and onCancel into encodeStream.
- Added optional cancellation control parameters to provider encodeStream handlers.
- Stopped provider stream loops on cancellation and suppressed SSE completion/error output after abort.
- Added a regression test verifying reader.cancel triggers onCancel and aborts upstream request.
- Added cmux browser mode options and resolved mode selection from env and app flags.
- Added cmux tab operations for navigation, JS execution, observations, and screenshots.
- Added CMUX socket client messaging with auth, timeouts, and ordered request dispatch.
- Updated browser docs and examples to describe cmux behavior, selectors, and API limits.
- Replaced queued-message interrupt flow with session abort calls on empty submit and escape.
- Removed interrupting state and notifyInterrupting teardown paths from abort handling.
- Updated AgentSession queue operations to use shared steering and follow-up queue views.
- Propagated isAborting through session state and collab payloads to suppress late updates.
- Added a credential-picker `/logout` flow for selecting one OAuth account.
- Added optional `/logout` provider argument and unknown-provider error handling.
- Changed logout handling to delete only the chosen credential and keep others.
- Added AuthStorage APIs to list and remove credentials by id, with remote deletion hook.
Stopped goal objective commands from resolving the interactive input waiter while the agent is already streaming. The goal context still uses steer immediately, and the next idle goal continuation submits the objective work without AgentBusyError spam.
Added goal-mode integration coverage for both initial and replacement objective commands during streaming.
Fixes#2454
- Added shared Google empty-stream retry constants and reused them in CLI.
- Replaced local content checks with hasMeaningfulGoogleContent for retry gating.
- Refactored streamGoogleGenAI to bound empty STOP retries with state reset and reopen.
- Moved stream start emission before retry loops to avoid duplicate start events.
- Replaced async getApiKey probing with modelRegistry.hasConfiguredAuth during session model restore and fallback selection.
- Removed the per-provider key cache and avoided startup getApiKey/network work by checking configured auth synchronously.
- Deferred real key retrieval to the request-time resolver while preserving existing model selection flow.
- Filtered dot-only or blank thinking blocks so they no longer render as assistant thought.
- Adjusted assistant-message and streaming-reveal logic to use visible-thinking helpers for consistency.
- Coalesced concurrent interruptAndFlushQueuedMessages() calls through one in-flight promise.
- Replaced continue()-retry logic with agent.prompt() to flush queued messages from empty contexts.
- Skipped queued-message flush replay while compacting or streaming to avoid turn overlap.
- Updated flush path to consume queued steering first, then follow-ups, via dequeuing helper.
- Added a regression test for empty-state interrupt-and-flush delivering queued steers safely.
- Added getActiveModel support to session/tool interfaces for propagating active model objects.
- Added model capability helpers to flag WebP-unfriendly Ollama backends for image resize options.
- Updated image normalization and loading to auto-disable/reencode WebP when model constraints require it.
- Coalesced repeated interrupt-and-flush calls into one queued-steer resume flow.
- Retried queued continues on AgentBusyError after waitForIdle up to a 30s timeout.
- Handled queue-flush failures in input controllers with warning logs and TUI error display.
- Applied a finite 64,000-token fallback for OpenAI completion requests when model maxTokens is unavailable.
- Refactored stream max-token computation to use a shared helper and preserve a finite cap when caller and model limits are null.
- Added regression coverage for null maxTokens flows and bumped the model-cache schema to invalidate entries using retired unknown-limit sentinels.
- Updated AgentSession.setModel and setModelTemporary to validate credentials with hasConfiguredAuth instead of eagerly resolving API keys.
- Changed ModelRegistry.hasConfiguredAuth to probe configured credentials without executing command-backed key programs or refreshing OAuth tokens.
- Added model switch auth tests that verify resolver calls were removed and unconfigured models are rejected synchronously.
- Replaced unknown model contextWindow/maxTokens sentinels with nullable values across types and catalog data.
- Mapped request token calculations to treat null maxTokens as unlimited output caps.
- Updated remote compaction and context checks to ignore unknown limits by using Infinity/0 fallbacks.
- Adjusted CLI/model registry flows to skip cap enforcement for null limits and render unknown values as '-'.
- Added `omp models` command with `ls`, `find`, `canonical`, and `refresh` actions.
- Removed top-level `--list-models` parsing from CLI args, launch, and main command flow.
- Implemented action-driven model listing with provider filtering, extension loading, and `--json` output.
- Updated unknown provider/model errors and tests to direct users to `omp models` guidance.
- InputController now acknowledged empty-submit interrupts before flushing queued steering or queued-abort paths to preserve interrupting feedback.
- EventController now recreated the loading animation on interrupt acknowledgement and deferred end-of-turn teardown while queued resume recovery was still arming.
- AgentSession exposed an isResumingQueuedMessages phase around interruptAndFlushQueuedMessages so stale agent_end events no longer tear down the loader prematurely.
- Short-circuited agent-end handling when a session was still streaming.
- Skipped turn-teardown steps for superseded agent_end events that arrived out of order.
beautiful-mermaid@1.1.3 measures label width in UTF-16 code units, but
terminals render East Asian characters (Hangul/CJK/kana) and emoji 2
columns wide, so fenced mermaid blocks in assistant messages and
render_mermaid tool output had misaligned box borders for non-Latin
labels (upstream: lukilabs/beautiful-mermaid#119, #122).
Adds a patchedDependencies entry rebuilding the ASCII renderer to
measure terminal display columns: grapheme-cluster segmentation
(Intl.Segmenter), wcwidth-style policy (East Asian Wide + emoji
presentation + ZWJ/VS16/flag sequences = 2 columns; text-presentation
symbols like the renderer's own arrowheads stay narrow), and atomic
wide-glyph cell pairs so label collisions cannot shift row widths.
The patch modifies only existing files (bun cannot patch in new files,
and the exports "bun" condition loads src/ directly, so both src and
dist are patched). It mirrors the upstream PR and should be dropped
once the fix ships in a beautiful-mermaid release; a new CJK alignment
regression test keeps that transition honest.
Verified: bun test packages/coding-agent/test/modes/components/
assistant-message-mermaid.test.ts (8 pass, incl. new display-column
alignment regression test); bun test packages/utils (154 pass); Korean
flowchart renders with uniform display-column row widths through the
patched package.
- Replaced Azure and OpenAI provider calls with `postOpenAIStream` flow.
- Fixed stream error handling by retaining status, headers, and body on failures.
- Fixed stream parsing by handling raw JSON SSE frames and `[DONE]` events.
- Added `OpenAIHttpError` with parsed messages and timeout-aware retry behavior.
- Added remote-compaction tests for timeout, abort, and 500-fallback behavior.
- InputController now dispatched Esc to active viewSession operations, aborting compaction, handoff, and retry directly.
- Removed competing onEscape handler swaps across command and event controllers so overlapping auto/manual flow events no longer overwrote cancellation callbacks.
- Compaction now propagated fetch options and rethrew aborted signals so cancellations were not treated as remote failures.
- Switched extensibility loader imports from namespace-style `zod` imports to named `z` imports in `zod/v4`.
- Updated extensibility type interfaces to use `typeof z` for injected `zod` modules in hook, extension, tool, and command APIs.
- Removed `userMessageId` from `AcpAgent` prompt state and response payloads.
- Removed `models` from new/load/resume/fork session responses and deleted model-state building.
- Removed `unstable_setSessionModel` and routed model changes through `setSessionConfigOption`.
Fell back to the PowerShell clipboard bridge when the native Windows clipboard reader reports no image, preserving Ctrl+V image paste in PowerShell terminals.\n\nFixes #2429