Commit Graph

4807 Commits

Author SHA1 Message Date
can1357 e78b66fc6f test(coding-agent): updated fixtures with missing ui and context mocks
- Added `setEagerNativeScrollbackRebuild` mock to `ui` objects in test fixtures.
- Added `pendingTools` map to context fixtures missing it.
2026-06-01 14:42:58 +02:00
can1357 0c6c6fb92f Merge remote-tracking branch 'origin/farm/5636bafd/dedupe-streaming-assistant-tail' 2026-06-01 14:39:34 +02:00
can1357 77d417f706 Merge remote-tracking branch 'origin/farm/b84f19f4/mcp-reconnect-backoff' 2026-06-01 14:38:37 +02:00
can1357 f1237131bd Merge remote-tracking branch 'origin/farm/59c71bcd/isolate-tiny-model-process' 2026-06-01 14:37:59 +02:00
can1357 b37c20cb10 Merge remote-tracking branch 'origin/farm/55028c01/local-plan-md-unreachable-macos' 2026-06-01 14:37:35 +02:00
can1357 72cf371b9d Merge remote-tracking branch 'origin/farm/f30c73d1/demote-subagent-abort-log' 2026-06-01 14:37:10 +02:00
can1357 6a63b17711 Merge remote-tracking branch 'origin/farm/cdb7e4ab/fix-find-renderer-string-paths' 2026-06-01 14:36:57 +02:00
can1357 8a41264745 feat(ai): added Anthropic task budget support via output_config
- Added `TokenTaskBudget` type and `taskBudget` option to `StreamOptions`.
- Forwarded `taskBudget` as `output_config.task_budget` with the `task-budgets-2026-03-13` beta header.
- Fixed `disableThinkingIfToolChoiceForced` to preserve `task_budget` when clearing `effort`.
- Accepted `output_config.task_budget` from Anthropic gateway requests.
2026-06-01 14:35:43 +02:00
roboomp 73102d20df fix(coding-agent): routed local:// reads through the calling session
- Extended ResolveContext / WriteContext with localProtocolOptions so the
  internal-URL router can thread the calling session's local-root mapping
  through to handlers.
- LocalProtocolHandler.resolveOptions now prefers context.localProtocolOptions
  before consulting the process-global override or the first main-kind session
  in AgentRegistry, fixing multi-session ACP hosts (cmux) where reads of
  local://PLAN.md were routing to a sibling session's artifacts dir even
  though plan-mode writes succeeded against the calling session.
- read, find, ast_grep, ast_edit, and search now thread
  this.session.localProtocolOptions into the router so local://, memory://,
  agent://, and other handlers see the right caller.
- Added regression tests covering the override-vs-context priority and the
  ENOENT-against-caller-root path.

Fixes #1608
2026-06-01 11:27:14 +00:00
roboomp 8580ba248c fix(tool): handled string paths in find renderer
Guarded find renderer path summaries so raw pre-validation string paths render instead of throwing. Added coverage for pending, fallback, empty, and detailed result render paths.\n\nFixes #1622
2026-06-01 06:22:27 +00:00
roboomp d14aa4dbe5 fix(task): demote subagent reminder-loop abort log
The catch around the subagent yield-reminder prompt previously logged
every exception at ERROR. User cancel (^C) and compaction-driven aborts
both surface as ToolAbortError through awaitAbortable, so benign control
flow generated 9 spurious 'Subagent prompt failed' errors in 2 days on
the reporter's instance.

Gate the ERROR branch on '!abortSignal.aborted && !(err instanceof
ToolAbortError)' and route the abort path to logger.debug. The outer
catch + finally still mark the run aborted, so observable behaviour is
unchanged.

Fixes #1623
2026-06-01 06:20:55 +00:00
roboomp eaba4031ca fix(tui): reset assistant stream rebuild mode
Reset eager scrollback rebuild mode on agent_end when provider streams fail before message_end.\n\nFixes #1615
2026-06-01 02:45:37 +00:00
roboomp 64b48b57b1 fix(tui): rebuilt scrollback during assistant streaming
Enable eager native scrollback rebuild mode while assistant text is actively streaming so reflowed Markdown rows do not leave stale duplicated tails in WSL/Windows Terminal scrollback.\n\nFixes #1615
2026-06-01 02:40:45 +00:00
roboomp e69e8b54f8 fix(tiny): surfaced unexpected subprocess signal exits as worker errors
The first cut at the subprocess isolation swallowed every signal exit (`exitCode === null`) on the assumption it was the intentional SIGKILL from `terminate()`. That misclassifies real worker deaths — SIGSEGV from a native crash, SIGKILL from the OOM killer, an operator `kill -9` — so any in-flight title/completion/download promise would await forever while `#worker` still pointed at a dead process.

