Commit Graph

9409 Commits

Author SHA1 Message Date
can1357 48766eb88a fix(tui): kept ProcessTerminal and window-title writes headless under the test runtime
- `ProcessTerminal` now captures a per-instance `#headless` from `isTerminalHeadless()` at construction and re-reads it in `start()`; when set, `#safeWrite`, `start`, `stop`, `drainInput`, and `setProgress` short-circuit, so frame paints, `start()` probes (OSC 11 / DA1 / kitty), the progress keepalive, stdin raw mode, SIGWINCH, and teardown escapes no longer reach a real terminal during `bun test` (previously `#safeWrite` only skipped on `!isTTY`, so an interactive terminal leaked stray boxes and probe queries).
- Gated the `emergencyTerminalRestore()` blind-restore branch and `TerminalInfo.sendNotification` on the headless flag, and guarded `setTerminalTitle`/`pushTerminalTitle`/`popTerminalTitle` in `title-generator.ts`.
- Opted the terminal-contract suites (terminal-appearance, notifications, emergency-restore-altscreen, issue-2034 write gate, process-terminal-render-harness, render-stress-harness) back into real I/O with `setTerminalHeadless(false)`, restoring on teardown.
- Added `process-terminal-headless.test.ts` asserting zero writes under a forced TTY when headless and real frame/probe output after opt-out.
2026-06-17 01:21:03 +02:00
can1357 dcd1836d51 feat(utils): added isTerminalHeadless/setTerminalHeadless terminal-suppression flag
- Added `isTerminalHeadless()` / `setTerminalHeadless()` to `env`, a process-wide switch that suppresses real-terminal side effects (stdout escape/frame writes, stdin raw mode, CSI/OSC probes, SIGWINCH, window-title changes, emergency restore).
- Defaulted the flag to `isBunTestRuntime()` so it engages when `bun test` sets `NODE_ENV=test`, and made `setTerminalHeadless` return the previous value so callers can restore exact prior state.
2026-06-17 01:20:37 +02:00
can1357 cdca5cf93d test(coding-agent): updated steer idle drain tests for queued streaming behavior
- Removed the obsolete non-resumable idle-steer test and updated comments to reflect immediate continue scheduling for idle steering.
- Added a real-timer streaming scenario with a mock model to verify queued image steering is surfaced through clearQueue as normalized text/images while the session is streaming.
2026-06-17 00:52:36 +02:00
roboomp d35d1c1883 fix(ai): loosened openai pattern property fallback
Rewrote unsupported lookaround patternProperties keys to a supported catch-all pattern instead of dropping their value schemas, preserving dynamic-key tool arguments when additionalProperties is false.

Extended sanitizer and Codex conversion regression coverage for the closed dynamic-key case.

Fixes #2784
2026-06-17 00:23:37 +02:00
can1357 e5975373c3 Merge remote-tracking branch 'origin/farm/cced21e6/hooks-pre-discovery' 2026-06-17 00:22:51 +02:00
can1357 84f8d127dc Merge remote-tracking branch 'origin/farm/41a13455/skip-empty-sessions' 2026-06-17 00:22:34 +02:00
can1357 ef5e5fd27c fix(coding-agent): fixed parked subagent restoration from persisted sessions
- Fixed cold revival flow so parked subagents are restored from persisted sessions at startup.
- Fixed session-init persistence to include spawns and readSummarize fields for replay accuracy.
- Fixed latest-session lookup by adding peekSessionInit for lock-free persisted contract access.
- Added lifecycle and session tests for cold-revive success, decline, and retry paths.
2026-06-17 00:21:20 +02:00
can1357 d6e390c1ca fix(coding-agent): reclaimed stranded advisor cards when interrupted runs settle
- Queued advisor concern cards now get reclaimed as visible advice during settle when auto-resume suppression is active and the session is idle.
- Preserve logic was narrowed to keep advisor cards hidden only during abort teardown, allowing steers during resumed streaming turns.
- A regression test was added to verify stranded advisor steers are persisted as visible advice without triggering an advisor-only resume turn.
2026-06-16 23:14:54 +02:00
can1357 1fa4f2eee8 fix(subagent-session-spawning): resolved subagent parent id propagation
- Forwarded `parentAgentId` through task and eval launch paths when spawning subagents.
- Mapped `parentAgentId` to `parentId` in `createAgentSession`.
- Passed each caller's session `getAgentId` (or `MAIN_AGENT_ID`) as the parent for spawned agents.
2026-06-16 23:03:54 +02:00
can1357 3225e6b4be fix(agent-hub-ui): corrected agent hub render flow in editorContainer
- Fixed Agent Hub display to render in editorContainer instead of floating ui overlay.
- Fixed close flow to clear editorContainer, re-add the editor, and restore editor focus.
- Updated Agent Hub activation tests and removed the probe test fixture.
2026-06-16 23:03:11 +02:00
roboomp e3f48b44bd fix(cli): preserved explicit session rewrites
Kept shutdown flushes lazy while allowing explicit atomic rewrites to materialize pre-assistant session entries.

