Commit Graph

11430 Commits

Author SHA1 Message Date
roboomp 7ec00a5007 fix(edit): skipped notebook bom sniffing
Skipped binary BOM detection for notebook-backed hashline reads so virtual cell text is serialized without a leading U+FEFF marker.
2026-06-30 05:58:01 +00:00
roboomp dd4eb68b37 style: bun run fix 2026-06-30 05:52:02 +00:00
roboomp d1e412eeff Revert "style: bun run fix"
This reverts commit 45d2bf8641.
2026-06-30 05:51:53 +00:00
roboomp 45d2bf8641 style: bun run fix 2026-06-30 05:49:41 +00:00
roboomp d7c6472824 fix(edit): preserved hashline utf-8 bom
Added binary BOM detection to the hashline patcher and filesystem adapters so edits restore BOM bytes when text decoding hides U+FEFF.

Fixes #3867
2026-06-30 05:48:37 +00:00
can1357 38250ce88b chore: bump version to 16.2.7 2026-06-30 07:20:23 +02:00
can1357 09061ed801 feat(coding-agent/web): aligned duckduckgo search requests with native browser behavior
- Updated the default browser User-Agent string to emulate a modern version of Chrome.
- Added typical browser headers to the outgoing fetch request, including Sec-Ch-Ua, Sec-Fetch flags, and Referer.
- Added a blank "b" parameter to the form body to match native DuckDuckGo HTML search behavior.
2026-06-30 07:02:12 +02:00
can1357 467f46b190 perf(scripts/session-stats): added composite index on tool call timestamp and name
- Added a composite index `ss_tc_ts_tool` on the `timestamp` and `tool_name` columns of the `ss_tool_calls` table to optimize query performance.
2026-06-30 07:01:32 +02:00
can1357 b704ac698a chore: update changelogs 2026-06-30 06:55:13 +02:00
can1357 38d40122f9 Merge remote-tracking branch 'origin/farm/8e0a06a8/fix-buffered-double-esc-and-task-end-loader' 2026-06-30 06:43:10 +02:00
can1357 093660f8b7 fix(ai): restricted reasoning context all_turns option to openai models v5.4 and newer
- Guarded the `all_turns` reasoning context value to OpenAI models version 5.4 or greater.
- Suppressed `reasoning.context` defaults and explicit overrides when `all_turns` is requested on unsupported models to prevent server rejection.
- Introduced `supportsAllTurnsReasoningContext` helper in `@oh-my-pi/pi-catalog/identity` using semver classification.
- Updated request-transformer and response-options logic to conditionalize the request payload shaping.
- Expanded test coverage to verify correct fallback behavior and explicit overrides across gpt-5.x versions.
2026-06-30 06:42:46 +02:00
can1357 bebdd22e64 fix(ai): healed leaked reasoning fences live for every provider
- Added `leaked-thinking-stream.ts` whose `wrapLeakedThinkingStream`/`LeakedThinkingProjector` re-projects any provider stream, splitting leaked ```thinking`/`<think>` fences out of the visible-text channel into structured thinking blocks live while preserving text/thinking/tool signatures.
- Wrapped the shared `withProviderInFlightLimit` dispatch (both the unlimited and queued paths) and the standalone GitLab Duo path in `stream.ts` so healing covers every provider exit idempotently.
- Reworked `google-gemini-cli.ts` visible-text emission onto `StreamMarkupHealing` with `feedVisibleText`/`flushVisibleText` and explicit block bookkeeping, lifting leaked Gemini fences ahead of native tool calls.
- Added `leaked-thinking-stream` coverage and a gemini-cli healing case, and updated `stream-auth-retry`/`google-gemini-cli-alignment` expectations for the healed event sequence and dropped empty-text residue.
- Recorded the changelog `### Fixed` entry (whose run also carries the adjacent Codex `all_turns` line).
2026-06-30 06:38:25 +02:00
can1357 d01bf079ef feat(ai): added google interactions api transport
- Added `google-interactions.ts` streaming the Gemini Interactions API (model-mode steps, thought/tool/text deltas, usage, `previous_interaction_id` lineage) shared by the direct Google and Vertex providers.
- Routed `streamGoogle` and `streamGoogleVertex` through `resolveInteractionDispatch`, defaulting Gemini 3+ onto Interactions (official endpoint for direct Google, bearer/ADC for Vertex) with transparent `:streamGenerateContent` fallback and a `useInteractionsApi: false` opt-out.
- Added explicit Vertex bearer support in `google-auth.ts` via `GOOGLE_CLOUD_ACCESS_TOKEN`/`CLOUDSDK_AUTH_ACCESS_TOKEN` plus a `hasVertexBearerCredentialsHint` probe gating the auto-default.
- Added `useInteractionsApi`/`storeInteraction`/`previousInteractionId` to `StreamOptions` and `GoogleSharedStreamOptions`, threading them through `mapOptionsForApi`.
- Added `google-interactions` coverage and pinned the existing generateContent assertions with `useInteractionsApi: false`.
2026-06-30 06:37:04 +02:00
can1357 b87110c66b fix(ai): preferred explicit env api key over stored static key
- Reordered `AuthStorage.getApiKey` and its async session variant to resolve stored OAuth, then an env var, then a stored static api_key — so an explicit `GEMINI_API_KEY`-style env var now wins over a stale broker-migrated key.
- Reworked `getCredentialOrigin` and `getApiKeySource` to mirror that precedence via a `describeStored` helper, reporting `oauth`/`env`/`api_key` in the new order.
- Updated `auth-storage-api-key-login` to neutralize ambient env keys with a `getEnvApiKey` spy, and `auth-storage-credential-origin` to assert OAuth outranks api_key and env outranks a stored api_key.
2026-06-30 06:34:07 +02:00
can1357 4e2acd3605 Merge remote-tracking branch 'origin/farm/699d8722/fix-resume-subagent-compaction-crash' 2026-06-30 06:33:54 +02:00
can1357 a8381f4945 Merge remote-tracking branch 'origin/farm/f4507d84/cerebras-gemma-vision' 2026-06-30 06:33:47 +02:00
roboomp c2d6c8cf18 fix(tui): deliver buffered double-Esc as two events and re-arm loader after task completion
StdinBuffer held a bare `\x1b\x1b` chunk and timer-flushed it as one
sequence. `parseKey("\x1b\x1b")` returns undefined, so CustomEditor
fell through to the base editor and never fired the configured `onEscape` —
the double-escape gesture and the second-press single-Esc handler both went
dead whenever the terminal batched the two presses into one stdin read.

