Commit Graph

279 Commits

Author SHA1 Message Date
can1357 3efebf8805 fix: harden merged provider, agent-loop, eager, and autolearn paths
- agent-loop: raise repetition-detection floor to 180 chars and clear thinking
  replay anchors when collapsing a detected loop.
- providers/google: ignore empty text parts, retain terminal thoughtSignatures,
  and stop function-call signatures clobbering the prior block.
- autolearn: capture goal-mode at the turn boundary; harden managed-skill writes
  against hard-links/symlinks (O_NOFOLLOW + nlink); refuse minting managed skills
  whose name an authored skill already claims.
- eager tasks: thread agentKind through the session so a custom top-level agentId
  still gets always-mode delegation; split Eager Tasks prompt into hard vs soft.
- title-generator: race the online title model against a local tiny-model fallback.
- eager-todo: keep the soft reminder aligned with the todo init schema.
- mcp/stdio: keep close() detaching the read loop instead of awaiting it.
- stream loop: fix collapsing and tool-call thought-signature handling.
2026-06-14 17:09:59 +02:00
can1357 2b94fa8c71 Merge PR #2549: fix(agent-loop): detect repetition loops during assistant stream and abort gracefully 2026-06-14 17:09:41 +02:00
can1357 b830f7912b feat: unified speech setup and introduced local STT/TTS capabilities
- Added unified `omp setup speech` flow with JSON/check modes and model picker.
- Added local STT pipeline with sherpa workers, recorder/download flow, and streaming inference.
- Added local TTS pipeline with `omp say`, backend selection, and streaming vocalization.
- Replaced legacy speech settings with unified `speech`/`speechgen` configuration keys.
2026-06-14 16:07:44 +02:00
usr_bin_roygbiv bddfd478ac fix(coding-agent/utils): remove extra closing brace in title-generator 2026-06-14 00:35:04 -05:00
can1357 6c616ca847 fix: fixed OpenAI promotion linking for namespaced gpt-5.5 variants
- Updated OpenAI context promotion linking to resolve target models by parsed version and provider/API match instead of fixed bare ids.
- Scanned available siblings to select the plainest matching gpt-5.4 fallback so namespaced, dotted, and dated 5.5 variants promote correctly.
- Adjusted the TUI render stress shadow writer to ignore alternate-screen regions and replay only normal-screen bytes after exits.
2026-06-14 07:14:11 +02:00
roboomp f5d54e4acd fix(providers): downgraded forced tool choice for kimi
Added OpenAI-compatible compat metadata for endpoints that allow tools but reject forced tool_choice. OpenCode Go kimi-k2.7-code now downgrades resolve-gate forcing to auto tool selection while preserving thinking-mode request state.\n\nFixes #2546
2026-06-14 03:41:00 +00:00
can1357 17ba881c5a feat(coding-agent/utils): added title marker fallback for non-forced tool-choice models
- Added new system prompts that ask models to emit titles inside `<title>` markers when forced tool calls are unavailable.
- Updated `generateTitleOnline` to use marker-based prompting and disable required `set_title` tool calls for models that do not support forced tool choice.
- Adjusted title parsing to extract the `<title>...</title>` value and fall back to stripped marker text when wrapping tags are incomplete.
2026-06-14 01:32:47 +02:00
can1357 9a26a945a7 fix: dropped unavailable forced toolChoice and added runtime fallback recovery
- Validated queued toolChoice against active tools in agent and coding-agent sessions.
- Rejected queued forced choices with reason "unavailable" when selected tools were inactive.
- Dropped provider toolChoice payloads when requested function tools were not offered.
- Probed Tokio worker-thread support and fell back to current-thread runtime creation.
2026-06-14 01:32:47 +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 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
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
Can Bölük ed92eb8ff6 Merge pull request #2248 from chan1103/feat/smart-paste-text-fallback
feat(coding-agent): fall back to text paste when clipboard holds no image
2026-06-12 04:24:29 +02:00
Can Bölük 5a2a33658a Merge pull request #2256 from H4vC/accent-colors
session accent: derive from theme mode with collision avoidance
2026-06-12 02:36:45 +02:00
can1357 9629842f33 feat(coding-agent): accepted a model directly in ModelRegistry.resolver 2026-06-12 02:33:46 +02:00
can1357 edbdda6fbd fix(git): disable tag following during pushes
Programmatic `git push` operations should not follow annotated tags configured by a user's `push.followTags = true`. This setting can lead to push failures if the remote rejects tag creation (e.g., in PR-head forks), even if the branch update itself is valid.