Added regression coverage for rewriteEntries before the first assistant message.

Fixes #2800
2026-06-16 21:00:25 +00:00
can1357 3459371724 fix(coding-agent/advisor): fixed advisor concern/blocker notes being stranded after interrupts
- Added resolveAdvisorDeliveryChannel in advisor tooling to map each note to aside, steer, or preserve using severity, auto-resume suppression, core-streaming, and abort state.
- Updated AgentSession advice enqueuing to route concern/blocker notes through that resolver, preserving them only when the interrupted turn is idle or tearing down and steering them during active resumed turns.
- Added regression tests for resolveAdvisorDeliveryChannel covering nit versus interrupting severities across streaming, aborting, and suppression combinations.
2026-06-16 22:53:39 +02:00
can1357 d30bec5126 feat(tui): added stacked math rendering through latexToBlock
- Added latexToBlock module that renders stacked fraction math with baseline-aware rows.
- Updated markdown rendering to route display math through latexToBlock with sole-display handling.
- Exported latexToBlock from the package entrypoint and updated changelog docs accordingly.
- Added advisor resume and suppression repro tests in coding-agent for interrupted turn recovery.
2026-06-16 22:53:29 +02:00
roboomp 54e79162b4 fix(cli): skipped empty session persistence
Prevented shutdown flushes from materializing sessions that never produced assistant output, and kept close from marking a non-existent session file current.

Added regression coverage for opening omp and exiting before any prompt or assistant turn reaches history.

Fixes #2800
2026-06-16 20:50:51 +00:00
roboomp 205413860b fix(coding-agent): preserved hook disabled filters
Preserved Settings.disabledExtensions fallback when extension discovery is called without an explicit disabled list and kept hookCapability paths out of extension-module basename filtering.

Fixes #2796
2026-06-16 20:11:09 +00:00
can1357 bfe574443a feat(tui): added LaTeX color and display-math rendering support in TUI output
- Added own-line display-math tokenizers for `$$...$$` and `\[...]` markdown blocks.
- Added delimiter-free `\begin...\end` math parsing in text conversion with multiline row preservation.
- Added ANSI rendering for `\textcolor`, `\color`, `\colorbox`, and `\fcolorbox` with scoped color resets.
- Added tests for LaTeX color and math parsing edge cases, including inline code and nested scopes.
2026-06-16 22:09:32 +02:00
can1357 2d0b80ed51 Merge remote-tracking branch 'origin/farm/d563ece8/fix-always-ask-settings-focus' 2026-06-16 21:46:24 +02:00
can1357 0f013b455e feat: added LaTeX math rendering support for terminal and TUI outputs
- Added LaTeX math and Mermaid allowances in terminal and final-chat prompts.
- Added inline math tokenization in TUI for $, $$, \(\), and \[\].
- Added LaTeX-to-Unicode conversion helpers and exports for math rendering.
- Fixed inline math detection to skip escaped dollars and currency-like spans.
2026-06-16 21:45:10 +02:00
roboomp 20f78c4693 fix(coding-agent): loaded discovered hook factories
Included JS and TS hookCapability results in extension path discovery so hooks under hooks/pre and hooks/post bind to the extension runner without explicit settings entries.

Fixes #2796
2026-06-16 19:44:28 +00:00
can1357 508a9f543e feat: removed render_mermaid tool and added width-aware Mermaid clipping
- Removed render_mermaid from tool discovery, task definitions, and registries.
- Removed renderMermaid setting and prompt/docs references tied to the deleted tool.
- Added maxWidth and theme color options to Mermaid ASCII resolution in markdown flow.
- Re-rendered Mermaid ASCII in both directions and clipped output to available width.
2026-06-16 21:32:39 +02:00
roboomp 27f0b922c7 fix(tui): preserved overlay-owned prompt focus
Overlay roots can now declare nested focus targets they own so visible overlays keep their active child focused while background prompt focus steals remain blocked.

Updated the setup wizard to register scene prompt focus targets and covered the nested prompt path in the overlay focus regression test.