Split an exact bare `\x1b\x1b` into two ESC events only after the
flush window proves no follower arrived. If a follower does arrive, emit the
first ESC and restart parsing at the second ESC so legacy Alt chords
(`\x1bd`, `\x1b\x7f`) remain one downstream keypress. Meta-CSI/SS3
chords (`\x1b\x1b[A`, `\x1b\x1bO…`) still emit as one combined
sequence.

EventController.tool_execution_update re-armed the working loader when a
transient overlay (auto-compaction / auto-retry / handoff) had torn it down
mid-tool; tool_execution_end did not. A subagent (`task`) call only fires
_end, so a task result landing after such an overlay left the UI looking
idle even though the session was still streaming. Mirror the reconciler
call in #handleToolExecutionEnd.

Fixes #3857
2026-06-30 04:30:42 +00:00
roboomp 7871591b4a fix(coding-agent): restored working loader after subagent ends inside overlay window
`tool_execution_end` for a long-running tool (`task` subagent, async bash
poll, …) is the next streaming event on the parent session when an inner
transient overlay (auto-snapcompact, auto-context-full, auto-retry) nulled the
working loader between the tool's start and end. The overlay-end handlers are
the only loader restorers keyed off the missing reference; if the subagent's
`tool_execution_end` lands while the overlay is still active (or its end
handler errored before re-arming), the spinner stays gone for the rest of the
parent turn even though the agent keeps streaming.