Added an `intentionalExit` flag flipped by `wrapSubprocess.terminate()` right before its SIGKILL. `onExit` swallows only the flagged exit; every other signal exit now fires the `errors` channel with a "signal SIGFOO" message so `TinyTitleClient.#handleWorkerError` clears `#pending` and dumps the dead worker handle. Added two regression tests pinning both branches.

Reported by chatgpt-codex-connector on #1607.
2026-05-31 21:09:07 +00:00
roboomp 5843a78dbf fix(tiny): isolated tiny model worker in subprocess to skip onnxruntime napi crash
Moved the tiny title/memory worker from a Bun Worker thread into a child process spawned via Bun.spawn IPC. The agent CLI gains a hidden --tiny-worker dispatch the parent invokes through process.execPath; the parent SIGKILLs the child on dispose so onnxruntime-node's NAPI finalizer never runs in any address space the agent owns. On Windows that finalizer was segfaulting Bun at shutdown after the tiny title model loaded (issue #1606). Drops the now-dead 'close'/'closed' handshake and the unused parentPort bootstrap, and removes tiny/worker.ts from --compile worker entries in both build scripts plus the regression test that pinned them.

Fixes #1606
2026-05-31 21:02:25 +00:00
can1357 56cc099296 Merge remote-tracking branch 'origin/farm/8e4fd13a/show-pr-reviews' 2026-05-31 20:17:47 +02:00
can1357 7e11bea8f4 fix(coding-agent): repaired per-field double-encoded JSON in task tool
- Added `repairDoubleEncodedJsonString` to unescape fields double-encoded by the model (e.g. literal `\n`, `\"`, `\uXXXX` in `context`/`assignment`/`description`).
- Scoped repair to natural-language fields only, leaving code-bearing tools untouched.
- Applied repair on both render and execution paths in `TaskTool`.
2026-05-31 20:17:38 +02:00
can1357 a45747f96a refactor(coding-agent): replaced bracket-style section tags with underlined headers
- Converted [SECTION]...[/SECTION] markers to "SECTION\n===" format in system prompt templates.
- Updated system conventions doc to reference the new marker style.
- Updated tests to match against the new header pattern.
2026-05-31 20:10:56 +02:00
roboomp ff3dd6d9a6 fix(tool): rendered formal pr reviews
Included the reviews field in comments-enabled PR view fetches so pr:// output can show formal review submissions and approvals.

Added protocol coverage that emulates gh --json field selection before asserting rendered approval output.

Fixes #1600
2026-05-31 17:40:56 +00:00
roboomp 6881c5cc41 fix(mcp): drop stale connection when reconnect breaker trips
Leaving the dead connection in `#connections` made `getConnectionStatus` report `connected` and `waitForConnection` hand a closed transport to callers after the breaker had explicitly suspended the server. Mirror `#doReconnect`'s teardown: detach `onClose`, fire-and-forget `transport.close()`, and drop the entry from `#connections` (plus its in-flight slots in `#pendingConnections`/`#pendingToolLoads`). Tools stay registered in `#tools` so the user can recover with `/mcp reconnect`.

Test asserts `getConnectionStatus("crashy") === "disconnected"` after the burst.

Refs #1592
2026-05-31 15:38:21 +00:00
roboomp 230514d937 fix(mcp): cap automatic reconnect bursts to prevent fork-bomb
A stdio MCP server that completes the initialize + tools/list handshake and then exits cleanly will fire `transport.onClose` on every clean exit, and the old `MCPManager.reconnectServer` path spawned again unconditionally. A misconfigured PHP-shebang MCP (e.g. Laravel Boost in a non-Laravel project) hit this loop and forked 66 487 `php84` processes parented directly to the agent's `bun` PID until macOS force-rebooted.