Fixes #2789
2026-06-16 19:06:18 +00:00
can1357 a61abf799f fix(ai): dropped stale keyed tool-call deltas after their item closed
- Tracked whether a Responses stream event carries an identifier (`output_index` or `item_id`) in `processResponsesStream` and dropped keyed argument deltas whose item already closed instead of routing them to another open call.
- Restricted the `lastOpenItem` singleton fallback to fully identifierless mock/proxy events so real parallel tool calls keep their own argument streams.
- Added a regression test asserting stale keyed deltas after item close are dropped rather than appended to a sibling call.
- Recorded the fix in the ai changelog.
2026-06-16 20:53:18 +02:00
can1357 712e859022 feat(coding-agent): restored the verbose /dump and /advisor dump raw output
- Rewrote `formatSessionDumpText` in `session-dump-format.ts` to emit the pre-16.x full dump: system-prompt prelude, model/thinking config, tool inventory with parameters, and the transcript as markdown role headings (`## User`, `## Assistant`, `### Tool Call`/`### Tool Result`), reusing `renderDelimitedThinking` for `<thinking>` blocks.
- Dropped the compact default and the `[raw]` flag from `/dump`: removed the `isRaw` parameter from `handleDumpCommand` in `command-controller.ts`, `interactive-mode.ts`, and `types.ts`, and removed the `inlineHint: "[raw]"`/`compact` plumbing in `builtin-registry.ts`.
- Updated the `formatSessionAsText` doc comment in `agent-session.ts` to describe the verbose dump shape.
- Removed the obsolete `formatSessionDumpText raw thinking` suite from `advisor.test.ts` and refreshed `session-dump-format.test.ts` to assert the verbose dump output.
- Recorded the revert in the coding-agent changelog and trimmed `/dump` from the compact transcript tool-intent-prefix entry.
2026-06-16 20:53:05 +02:00
can1357 30158c7002 feat(ai): exported renderDelimitedThinking from the dialect barrel
- Re-exported `renderDelimitedThinking` from `./dialect/rendering` through the `@oh-my-pi/pi-ai/dialect` barrel, keeping the remaining `rendering` primitives dialect-internal.
- Documented in `dialect/index.ts` why only this one `rendering` symbol is re-exported (the legacy markdown `/dump` reuses its `<thinking>` envelope unwrap).
- Added the `### Added` changelog entry recording the new export.
2026-06-16 20:52:40 +02:00
roboomp 354bb2dadf fix(tui): kept overlay focus above hidden prompts
Background approval prompts could steal TUI focus from visible overlays such as /settings, leaving keystrokes routed to a hidden surface.

Pinned the focused component to the top visible overlay and added a regression test for the always-ask approval focus path.

Fixes #2789
2026-06-16 18:39:27 +00:00
can1357 5bce7ed6df feat: added advisory transcript formatting and one-shot benchmark metrics
- Introduced advisory note output as `<advisory>` tags with optional severity and guidance.
- Updated session transcript formatting to `### Session update` and inline watched role labels.
- Added shared `escapeXmlText` utility and escaped XML-sensitive text in advisor outputs.
- Added one-shot success run token metrics and one-shot statistics reporting.
2026-06-16 18:34:50 +02:00
can1357 3c0c6daab8 Merge remote-tracking branch 'origin/farm/e27b29db/strip-openai-regex-lookaround' 2026-06-16 17:59:24 +02:00
can1357 9cb0b4b643 fix(coding-agent): fixed session magic-keyword ordering and stranded queue handling issues
- Fixed magic-keyword notices to preserve ordering in agent-session processing.
- Fixed stranded queue behavior during queued steer/skill delivery in session logic.
- Updated agent-session and input-controller tests covering suppression, keywords, and queues.
- Updated unreleased changelog notes describing the magic-keyword and queue fixes.
2026-06-16 17:59:15 +02:00
roboomp e4444a0fe7 fix(ai): normalized stripped openai schemas
Converted schema nodes emptied by OpenAI Responses lookaround stripping to boolean true so pattern-only nodes keep the existing empty-schema semantics.

Extended sanitizer and Codex regression coverage for pattern-only property and propertyNames schemas.

Fixes #2784
2026-06-16 15:54:50 +00:00
roboomp 965afbe377 fix(ai): stripped openai pattern property lookarounds
Dropped unsupported lookaround regex keys from OpenAI Responses patternProperties maps while preserving ordinary property names and supported regex keys.

Extended sanitizer and Codex tool conversion coverage for patternProperties.