`#handleToolExecutionEnd` now calls `#ensureWorkingLoaderWhileStreaming()`
at the top, mirroring `tool_execution_update` so the working loader survives
a subagent completing inside the overlay window.

Refs #3858
2026-06-30 04:09:20 +00:00
roboomp 64734021a7 fix(tui): deliver buffered double-Esc as two events and re-arm loader after task completion
StdinBuffer held a bare `\x1b\x1b` chunk (or emitted it as one when followed by
a non-CSI byte). `parseKey("\x1b\x1b")` returns undefined, so CustomEditor
fell through to the base editor and never fired the configured `onEscape` —
the double-escape gesture and the second-press single-Esc handler both went
dead whenever the terminal batched the two presses into one stdin read.

Split a bare `\x1b\x1b` into two ESC events at the buffer layer, mirroring
the existing split for ESC + SGR mouse report. Meta-CSI/SS3 chords
(`\x1b\x1b[A`, `\x1b\x1bO…`) still emit as one combined sequence.

EventController.tool_execution_update re-armed the working loader when a
transient overlay (auto-compaction / auto-retry / handoff) had torn it down
mid-tool; tool_execution_end did not. A subagent (`task`) call only fires
_end, so a task result landing after such an overlay left the UI looking
idle even though the session was still streaming. Mirror the reconciler
call in #handleToolExecutionEnd.

Fixes #3857
2026-06-30 03:41:24 +00:00
roboomp be8c2c86a8 style: bun run fix 2026-06-30 02:48:25 +00:00
roboomp 2b944114fb fix(catalog): marked cerebras gemma vision capable
Mapped Cerebras gemma-4-31b dynamic discovery to include image input capability and covered the OpenAI Chat Completions image_url serialization path.

Fixes #3854
2026-06-30 02:48:08 +00:00
can1357 6b64ed0ff6 feat(ai/providers): added global fallback for regional vertex endpoints
- Introduce `fallbackUrl` to allow retrying requests on the global Vertex endpoint when a 404 is encountered on a regional endpoint.
- Correctly track tool call names to facilitate accurate function response mapping.
- Update `serviceTier` type definitions to accurately reflect allowed values.
- Refine vertex endpoint location resolution to ensure better compatibility with ambient regional settings.
2026-06-30 04:48:01 +02:00
can1357 f18368d1f7 Merge remote-tracking branch 'origin/farm/5ff08fcf/fix-kimi-title-thinking' 2026-06-30 04:46:18 +02:00
roboomp 7cab14d963 fix(catalog): gated kimi K2.7 Code thinking-required policy on native Moonshot/Kimi-code host
Reviewer flagged that the omit/forced-tool gate matched every public id, regressing Fireworks and OpenRouter Kimi K2.7 Code (non-zai dialects).

Added Fireworks + OpenRouter regression coverage.
2026-06-30 02:30:40 +00:00
roboomp fa2e3a807f style: bun run fix 2026-06-30 02:26:10 +00:00
can1357 d20e6c0829 feat: migrated service tier settings to a per-model-family architecture
- Migrated global service tier settings to a per-model-family architecture (OpenAI, Anthropic, Google).
- Implemented `ServiceTierByFamily` mapping to allow independent configuration and resolution per provider.
- Added automatic migration logic for legacy service tier and fast-mode application settings.
- Updated telemetry, session management, and task execution to support provider-specific tier resolution.
2026-06-30 04:14:48 +02:00
roboomp 1db1e9e200 fix(catalog): omitted disabled thinking for kimi code
Kimi K2.7 Code rejects disabled thinking on native Kimi endpoints, so route caller disable requests through the omit mode and let the model default to required thinking.

Added regression coverage for the title-generator-style Kimi Code request, Moonshot K2.7 Code variants, and K2.6's still-supported disabled-thinking path.