Add a per-server sliding-window circuit breaker: at most 5 reconnect attempts per 30 s window. The transport `onClose` callback and the per-tool-call retry in `tool-bridge` are subject to the breaker; `/mcp reconnect` passes `{ manual: true }` to reset the window so users can recover after fixing the underlying misconfiguration. Stale `onClose` is detached when the breaker trips so a late EOF event cannot re-arm the loop.

Defended by `mcp-reconnect-storm.test.ts`: a Bun stdio fixture answers the handshake and exits, then asserts the spawn count stays at ≤ 10 (was 127 without the fix).

Fixes #1592
2026-05-31 15:34:29 +00:00
roboomp f4ed2698dd fix(lsp): shut down servers with exit notification
Send the LSP exit notification after a successful shutdown response before falling back to process termination. Add a regression test that fails when a server receives shutdown but not exit.\n\nFixes #1593
2026-05-31 15:26:13 +00:00
can1357 38fcd53d64 chore: bump version to 15.7.4 2026-05-31 17:08:17 +02:00
can1357 cec8b482c9 feat(coding-agent/tui): reworked border shimmer to bounce along the bottom edge
- Replaced perimeter-based border animation with a bottom-edge `borderSegmentHeadCol` bounce cycle.
- Constrained animated segment rendering so only the bottom border can be darkened while other edges stay flat accent.
- Updated tests to validate non-teleporting width-based motion and bottom-edge easing behavior.
2026-05-31 17:08:04 +02:00
can1357 20c019fccb refactor(cli): moved MallocStackLogging cleanup to cli entrypoint
- Removed env var deletion from utils/dirs.ts (wrong layer).
- Placed it in the CLI entrypoint so it runs before any subprocess inherits the env.
2026-05-31 16:57:22 +02:00
can1357 c3cd3fec2b Merge remote-tracking branch 'origin/farm/da40d318/fix-plugin-install-sha-shallow-clone' 2026-05-31 16:56:50 +02:00
roboomp 56b222f544 fix(coding-agent): clone full repo when plugin source pins a SHA
git clone --depth 1 --single-branch only fetches the tip of the
requested branch, so any subsequent git checkout <sha> for a non-tip
commit fails with 'reference is not a tree'. The error was caught and
rethrown as 'shallow clone may not contain this commit', but the clone
arguments were never adjusted.

Drop --depth 1 (and --single-branch when no ref is requested) when the
caller supplies options.sha so the desired commit is present in the
local object store. The ref-only path remains shallow.

