Commit Graph

6046 Commits

Author SHA1 Message Date
metaphorics a95be2860f fix(tui): honest editor-height floor and dead-branch cleanup
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).
2026-06-14 08:40:12 +09:00
metaphorics b28ad9a1dc fix(tui): clamp editor height and overlays on small terminals
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.
2026-06-14 06:59:58 +09:00
can1357 eac1d21f93 chore: bump version to 15.12.5 2026-06-13 21:51:43 +02:00
can1357 2bbf995a1d feat(tui): added viewport-only transcript tail rendering and deferred resize repaint
- 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.
2026-06-13 21:27:36 +02:00
can1357 f9a8aa1d96 fix(coding-agent): fixed queued steering drain after aborted and interrupted tool turns
- 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.
2026-06-13 21:25:48 +02:00
can1357 dc50969c15 ux(coding-agent/tools): added executable notices to write tool output
- Added a reusable notice constant for executable write operations.
- Appended the executable notice to write-result output whenever a file was made executable.
2026-06-13 21:20:06 +02:00
can1357 d528bb34ab Merge remote-tracking branch 'origin/farm/71308c81/prompt-templates-in-slash-autocomplete' 2026-06-13 20:58:36 +02:00
can1357 0e28a148ea Merge remote-tracking branch 'origin/farm/874ccbad/cli-reject-unknown-flags' 2026-06-13 20:58:11 +02:00
roboomp 4f001d381c fix(coding-agent): surfaced prompt templates in slash-command autocomplete
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
2026-06-13 18:00:44 +00:00
roboomp 54a4ca81f9 fix(cli): reject unknown --flags instead of starting an agent
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
2026-06-13 17:46:45 +00:00
roboomp c1a8ff1a81 docs: replaced --list-models references with the omp models subcommand
- 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
2026-06-13 17:33:29 +00:00
can1357 15b5c1397f chore: bump version to 15.12.4 2026-06-13 18:04:39 +02:00
can1357 5bd330522b chore: fix changelogs 2026-06-13 18:04:19 +02:00
can1357 2c9e61cfd1 Merge remote-tracking branch 'origin/farm/17ca1d16/defer-goal-objective-while-streaming' 2026-06-13 18:03:49 +02:00
can1357 6d534a3c54 fix(agent): corrected agent event listener errors to structured warnings
- Replaced `Agent` listener error reporting with structured `logger.warn` calls.
2026-06-13 18:03:39 +02:00
can1357 495d49f588 refactor(coding-agent): reorganized status-line context cache usage flow
- 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.
2026-06-13 18:02:08 +02:00
can1357 b0ff8d5f83 fix(coding-agent): patched ACP event crash on missing assistant content
- Guarded partial assistant message access to prevent crashes when content is undefined.
2026-06-13 18:02:08 +02:00
can1357 b75c7dd5f2 fix(utils): added abort propagation to createAbortableStream
- 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.
2026-06-13 17:56:02 +02:00
can1357 60a46f37db fix(ai): fixed SSE cancellation to stop upstream requests on client stream cancel
- 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.
2026-06-13 17:53:53 +02:00
can1357 746f521868 feat(coding-agent-browser-cmux-tooling): added cmux browser mode support
- 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.
2026-06-13 17:35:56 +02:00
can1357 705750453d fix(coding-agent-turn-interrupt/queue-ux): resolved steering abort state
- 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.
2026-06-13 17:31:25 +02:00
can1357 3def4a6979 feat(coding-agent-logout/auth-ux): enabled selective OAuth account logout
- 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.
2026-06-13 17:31:18 +02:00
roboomp 34a5362adf style: bun run fix 2026-06-13 15:07:00 +00:00
roboomp 1292bd5fd6 fix(cli): deferred goal objective while streaming
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
2026-06-13 15:06:51 +00:00
can1357 ef126fd0f6 fix(ai): fixed Google empty STOP retries to emit a single stream start event
- 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.
2026-06-13 16:58:04 +02:00
can1357 bb2c018db9 fix(coding-agent): switched startup model checks to configured auth validation
- 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.
2026-06-13 16:52:23 +02:00
can1357 82d3502897 wip: fsync 2026-06-13 16:48:41 +02:00
can1357 e30c642126 fix: corrected assistant render and reveal logic to skip blank thinking
- 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.
2026-06-13 16:26:51 +02:00
can1357 92fba8d486 fix: addressed model-aware image handling for tool image WebP filtering
- Added model-aware session image normalization by passing active model.
- Propagated model-derived WebP exclusion into browser snapshot capture and resizing.
- Applied model-derived WebP exclusion to eval, fetch, read, and inspect image paths.
2026-06-13 16:17:56 +02:00
can1357 d4d89fadb9 fix: resolved queued-message flush flow by coalescing in-flight calls
- 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.
2026-06-13 16:17:56 +02:00
can1357 e1e11e5256 feat: added model-aware image handling for session tools and webp
- 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.
2026-06-13 16:17:56 +02:00
can1357 39efdfe91b fix(coding-agent): coalesced queued steer flushes to avoid AgentBusyError interrupt races
- 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.
2026-06-13 15:52:25 +02:00
can1357 69051241f1 fix(ai): added finite output-token fallback when model maxTokens is unknown
- 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.
2026-06-13 15:52:06 +02:00
can1357 b7b201ae48 fix(coding-agent): avoided blocking auth resolution during model switches
- 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.
2026-06-13 15:39:04 +02:00
can1357 f0c6a54f51 fix: handled unknown model limits as null to avoid artificial token caps
- 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 '-'.
2026-06-13 15:35:40 +02:00
can1357 9dcaf1ae6b feat(cli): added omp models command and replaced --list-models listing flow
- 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.
2026-06-13 15:00:25 +02:00
can1357 21a839fdce fix(coding-agent): preserved working loader during interrupt-queued resumption
- 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.
2026-06-13 14:52:40 +02:00
can1357 a2e63c70b0 feat(coding-agent): enabled discovered MCP server auth and namespaced reauth targets
- Allowed colon-separated MCP server names in validation and updated validation errors.
- Added discovery-aware MCP config resolution for /mcp auth, test, and unauth flows.
- Changed streaming behavior so superseded agent_end events don't stop active loaders.
2026-06-13 14:31:33 +02:00
can1357 bcabe9c4be fix(coding-agent/modes): skipped interrupted agent_end teardown during active streaming
- 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.
2026-06-13 14:21:06 +02:00
chan1103 4b136b0710 fix: align Mermaid ASCII box borders for CJK/emoji labels
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.
2026-06-13 16:44:17 +09:00
can1357 6e8a56e24e fix(deps): migrated OpenAI providers to wire-based streaming and removed SDK dependency
- 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.
2026-06-13 00:43:24 +02:00
can1357 f573e17e21 fix(coding-agent/modes): fixed Esc handling for compaction, handoff, and retry cancellation
- 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.
2026-06-13 00:33:07 +02:00
can1357 95ec4f8bcb refactor(packages/coding-agent): migrated named zod imports and types
- 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.
2026-06-13 00:24:45 +02:00
can1357 5691a039de refactor(packages/coding-agent): restructured acp 0.25 session state
- 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`.
2026-06-13 00:20:05 +02:00
can1357 db573f713e fix(packages/coding-agent): resolved empty-stop retry handling regression
- Excluded assistant "thinking" content from non-empty stop detection in #isEmptyAssistantStop().
- Replaced the empty-stop retry prompt with the <system-injection> wrapper.
- Updated empty-stop reminder detection to accept <system-injection> messages.
- Added regression coverage for thinking-only stop retries to prevent skipped assistant output.
2026-06-13 00:20:05 +02:00
can1357 f33c7392fd Merge remote-tracking branch 'origin/farm/76b4d961/mnemopi-stable-bank-id' 2026-06-13 00:06:07 +02:00
can1357 f34610b1ee Merge remote-tracking branch 'origin/farm/428ce54a/sqlite-busy-recovery-during-concurrent-s' 2026-06-13 00:05:51 +02:00
can1357 c6f83c489f Merge remote-tracking branch 'origin/farm/4e128dc2/windows-image-attachment' 2026-06-13 00:03:59 +02:00
can1357 64aa558e62 chore: consistency 2026-06-13 00:03:27 +02:00
roboomp d718d54a33 fix(coding-agent): restored windows image paste fallback
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
2026-06-12 21:52:59 +00:00