Fixes #3852
2026-06-30 02:12:51 +00:00
can1357 5c695e9e42 Merge remote-tracking branch 'origin/farm/11d4e46a/bound-gpu-probe' 2026-06-30 03:35:35 +02:00
can1357 d4be774eb2 chore: update stale tests 2026-06-30 03:35:30 +02:00
roboomp 0ae9734708 fix(prompting): kept gpu probe output when descendants delay eof
On a probe that exits 0 with valid output but leaves a descendant holding stdout open, the bounded drain previously discarded the captured bytes and cached { gpu: null }. Use the already-captured stdout when the probe itself succeeded; only treat a non-zero/timeout exit as a failure.
2026-06-30 01:34:11 +00:00
can1357 531b4d1e8f chore: normalized merged changelog headings 2026-06-30 03:09:32 +02:00
roboomp 328e22c079 fix(prompting): bounded stdout drain on successful probes
Even on exit 0 the GPU probe can leave a descendant holding stdout open. Race the EOF wait against a 250ms grace window so the success path cancels the reader instead of blocking until the descendant exits, and unref the prep deadline timer so a one-shot CLI is not held alive by it once all prep work returns.
2026-06-30 01:09:26 +00:00
can1357 5c382e6b7e fix(coding-agent): formatted and type-fixed tiny-model download test
Reflow biome wrap and replace delete on non-optional isTTY with
Reflect.deleteProperty in #3840's text-failure test.
2026-06-30 03:06:06 +02:00
can1357 8cd23ebd15 merge #3844: 3-way dirty-context fallback for isolated branch merges
# Conflicts:
#	packages/coding-agent/src/task/worktree.ts
#	packages/coding-agent/test/task/worktree.test.ts
2026-06-30 03:03:43 +02:00
can1357 9038488cb0 merge #3845: preserve agent commit history across isolated branch merges 2026-06-30 03:01:02 +02:00
can1357 ce20cfb68e merge #3829: align /extensions MCP status with /mcp list and persist re-enable 2026-06-30 03:01:01 +02:00
can1357 e750485a38 merge #3840: surface tiny-model download errors instead of bare false 2026-06-30 03:01:01 +02:00
can1357 15917fbfec merge #3838: bound GPU probe so wedged lspci/wmic cannot hang prompt prep 2026-06-30 03:01:01 +02:00
can1357 ea6d9f32c4 merge #3836: surface pending IRC asides in inbox without double-injecting 2026-06-30 03:01:01 +02:00
can1357 5f4af63e30 merge #3847: skip rebuilding previous session context on different-session switch 2026-06-30 03:01:01 +02:00
can1357 e8090bb48a feat: introduced binary file detection to prevent encoding corruption
- Introduced `isProbablyBinary` utility to sniff file headers for NUL bytes or invalid UTF-8 sequences.
- Updated `ReadTool` to use the binary sniffer, preventing mojibake corruption in output when reading non-text files.
- Refined `file-mentions` auto-reads to skip binary files and mark them as `binary` in the message transcript.
- Added comprehensive unit tests for binary detection logic, covering NUL bytes, truncated multibyte characters, and path-based file sniffing.
2026-06-30 02:59:41 +02:00
roboomp b5737a8448 fix(prompting): stopped waiting on timed-out gpu stdout
Stopped the GPU probe from awaiting stdout EOF after the probe process exits non-zero, which can hang when a wrapper leaves descendants holding stdout open. The regression now covers a killed wrapper with an inherited stdout holder and verifies the scenario process exits before the deadline.
2026-06-30 00:59:29 +00:00
can1357 a7efaf4a53 test(cli): cover tiny model text download errors 2026-06-30 02:52:57 +02:00
can1357 242705c06c feat: enabled dynamic font rendering with CJK and unicode support
- Added Silver.ttf TrueType font support to `pi-natives` with automated fallback logic for bitmap font rendering.
- Implemented wide code point detection and cell-width calculation to improve CJK character handling and layout.
- Introduced dynamic font-aware preflight probing via `resolveShapeForText` and `renderabilityProbeText` for better font selection.
- Enabled semantic emoji folding and improved text normalization to handle non-Latin characters and emoji filtering.
2026-06-30 02:49:31 +02:00
roboomp d8bf76dfd6 fix(coding-agent): skipped rebuilding previous session display context on different-session switch
AgentSession.switchSession() eagerly called buildDisplaySessionContext()
before setSessionFile, walking the previous session's branch and expanding
every compaction entry's snapcompact archive and openaiRemoteCompaction
replacementHistory into messages. For huge pre-fix sessions that materialized
GBs of data and OOMed in-TUI /resume even after the streaming loader fix.