Fixes #1589
2026-05-31 14:47:14 +00:00
can1357 14bd572f49 refactor(shake): removed shake-summary mode and local-model compressor
- Dropped `summarizeShakeRegions`, the shake-summary prompt, and related types.
- Removed `shake-summary` compaction strategy and `providers.shakeSummaryModel` setting.
- Migrated existing `shake-summary` configs to plain `shake` on load.
- Simplified `/shake` to `elide` and `images` modes only.
2026-05-31 14:14:37 +02:00
can1357 1fdb68e97f feat(title-client): added prefill and stop params to complete options
- Exposed prefill and stop fields on the complete method's options type.
- Forwarded both fields to the worker's complete message payload.
2026-05-31 14:03:02 +02:00
can1357 7bb6fb20ee fix: fixed idle-timeout retries, darwin-x64 ORT preload, and prefill support
- Fixed Anthropic stream idle-timeout errors incorrectly triggering provider retries after streaming had begun.
- Fixed darwin-x64 `bun build --compile` failure by guarding `onnxruntime-node` preload behind a `process.platform === "win32"` literal for dead-code elimination.
- Added `prefill` and `stop` parameters to the tiny-model worker's `complete` message type to pin output format without biasing content.
2026-05-31 13:49:55 +02:00
can1357 e7580d8f9c test(coding-agent): normalized options handling in ACP lazy startup test setup
- Defaulted the test createAgentSession input to an empty object before spreading.
- Computed workspaceTree from the normalized options, preserving the cwd fallback behavior.
2026-05-31 13:27:52 +02:00
can1357 a8d50879df chore: reformat 2026-05-31 13:22:50 +02:00
can1357 d016150d01 fix(ai): prevented provider retry after streaming unsafe content
- Added `!streamedReplayUnsafeContent` guard to `canRetryProviderFailure` to avoid replaying unsafe content on retry.
- Updated test fixtures to supply a required `workspaceTree` parameter via a shared `emptyWorkspaceTree` helper.
2026-05-31 13:21:15 +02:00
can1357 87b4f08e39 fix(coding-agent/modes): allowed unknown viewport mutation during tool expansion
- Updated toggleToolOutputExpansion to pass allowUnknownViewportMutation when requesting render.
- Added a test that verifies tool output toggling sets expansion state and calls requestRender with the new flag.
- Documented the Ctrl+O POSIX tool-result expansion scrollback fix in the changelog.
2026-05-31 12:44:26 +02:00
can1357 a043826723 chore: bump version to 15.7.3 2026-05-31 12:30:20 +02:00
can1357 339ba5ee7c fix(coding-agent/modes): enabled eager native scrollback rebuild during tool execution
- Added a post-dispatch refresh hook to recompute foreground tool render mode after key turn/tool events.
- Computed whether any non-background pending tool is active and toggled eager native scrollback rebuild accordingly.
- Added a regression test confirming eager rebuild is enabled while foreground tools are pending and disabled when none remain.
2026-05-31 11:32:41 +02:00
can1357 25e5ea6e16 docs(coding-agent/prompts): added rule against re-auditing edits and routine diff checks
- Added a system prompt instruction to never re-audit applied edits.
- Added guidance to avoid routine `git status` and `git diff` checks, with exceptions for explicit requests and selective repo operations.
2026-05-31 10:53:16 +02:00
can1357 84cf063b0e fix(coding-agent): fixed streaming edit preview to keep a full trailing diff window
- Replaced the streaming edit diff rendering strategy with a fixed-height trailing window so partial re-diff streams stayed anchored and stopped oscillating.
- Updated streaming preview tests to assert the window remained saturated without trailing blank padding across chunked updates and still produced a real diff after finalization.
- Tuned TUI viewport repaint heuristics for pure appends and multiplexer sessions, and adjusted render-stress handling for preserved tmux scrollback.
2026-05-31 10:53:05 +02:00
can1357 39c4762b74 fix(tui): corrected tmux overlay rendering to preserve native scrollback
- Preserved hidden tmux overlays in live viewport while keeping native scrollback intact during forced renders.
- Adjusted forced-render handling so pure appends preserve full scrollback and return viewport repaint on equal-size diffs.
- Capped streaming edit diff previews to a fixed trailing window and reported hidden hunk counts.
- Updated tmux and regression tests to validate hidden overlays, nativeText frame sources, and scrollback retention.
- Removed stream preview height tracking and simplified tool call rendering to always invalidate the content box.
2026-05-31 10:16:26 +02:00
can1357 2003d7382e feat(eval): added per-cell inactivity timeout budgets in eval executors
- Changed eval timeout behavior from hard wall-clock deadlines to per-cell inactivity budgets in all executors.
- Added IdleTimeout watchdog support, including bumps on status/tool activity and timer cleanup after execution.
- Updated executor option plumbing to replace deadlineMs with idleTimeoutMs and emit inactivity timeout annotations.
- Added IdleTimeout and shared-executor tests and updated prompt/repl docs for the new timeout contract.
2026-05-31 10:11:59 +02:00
can1357 a5c71bb775 test(coding-agent/test): added markdown-aware keyword tests in prose mode
- Added markdown prose tests to verify maskNonProse preserves plain prose and masks fenced/tilde blocks.
- Added keyword-in-prose tests that enforced lowercase token matching and ignored code spans, fences, XML, and comments.
- Added highlight-mode tests ensuring only prose keywords are ANSI-highlighted and inline/fenced/XML regions stay unmodified.
- Added workflow/orchestrate assertions that uppercase or path-like forms remain unchanged while lowercase token boundaries are handled correctly.
2026-05-31 09:47:24 +02:00
can1357 bfdbb3ff20 refactor(coding-agent/src): migrated keyword decorators to shared helper
- Replaced composed keyword decorators in `CustomEditor.decorateText` with `highlightMagicKeywords`.
- Adjusted `UserMessageComponent` rendering to use `highlightMagicKeywords` with `keywordReset` for consistent foreground.
2026-05-31 09:47:24 +02:00
can1357 c637db9741 feat(coding-agent): added markdown-aware magic-keyword flow for 3 modes
- Added `highlightMagicKeywords(text: string, resetTo?: string): string` and chained ultrathink, orchestrate, workflow glow.
- Updated ultrathink, orchestrate, and workflow matching to lowercase whitespace-delimited patterns with prose-only checks.
- Added `maskNonProse` and `keywordInProse` to skip fenced/inline code and HTML/XML segments while highlighting keywords.
- Added `KeywordHighlighter` with optional `resetTo`, and updated gradient highlighting to use masked match slicing.
2026-05-31 09:47:24 +02:00
can1357 a6c5d3fb82 fix(tui): resolved rebuild prep to preserve forced state and clear scrollback
- Added overlayRebuild intent, refactored forced-frame prep around base lines, and added frame dump support.
- Updated forced-render prep to preserve forced flags, allow unknown viewport mutation, and clear scrollback on resize.
- Introduced #syncChildOrder for child attach/reorder and skipped duplicate checks when after.atBottom was false.
- Added streaming-preview test scaffolding with VirtualTerminal, settleTerminal draining, and normalized row helpers.
2026-05-31 09:47:24 +02:00
can1357 9fabd5e4d5 feat(coding-agent): added onStatus in eval backends for status streams
- Added optional `onStatus` callback wiring across eval backends and JS/Python executors for live status streams.
- Added collectDisplay-based forwarding so `emitStatus` and `onDisplay` route status outputs consistently.
- Expanded agent status payloads with preview/model/token-cost context and kept completion updates single-pass.
- Added status upsert and render adjustments in `tools/eval.ts` to coalesce agent events with progress stats.
- Added status/progress test coverage for running/completed agent events, final metric retention, and parallel placement.
- Updated CHANGELOG Unreleased notes to record live progress updates and completion-status metric fixes.
2026-05-31 08:45:12 +02:00
can1357 68430dee5c chore: renamed mnemosyne package to mnemopi
- Updated package name, directory, and binary from mnemosyne to mnemopi.
- Updated all lockfile references and workspace paths accordingly.
2026-05-31 08:45:12 +02:00
can1357 2ddc9c5bc9 feat(coding-agent): added turn-budget parsing, multipliers and hard caps
- Added +Nk/+Nm turn-budget parsing with whitespace-boundary matching, multipliers, and hard `!` indicator.
- Added per-turn budget lifecycle plus APIs (`getTurnBudget`, `recordEvalSubagentUsage`) and hard-cap checks in eval runs.
- Added hard budget observability in eval preludes and docs by exposing `budget.hard` and documenting ceiling modes.
- Fixed streaming preview stutter with max-row tracking and padding, with tests for preview height and budget parsing.
2026-05-31 08:03:45 +02:00
can1357 4ab40764d1 refactor(coding-agent): removed args global from eval runtimes
- Dropped `args` input from eval tool schema, JS/Python executors, and worker protocol.
- Removed per-call `args` injection from JS runtime and Python kernel/runner.
- Deleted related tests and updated docs to reflect removal.
2026-05-31 07:54:52 +02:00
can1357 59c8749ad7 fix(tui): resolved tui status footer truncation using VT stripping
- Replaced ad-hoc ANSI/VT stripping regexes with `stripVTControlCharacters` in status text handling and related tests.
- Updated status footer rendering to truncate using `truncateToWidth` and visible width after VT stripping.
- Extended tui cursor handling and rendering to strip markers from all lines and fit repaint/append-tail lines to width.
- Expanded deterministic render tests with overlay-aware assertions and recorded the truncation/cursor-marker behavior in changelogs.
2026-05-31 07:54:23 +02:00
can1357 42b79bc696 feat(coding-agent): added fuzzy token matching in coding-agent components
- Added fuzzy token matching in agent-dashboard, state-manager, and tree-selector, replacing lowercased checks.
- Added search-query state and fuzzy-filter helpers to hook, oauth, and user-message selectors for query filtering.
- Updated filtered selectors to render match results, status lines, no-match text, and move selection within results.
- Added `overflowSearch` and filter state to `SelectList`, switching overflowing list matching to fuzzy checks.
- Configured `SelectList` input flow and fixed cancel so Escape/Ctrl+C closes lists when no matches exist.
- Updated changelogs and added tests for fuzzy-filter behavior in hook, oauth, user-message, and list selectors.
2026-05-31 07:45:22 +02:00