Adding `--no-follow-tags` explicitly overrides this user setting, ensuring only the specified refspec is pushed and preventing rejections.
2026-06-11 21:05:26 +02:00
Brit 0160d0dbf2 session accent: derive from theme mode with collision avoidance
- Dark themes: warm hues (0-120), Light themes: cool hues (180-300)
- Collision check against 17 major theme colors with 10° threshold,
  clamped to the hue band so it never drifts into an unrelated range
- Hex values stored at construction instead of round-tripping through
  ANSI escape parsing (removes #ansiToHex)
- WCAG AA contrast bisection on light surfaces
- Per-session uniqueness via name hash within the hue band
2026-06-10 14:12:07 +02:00
HugoAir Dev f1dc1e9d76 fix(coding-agent): route native win32 clipboard text reads through the shared PowerShell bridge
Self-review follow-up to 5cd9c01: the smart-paste fallback promotes
readTextFromClipboard's win32 branch to a primary path, and the legacy
execSync Get-Clipboard shell-out there had the same two defects the
review flagged on the WSL branch — it blocks the event loop and, worse,
reads through the console codepage so non-ASCII clipboard text arrives
mangled on non-UTF-8 Windows locales. Native win32 now shares
readTextViaPowerShell (UTF-8-forced, -Raw, async, CRLF-normalized).
2026-06-10 18:08:16 +09:00
HugoAir Dev 5cd9c016d1 fix(coding-agent): spawn the WSL text clipboard read async and route the text fallback by focus
Address review notes on #2248:

- readTextFromClipboard's WSL branch now mirrors readImageViaPowerShell
  (Bun.spawn + kill timer sharing POWERSHELL_TIMEOUT_MS) instead of
  execSync, so a cold powershell.exe start cannot block the TUI event
  loop on the first smart-paste miss.
- The smart-paste text fallback routes through ui.getFocused() +
  hasPasteText like the enhanced-paste text path, so the payload lands
  in focused modal Input prompts instead of the hidden main editor
  (#2127 contract). Covered by a new routing test.
2026-06-10 17:59:57 +09:00
HugoAir Dev 765b972a00 feat(coding-agent): fall back to text paste when clipboard holds no image
app.clipboard.pasteImage dead-ended with a status message when the
clipboard held text, which made the chord useless on hosts that only
deliver that one keypress (VS Code's integrated terminal forwarding
Ctrl+V, Windows clipboard history via Win+V simulating Ctrl+V).

- handleImagePaste now pastes clipboard text through the editor's
  paste semantics when no image is available; an empty clipboard
  reports 'Clipboard is empty'.
- readTextFromClipboard reaches the Windows clipboard through host
  PowerShell under WSL (mirroring readImageFromClipboard), with CRLF
  normalization and UTF-8 output encoding.
- handleClipboardTextRawPaste's empty-clipboard status message moved
  to the actual empty branch (was shown after successful pastes).
- Clipboard reads are constructor-injectable for tests.

Implements proposal 1 of #1628.
2026-06-10 17:46:46 +09:00
can1357 10c979ca05 fix(coding-agent): detect reftable refStorage values with format suffixes 2026-06-10 09:51:48 +02:00
can1357 f75ee75905 fix(coding-agent): return the checkout root from primaryRoot for non-worktree repos 2026-06-10 09:51:48 +02:00
can1357 7205289ece Merge pull request #2201: feat(coding-agent): add title system prompt override 2026-06-10 08:32:10 +02:00
can1357 5e7640c237 Revert "Merge pull request #2076: fix(coding-agent): prefer daemonizing CLI clipboards over arboard on Linux"
This reverts commit b3ed88d398, reversing
changes made to 26c6326f52.
2026-06-10 08:31:32 +02:00
Adryel Dearo ecbc2a3c15 feat(coding-agent): add configurable title system prompt for sessions
- add discovery of `TITLE_SYSTEM.md` and pass it through interactive startup context
- route custom title prompts to online and local tiny title generators via protocol
- update session-title docs and changelog with override behavior
- add tests for prompt discovery, forwarding, and fallback to bundled title prompts
2026-06-10 08:31:32 +02:00
can1357 9001ab3732 Merge pull request #2233: fix(hindsight): share project tag across git worktrees 2026-06-10 08:27:00 +02:00
can1357 62ad6e73ae Merge pull request #2200: fix(ai): rotate antigravity credentials on Individual quota reached 429s 2026-06-10 08:26:59 +02:00
can1357 b3ed88d398 Merge pull request #2076: fix(coding-agent): prefer daemonizing CLI clipboards over arboard on Linux 2026-06-10 08:26:57 +02:00
roboomp d4ce2a00cb fix(coding-agent): prefer daemonizing CLI tools over arboard for Linux clipboard
The native arboard backend cannot retain X11 / Wayland selection ownership
after the calling process exits, and for short-lived napi calls it can drop
ownership before any consumer sees the selection — leaving the clipboard
empty even though set_text returned success. tmux + QTerminal made this
visible because OSC 52 is also dropped by libqtermwidget, so both backends
fail and the UI's 'Copied to clipboard' status reads as a lie.

utils/clipboard.ts now:
- Tries wl-copy / xclip / xsel before arboard on Linux. These CLIs fork
  after reading stdin and serve the selection until another app claims it,
  so the payload survives our process exit.
- Honors OMP_CLIPBOARD_COMMAND as a shell-string escape hatch (e.g.
  `xclip -selection clipboard -in -silent`).
- Logs a single warning when every backend fails, so the silent-success
  regression from #2075 cannot recur unnoticed.

Tests assert dispatch order: Linux+X11 prefers xclip, Wayland prefers
wl-copy, xclip→xsel fallback works, all-fail falls back to native,
macOS still goes straight to native, and OMP_CLIPBOARD_COMMAND wins
over the CLI chain.

Fixes #2075
2026-06-10 08:26:05 +02:00
roboomp 901fa4c013 fix(hindsight): share tags for bare worktrees
Bare-repository worktrees resolve their git common dir to the bare repo
itself (for example /repos/foo.git), not to a directory literally named
.git. The first fix only collapsed non-bare linked worktrees, so bare
worktree layouts still fell back to each individual worktree root.

Return the shared commonDir for bare repositories from both
repo.primaryRoot and repo.primaryRootSync, update project-label docs,
and cover two worktrees attached to one bare repository in the
hindsight bank regression test.

Fixes #2232
2026-06-10 08:26:01 +02:00
Matt Anger 91ff632d6a feat(coding-agent): verify HEAD before resolving reftable HEAD commit 2026-06-10 08:26:01 +02:00
Matt Anger b5b6424e7a feat(coding-agent): strip comments before matching section headers in git config 2026-06-10 08:26:01 +02:00
Matt Anger 4943d8d639 feat(coding-agent): use git rev-parse --verify when resolving reftable refs 2026-06-10 08:26:01 +02:00
Matt Anger c99751ac43 feat(coding-agent): strip adjacent git config comments 2026-06-10 08:26:01 +02:00
roboomp 29b2b51203 fix(hindsight): share project tag across git worktrees
Per-project-tagged scoping derived projectLabel() from
path.basename(cwd), so linked git worktrees of one repo landed retains
under distinct project:<basename> tags and recall (recallTagsMatch:
"any") missed cross-worktree memories.

- utils/git.ts: add sync sibling primaryRootSync to git.repo, walking
  .git + commondir with sync file reads (no subprocess), returning null
  outside a repo. Mirrors the async primaryRoot resolution.
- hindsight/bank.ts: projectLabel() resolves the primary checkout root
  via primaryRootSync and basenames that; falls back to the cwd
  basename when outside a repo. Sync only, so computeBankScope keeps
  its sync API and the async cascade that sank #1218 is avoided.
- test/hindsight-bank.test.ts: regression block builds a real repo +
  git worktree add fixture and asserts both produce the same
  project:<primary> tag and per-project bank id, plus a non-repo
  fallback case.
- CHANGELOG: Fixed entry under Unreleased.

Fixes #2232
2026-06-10 08:26:00 +02:00
roboomp 8c3149e5a9 fix(ai): scoped antigravity quota blocks by model family
- Added CredentialRankingStrategy scope hooks so providers can rank and block only the limits relevant to the requested model.
- Scoped Antigravity usage reports by model family: Gemini/Gemma use Google counters, Claude uses Anthropic counters, and GPT/OpenAI models use OpenAI counters.
- Added scoped backoff keys so a Gemini quota block no longer suppresses healthy Claude/OpenAI Antigravity sessions on the same OAuth credential.
- Threaded modelId through coding-agent API-key resolvers and usage-limit rotation paths.
- Added regression coverage proving a Google/Gemini exhaustion block still allows Claude selection on the same credential.

Fixes #2198
2026-06-10 08:26:00 +02:00
Matt Anger 2e31abcc16 feat(coding-agent): address PR comments and improve reftable support 2026-06-10 08:26:00 +02:00
Matt Anger 08982932b2 feat(coding-agent): add support for git reftables 2026-06-10 08:26:00 +02:00
can1357 35474d98be refactor(config): moved lastChangelogVersion to marker file
- Stored last-seen version in ~/.omp/agent/last-changelog-version so version bumps no longer dirty user configs.
- Migrated the legacy config.yml key into the marker, never clobbering a newer existing marker.
- Added read/write helpers and migration tests.
2026-06-10 02:22:33 +02:00
can1357 f0b6608aff fix(coding-agent): fixed edit pipeline silent-corruption paths
non-exact patch matches warn and prefix/substring matches must preserve the discarded suffix; multi-entry edits stop at first failure and report applied vs not; ast-edit and file-mention snapshots use canonical realpath keys and re-record post-apply; notebook marker-shaped lines escaped on render; fuzzy matcher pre-normalizes once per seek; streaming preview caches text+tree per tick.
2026-06-10 01:27:40 +02:00
Can Bölük 19ce6b28c4 Merge pull request #2116 from danzaio/fix/split-commit-empty-hunks
fix(commit): reject empty split hunk selectors
2026-06-08 22:29:16 +02:00
can1357 243ad581e6 perf(commit): reuse split diff parser 2026-06-08 15:17:38 -03:00
can1357 22b152e220 fix(commit): allow deferred changelog targets 2026-06-08 14:56:36 -03:00
can1357 5d468a2378 fix(commit): reject empty split hunk selectors 2026-06-08 13:31:09 -03:00
can1357 3d5572a0fc test(natives): documented AST conditions and expanded astMatch tests
- Updated `docs/ttsr-injection-lifecycle.md` to document `astCondition` behavior, including registration rules and tool-stream matching.
- Extended `packages/natives/test/native.test.ts` with new `astMatch` coverage for Smart matching, metavariable consistency, parse errors, and empty-language rejection.
2026-06-08 15:00:28 +02:00
can1357 0890b2be61 fix: fixed tool-call recovery, stream parsing, and image normalization flows
- Fixed tool result validation to reject invalid blocks and append explicit error diagnostics.
- Handled aborted and leaked tool calls by returning abort results and dropping partial leaked output.
- Fixed Anthropic streaming by enforcing strict SSE parsing and content-block lifecycle checks.
- Fixed image handling by normalizing model-context inputs and preserving images on resize failure.
2026-06-08 14:40:18 +02:00
can1357 1e5017bf7d feat: enabled block-boundary context support across read and diff previews
- Added tree-sitter `enclosing_block_boundaries` API with line range models.
- Added N-API `enclosingBlockBoundaries` bridge and exported JS declarations.
- Replaced matching-bracket context resolution with source-aware block context in read and diff flows.
- Passed source path through diff/read generators to surface native block boundary previews.
2026-06-08 14:29:59 +02:00
can1357 b8eecfffde feat(coding-agent): added matching bracket context lines to read and edit previews
- Added matching-bracket utilities to locate partner lines for visible spans.
- Added read tool output to use displayContent text and startLine for bracket-aware previews.
- Added matching-bracket context rows to generateDiffString and generateUnifiedDiffString.
- Adjusted diff row insertion to deduplicate and keep contiguous changed groups together.
2026-06-08 14:00:54 +02:00
can1357 30959d3ad4 feat(coding-agent): updated title guidance to generate 3-7 word sentence-case titles
- Updated the title-system prompts to enforce 3-7 word, sentence-case session titles.
- Expanded handling guidance so non-task inputs can map to "none" and link/reference-only messages are summarized by intent.
- Updated the title tool description and generator comments to match the new sentence-case, 3-7 word title contract.
2026-06-08 11:53:37 +02:00
can1357 caa9c69309 feat(coding-agent): added provider-priority model selection and refined fallback ordering
- Added first-party-first provider priority defaults for model ranking.
- Consolidated model resolution to use getModelMatchPreferences from session settings.
- Prioritized providerPriorityRank ahead of usage rank when picking preferred models.
- Added second-pass fallback to default-model or API-key-valid matching order.
2026-06-08 01:32:39 +02:00
can1357 41aa4de9b2 fix(packages/coding-agent): resolved OSC5522 BEL and metadata behavior
- Tracked kitty-dot payload listings to emit BEL-terminated OSC5522 responses.
- Updated non-kitty-dot writes to include mime in metadata and drop ST terminator.
- Adjusted enhanced-paste tests to assert BEL terminator and metadata formatting.
2026-06-08 01:09:47 +02:00