Fixes #2784
2026-06-16 15:42:32 +00:00
roboomp a93a6c3908 fix(ai): stripped openai responses regex lookarounds
Removed JSON Schema pattern values containing regex lookaround from OpenAI Responses/Codex tool schemas so incompatible MCP tools do not poison the request.

Added schema-normalization and Codex conversion regression coverage for Figma-style fileKey patterns.

Fixes #2784
2026-06-16 15:24:54 +00:00
can1357 1e3909a151 fix(coding-agent/session): split queued-message editor restore between dequeue and interrupt
- Generalized `isUserQueuedMessage` to a user-attribution predicate (`role === "user"` or custom `attribution === "user"` and not display-suppressed) so visible agent-authored steers (advisor cards, IRC/extension asides) and hidden goal/plan/budget steers are all excluded from editor restore, not just advisor cards.
- Gave `AgentSession.clearQueue` a `{ forInterrupt }` option: plain Alt+Up dequeue restores user messages and preserves every other queued message for the continuing stream, while Esc+abort keeps only advisor cards (for `abort()`'s `#extractQueuedAdvisorCards` preservation) and drops other internal steers so the post-abort `#drainStrandedQueuedMessages` can't auto-resume the interrupted run.
- Threaded `forInterrupt: options?.abort` from `InputController.restoreQueuedMessagesToEditor` and kept `queuedMessageCount` on actual displayable-queue semantics so `hasPendingMessages()`/RPC and the empty-submit abort gate stay accurate.
- Updated skill-queue tests to cover both policies (hidden and visible agent-authored steers preserved on dequeue, dropped on interrupt) and refreshed the changelog entry.
2026-06-16 16:27:53 +02:00
can1357 6bbc573c6f fix(coding-agent/session): suppressed subagent breadcrumbs so --continue resumes the parent session
- Added a `suppressBreadcrumb` option to `SessionManager.open()` so headless opens skip writing the per-TTY `--continue` breadcrumb, and passed it from the subagent opens in `task/executor.ts` and the HTML export open in `export/html/index.ts`, which run in the parent's terminal and were clobbering the breadcrumb with their own artifact-dir session file.
- Added `resolveBreadcrumbToInteractiveRoot()` and applied it in `continueRecent()` so already-poisoned breadcrumbs pointing inside a parent's artifacts dir (`<parent>/<agentId>.jsonl`) resolve back up to the top-level interactive session.
- Added `subagent-breadcrumb.test.ts` covering both that a subagent open keeps `--continue` on the parent and that a stale subagent-pointing breadcrumb is recovered.
2026-06-16 16:05:50 +02:00
can1357 623e9d3710 fix(coding-agent/session): restricted queued-message editor restore to user-authored messages
- Added `isUserQueuedMessage()` to `agent-session.ts`, treating only plain user turns and visible `attribution: "user"` custom messages (e.g. `/skill`) as restorable, so advisor concern/blocker notes, hidden goal/plan/budget steers, and IRC/extension asides no longer leak into the editor on Esc/Alt+Up.
- Reworked `clearQueue()` to return only user-authored messages while re-queuing advisor cards via `replaceQueues()` (so the user-interrupt abort path still re-records them as advice) and dropping other agent-authored steers to prevent a silent auto-resume on leftover internal context.
- Filtered `getQueuedMessages()` chips and rewrote `popLastQueuedMessage()` to skip agent-authored cards and pull the last user-authored entry, while `queuedMessageCount` still counts all displayable queued work.
- Extended `input-controller-skill-queue.test.ts` with a `queueAdvisorSteer` helper and cases asserting advisor/IRC cards count as pending work but stay out of chips, restore, and `popLastQueuedMessage`, and survive `clearQueue()`.
2026-06-16 16:05:36 +02:00
can1357 bbb41a3c93 fix(coding-agent/modes): started orphaned idle submits as real prompts instead of steering them
- Changed `InputController`'s no-input-waiter submit path to call `session.prompt(text, { streamingBehavior: "steer", images })` instead of `session.steer(text, images)`, so a submission made while the loop is idle between turns starts a real prompt rather than queueing behind a non-resumable transcript; the steer streaming behavior still preserves queueing if a background turn races in.
- Updated the failure-recovery comment to reference prompt dispatch rejection.
- Rewrote `input-controller-orphan-submit.test.ts` to assert the `prompt` dispatch path and added a real-session case proving an orphaned idle submit starts via `agent.prompt` (not `continue`) and leaves no queued messages.
- Added the `### Fixed` CHANGELOG block under `[Unreleased]`; its three entries are adjacent lines forming one indivisible run, so this commit also carries the changelog text for the queued-restore and breadcrumb fixes that follow.
2026-06-16 16:05:23 +02:00
can1357 dc14689fc1 chore: bump version to 16.0.2 2026-06-16 15:33:47 +02:00
roboomp 3e1c51b4f4 fix(ai): classified ollama context-fill errors
Recognized the empty Ollama finish_reason:length guidance as context overflow so coding-agent promotion and compaction recovery still run after surfacing the actionable error.

Added overflow utility coverage for the Ollama prompt-filled-context wording.
2026-06-16 15:33:26 +02:00
can1357 97a8c2186b fix(coding-agent/session): excluded streaming-edit guard aborts from reasonless retry
- Updated #isRetryableReasonlessAbort to reject reasonless aborts when the streaming-edit guard flag is set.
- This prevented routing those aborts through retry logic and avoided prompt hangs or unintended guard bypasses during edit-stream recovery.
2026-06-16 15:32:59 +02:00
can1357 fba72680ed chore: update changelogs 2026-06-16 15:22:43 +02:00
can1357 71783191e4 Merge remote-tracking branch 'origin/farm/5abeafc4/surface-empty-length-completions' 2026-06-16 15:22:24 +02:00
can1357 5d875e9574 Merge PR #2753: fix(agent): retry subagent model fallback chains
Install a subagent's ordered model candidates as child-session retry fallback chains so a retryable provider failure advances to the next candidate instead of killing the worker (issue #2750).
2026-06-16 15:22:16 +02:00
can1357 f2d0c15a57 Merge remote-tracking branch 'origin/farm/88228f42/omit-gemini-auto-toolconfig' 2026-06-16 15:22:01 +02:00
roboomp 57bd545b39 fix(ai): omitted google auto tool config
Stopped serializing explicit AUTO toolConfig for Google Gemini toolChoice auto so Gemini defaults apply without triggering upstream planning JSON leaks.\n\nAdded a regression test for auto toolChoice while preserving explicit ANY and named-tool routing.\n\nFixes #2776
2026-06-16 13:13:27 +00:00
roboomp dc92a561eb fix(ai): preserved non-ollama length recovery
Scoped empty finish_reason:length error conversion to Ollama so other OpenAI-compatible providers keep the length stop used by coding-agent incomplete-output recovery.

Added regression coverage for empty non-Ollama length completions.
2026-06-16 13:12:59 +00:00
roboomp 5401e6ec73 fix(ai): surfaced empty ollama length completions
Mapped empty Ollama OpenAI-compatible finish_reason:length completions to a provider error with actionable num_ctx guidance instead of a silent length stop.

Added regression coverage for the empty length stream path and recorded the package-local checks.

Fixes #2774
2026-06-16 12:57:15 +00:00
can1357 a31fbf0683 Merge PR #2710: fix(providers): preserve OpenRouter upstream routing
Preserve OpenRouter @upstream routing (issue #2708). Includes review fix 6b6e9aaffc: gate the @upstream fuzzy bypass to aggregator providers, fixing a non-aggregator Vertex @default regression.
2026-06-16 14:53:40 +02:00
can1357 3aea0bfb38 Merge PR #2714: fix(plugins): resolve directory extension manifest entries one level deep
Resolve directory extension manifest entries one level deep with manifest-first precedence (issue #2713). Supersedes #2723.
2026-06-16 14:53:39 +02:00
can1357 10a9d4734c Merge PR #2722: test(plugins): isolate discovery test from real ~/.omp on all platforms
Isolate the plugin-discovery test from the real ~/.omp on all platforms via an os.homedir mock, cleared XDG vars, and a pre-write guard (issue #2721). Supersedes #2724 (Windows-only).
2026-06-16 14:53:39 +02:00
can1357 0cc4b5f9a7 Merge PR #2698: fix(ai): unwrap Anthropic thinking envelopes
Preserve signed thinking bytes when unwrapping Anthropic thinking envelopes. Residual over the already-landed core (commit 7936ea2ac3) that fixes a still-live signed-whitespace P1 in main (issue #2695).
2026-06-16 14:53:39 +02:00
can1357 89d4dfae46 Merge PR #2751: fix(providers): handle Umans Kimi output caps and web search
Clamp Umans Kimi output caps, forward the gateway web-search header on per-request options, and escape builtin tool names for Umans. NOTE: bundle regen pulled incidental, benign models.dev drift.
2026-06-16 14:53:39 +02:00