The snapshot is only needed for same-session reloads, where
#didSessionMessagesChange compares the pre/post message arrays to detect
rollback edits. Different-session switches skip the call entirely; the
error-recovery path rebuilds the previous context on demand from the
restored state so MCP-selection restoration still has its inputs.

Added a regression test (test/agent-session-switch-prev-context.test.ts)
that spies on sessionManager.buildSessionContext across switchSession and
asserts the expected call count and target file per branch.

Fixes #3846
2026-06-30 00:34:02 +00:00
roboomp d120ba6b7d fix(coding-agent): filter baseline wip from preserved agent commits
Dirty isolated baselines can be accidentally committed by subagents that run git add -A. Fetching the raw isolation HEAD then cherry-picking the range would replay that baseline WIP into parent history.

Add a dirty-baseline replay path that rewrites each agent commit against the captured baseline tree, preserving the agent commit message and author while excluding staged, unstaged, and untracked changes that existed before isolation started. Clean baselines still use the raw git fetch path, and nested-only changes keep returning patches without creating an empty root branch.

Add a regression for baseline staged + untracked WIP committed by the agent, asserting the task branch contains only the agent file and parent WIP remains staged/untracked after merge.

Fixes #3842
2026-06-30 00:28:27 +00:00
roboomp da715aae7c fix(coding-agent): preserve agent commits across isolated branch merges
When an isolated task agent commits its own changes before yielding, the
harness used to collapse the captured delta into one AI-summarized commit
and discard the agent's commit messages and authorship entirely. This
violated commit discipline for agentic swarms — multiple logical commits
("fix bug" + "add test") became a single opaque commit, and the
agent's commit object (which lived in isolation/.git/objects under
overlayfs/rcopy) was lost when cleanupIsolation tore down the overlay.

commitToBranch now detects when isolation HEAD moved past baseline.root
.headCommit. When it has, the function git-fetches the agent's HEAD into
the parent repo as omp/task/${taskId} so the commit objects survive
cleanupIsolation, and stamps the captured baselineSha onto the returned
CommitToBranchResult. mergeTaskBranches cherry-picks the inclusive range
baseSha..branchName when baseSha is provided, replaying each agent
commit verbatim with its original message and author. Any uncommitted
leftover (staged, unstaged, untracked) on top of the agent's last commit
becomes one trailing AI-summarized commit on the same branch.

Falls back to the legacy single-commit path when the agent never moved
HEAD (purely dirty working tree); existing patch-mode flow is untouched.

Fixes #3842
2026-06-30 00:13:07 +00:00
roboomp 4b98211c64 fix(coding-agent): fixed dirty isolated branch merges
Applied isolated branch patches with three-way fallback when unrelated parent dirt appears in patch context.

Surfaced branch preparation failures instead of reporting no changes.

Fixes #3841
2026-06-30 00:09:34 +00:00
roboomp fd070bf3aa fix(prompting): killed gpu probe with sigkill on timeout
Bun.spawn defaults killSignal to SIGTERM, which a wedged lspci/wmic (or its PATH wrapper) can ignore, leaving the probe alive past the prep deadline and blocking the null-cache write. Force SIGKILL so proc.exited always resolves at the deadline and the next startup hits the cache.
2026-06-29 23:33:46 +00:00
roboomp f5be8953c4 fix(cli): surfaced tiny model download errors
Preserved worker-side download errors through TinyTitleClient and included them in tiny-models text and JSON failures.

Fixes #3839
2026-06-29 22:56:40 +00:00