Commit Graph

6618 Commits

Author SHA1 Message Date
can1357 4e6f04220f chore: reformat 2026-05-31 13:04:25 +02:00
can1357 6cee7a666d test(tests): added deterministic yield tests and viewport mutation regression coverage
- Replaced real-time yield assertions with a mocked clock and scheduler wait spy to validate gate timing deterministically.
- Updated fact consolidation conflict tests to capture console warnings and verify duplicate-resolution messaging.
- Added TUI offscreen-expansion regressions for unknown-viewports, covering deferred rebuild and user-driven rebuild behavior.
2026-05-31 13:02:32 +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 e45b0a2021 fix(mnemopi): updated optional embeddings tests to use MNEMOPI env vars
- Updated optional-embeddings tests to use MNEMOPI_* environment variable names instead of MNEMOSYNE_*.
- Updated withEnv calls and ENV_KEYS entries so optional embeddings test configuration matches current env var naming.
2026-05-31 12:42:16 +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 5f543b9577 feat(tui): enabled eager native scrollback rebuild for unknown POSIX viewports
- Added `TUI#setEagerNativeScrollbackRebuild` to opt into native scrollback rebuilds during unknown-viewport rendering.
- Hooked the new flag into render mutation handling so offscreen and structural updates rebuild immediately when enabled.
- Documented the behavior and added a regression test validating clean, non-duplicated scrollback after streaming layout edits on POSIX.
2026-05-31 11:32:37 +02:00
can1357 47b7c27eda fix(tui): adjusted TUI render logic to force a native
- Adjusted TUI render logic to force a native history rebuild when terminal width changes, so POSIX sessions rewrap committed history even when viewport position is unknown.
- Preserved the existing defer path for known scrolled-away viewports, avoiding unnecessary destructive rebuilds outside explicit resize events.
- Added a regression test that resizes an unknown-viewport terminal from 20 to 40 columns and verifies old wrapped rows are replaced by rewrapped lines.
2026-05-31 11:13:55 +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 d7a5fe1ce5 fix(tui): fixed viewport snap and height-grow displacement bugs
- Fixed scrolled-up readers being yanked to the tail on POSIX terminals when streaming content arrived; unknown native viewport position was treated as "at bottom", triggering destructive history rebuilds.
- Fixed appended rows slipping down by the height delta when a resize and new content coalesced into one frame; height-grow repaint now only fires when content fits within the new viewport.
- Added regression test covering the height-grow-with-new-content case.
2026-05-31 09:57:39 +02:00
can1357 21259aac5e fix(tui): repainted overfull height growth to preserve scrolled-up anchors
- Changed the render planner so height increases with new overflow now trigger a viewport repaint in non-Termux and non-multiplexer sessions.
- The new path marks native scrollback dirty and defers full rebuild, preventing anchor-loss while streaming inserts are offscreen.
- Added a POSIX unknown-viewport regression test that verifies scrolled-up readers stay on their rows during streaming and recover after an explicit native refresh.
2026-05-31 09:52:48 +02:00
can1357 8175a1b8e1 refactor(packages/tui): reorganized native scrollback live rebuild checks
- Replaced render-time rebuild guards with #canRebuildNativeScrollbackLive, preventing destructive scrollback rewinds.
- Added #canRebuildNativeScrollbackLive to gate live history/overlay rebuilds on safe viewport state.
2026-05-31 09:47:43 +02:00
can1357 3edd46f67b fix(packages/tui): resolved PI_DUMP_OP frame dump to append JSONL cursor
- Logged render trace entries to /tmp/renderTrace.jsonl with optional terminal.getBufferPosition().
- Switched PI_DUMP_OP frame dump output from writeFileSync overwrite to append-only JSONL logging.
2026-05-31 09:47:35 +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 730e598786 fix(tui): corrected TUI scrollback preservation during rerenders
- Preserved preexisting terminal scrollback during forced and structural rerenders in TUI.#prepareForcedRender.
- Gated historyRebuild triggers on #scrollbackHighWater in TUI.#canReplayNativeScrollbackAtCheckpoint.
- Expanded render-stress coverage with child mutations, viewport variants, and replay-mode scenario parsing.
2026-05-31 08:45:12 +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 aa7bbe32f9 fix(tui): fixed scrollback replay on forced renders and overflow growth
- Tracked forced-render line drops with a dedicated flag and used it to force viewport repaints without treating valid empty frames as non-diffable.
- Refined render-kind selection to skip viewport repaints when appended content increases overflow and to rebuild history when line counts change while native scrollback replay is possible.
- Added a high-water preview-collapse stress operation and tightened native scrollback replay checks across geometry-mutation transitions.
2026-05-31 08:19:29 +02:00
can1357 43027c6493 fix(tui): updated shrink-path logic in tui.ts to choose
- Updated shrink-path logic in `tui.ts` to choose checkpoint-based history rebuilds when bottom-anchored content changes and the viewport is not scrolled into history.
- Added a regression test ensuring a high-water preview collapse fully rebuilds native scrollback and clears stale preview rows from the buffer.
- Expanded strict scrollback stress tests with collapse operations and replay-fidelity assertions for both full-buffer and viewport matching at sampled scroll positions.
2026-05-31 08:13:01 +02:00
can1357 957b6b7533 fix(tui): expanded offscreen edit handling in TUI to
- Expanded offscreen edit handling in `TUI` to rebuild native scrollback when replay is safe and the terminal is not multiplexed.
- Marked native scrollback dirty and returned to viewport-only repainting when replay was not safe.
- Adjusted stress assertions to skip clean-buffer checks during geometry-changing operations.
2026-05-31 08:03:55 +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 ac7b8ac144 test(tui): added scrollback growth assertion to stress driver
- Asserts scrollback buffer growth does not exceed logical frame growth during dirty live rendering.
- Validates that newly appended scrollback lines match the tail of the logical frame.
2026-05-31 07:55:07 +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
can1357 ae5139358c feat(coding-agent): integrated shake commands and lifecycle
Integrate shake commands and lifecycle into agent-session, controllers, interactive mode, and slash-command wiring, with shake behavior tests.
2026-05-31 07:40:31 +02:00
can1357 7613c2a913 feat(coding-agent): expanded eval execution and bridge paths with workflow helpers
Expand eval execution/bridge paths with args/log/phase/budget support, add workflow helpers (parallel/pipeline), expose usage statistics, and add eval integration tests and docs.
2026-05-31 07:40:18 +02:00
can1357 5fae08d2b7 feat(coding-agent): added workflow keyword detection and notice plumbing
Detect the workflow keyword and plumb the notice through editor highlighting and a guidance tip, with workflow matcher tests.
2026-05-31 07:40:02 +02:00
can1357 19be67921d feat(coding-agent): added shake configuration and type modeling
Introduce shake-related configuration and types: strategy options, action enums, and shake result types.
2026-05-31 07:39:51 +02:00
can1357 417a1a1d32 feat(agent): added shake compaction strategy primitives
Introduce the shake compaction strategy in the core agent: exports, summary prompt, implementation, and unit coverage.
2026-05-31 07:39:38 +02:00
can1357 0bb04ba529 fix(tui): fixed native scrollback corruption on same-frame offscreen edits
- Detects appended tail vs. offscreen row edits within a single render frame.
- Ambiguous appended tails now trigger a history rebuild instead of splicing stale rows into the scrollback buffer.
- Pure viewport-suffix changes above the viewport top bypass replay with a direct repaint.
2026-05-31 07:27:31 +02:00
can1357 05ed865567 test(tui): added randomized render stress test suite
- Added 1384-line property-based stress harness covering viewport fidelity, cursor positioning, scrolled deferral, row accounting, and history prefix stability.
- Supported configurable geometry, platform, terminal mode, and env mode scenarios with seeded RNG.
- Extended VirtualTerminal constructor to accept optional scrollback limit.
2026-05-31 07:27:22 +02:00
can1357 ff9a6826dd fix(compaction): made read tool-results prunable except for skill:// paths
- Replaced flat `protectedTools: string[]` with `ProtectedToolMatcher[]` supporting predicate functions.
- Regular file/URL `read` calls are now eligible for pruning and shake compaction.
- `read` calls whose `path` starts with `skill://` remain protected like native `skill` results.
- Added `collectToolCallsById` to correlate tool results with their originating call arguments.
2026-05-31 07:12:27 +02:00
can1357 cf621d0abf feat(coding-agent-eval): added runEvalAgent bridge for agent plan checks
- Added `agent()` in JS/Python preludes to call host bridge and parse returned text when schema is set.
- Added JS `parallel()` and `pipeline()` with bounded `__pool()` pools and concurrency normalization.
- Added `runEvalAgent` bridge logic with argument parsing plus plan-mode, allowlist, depth, and artifacts checks.
- Added tool routing and tests documenting new `agent/parallel/pipeline` behavior, defaults, and validation failures.
2026-05-31 06:57:02 +02:00
can1357 d1bd14f020 feat(coding-agent): propagated mcpManager and localProtocolOptions to subagents
- Stored mcpManager and localProtocolOptions on ToolSession so nested subagents inherit them without relying on process-global singletons.
- TaskTool now uses the session's localProtocolOptions and mcpManager when spawning sub-tasks, falling back to defaults if absent.
2026-05-31 06:49:20 +02:00
can1357 d767bd2b75 fix(coding-agent): defaulted approval slider to default tier
- Previously the slider started at the current cycle index, so execution would inherit whichever model drove planning.
- Now finds the `default` role in the cycle and anchors the slider there, falling back to `currentIndex` if no default exists.
- Explicit `executionModel` is set whenever the chosen tier differs from the restored cycle position, covering the case where the slider stays on `default` but planning ran on another model.
2026-05-31 06:48:30 +02:00
can1357 1f82d0eedd fix(session): excluded aborted/error messages from last usage lookup
- Skipped assistant messages with stopReason "aborted" or "error" when searching for the last valid usage stats.
2026-05-31 06:45:56 +02:00
can1357 1fbc2cbd79 fix(coding-agent): let extension flags shadow same-named built-ins in parseArgs
Follow-up to #1503. When an extension registered a flag whose name collides
with a value-taking built-in — e.g. plan-mode's boolean `--plan` vs the
built-in `--plan <plan-model>` selector — the extension-aware reparse still
took the built-in branch. `omp --extension plan-mode --plan "review the diff"`
consumed "review the diff" as the plan-model value, leaving parsed.messages
empty and overwriting result.plan with the prompt text. recoverFlagValue only
patched the extension flag value, not the corrupted parsed object that
applyExtensionFlags returns as initialArgs.

Fix at the source: parseArgs now checks the registered extension-flag set
BEFORE the built-in branches, so a registered flag is parsed with the
extension's semantics (boolean toggle / string value) and surfaces in
unknownFlags without consuming the following token or touching the built-in
field. This makes recoverFlagValue dead, so applyExtensionFlags is simplified
to read resolved values straight from unknownFlags.

Tests: parseArgs-level shadowing guard (boolean --plan keeps the message and
leaves result.plan unset); applyExtensionFlags message/built-in-field
preservation for colliding boolean (--plan) and string (--model) flags;
non-colliding flag-looking-value rule retained. Verified the new guards fail
without the shadowing fix.
2026-05-31 06:36:33 +02:00
can1357 db485325db refactor(mnemosyne): standardized embedding provider output to async batch streams
- Changed `EmbeddingOutput` to `AsyncIterable<number[][]>` in runtime options and removed `EmbeddingRow` from the public provider contract.
- Reworked embedding result handling to stream-collect async batches into `Float32Array` rows before caching and querying.
- Updated embedding tests to provide providers as async generators yielding row batches to match the new contract.
2026-05-31 06:27:51 +02:00
Can Bölük 7ad52b25ff Merge pull request #1503 from erik-sv/upstream-pr/extension-flag-initial-message
fix(coding-agent): strip extension flags from the initial prompt
2026-05-31 07:25:03 +03:00
can1357 dcf482c4c4 fix(editor): removed ? shortcut that opened hotkeys when input was empty
- Dropped `onShowHotkeys` callback and its binding from `CustomEditor` and `InputController`.
- `?` now inserts a literal question mark regardless of editor state; use `/hotkeys` explicitly.
- Added regression test confirming `?` is treated as plain input when the editor is empty.
2026-05-31 06:23:27 +02:00
can1357 b48b825344 fix(coding-agent): process @file before session creation; drop built-in flag-name list
Two review fixes for the extension-flag/initial-prompt work:

1. @file ordering — `processFileArguments` runs `process.exit(1)` on a
   missing/unreadable file. It had been moved after `createSession`, which
   writes the terminal breadcrumb eagerly (SessionManager.create →
   #newSessionSync), so `omp @missing.md "x"` left a junk session/breadcrumb
   behind before exiting.

   Resolve extension-registered CLI flags BEFORE creating the session: load the
   session's extensions up front (new `loadSessionExtensions` helper, the single
   source of createAgentSession's discovery-branch logic), build an
   ExtensionFlagSink straight from the loaded extensions + runtime, re-parse
   argv, then process @file args — all before any session exists. The loaded
   result is handed back to createAgentSession via `preloadedExtensions` (now
   checked before `disableExtensionDiscovery`, so it can't double-load) and the
   same EventBus is shared, so no extra work. This keeps the P1#1 fix
   (`--flag @value` is the flag's value, not a file) while failing fast with no
   session side effects.

2. "Can we avoid the big list of names?" — removed the hand-maintained
   `BUILTIN_FLAG_NAMES` set (and its stale "rejected at registration" doc).
   `applyExtensionFlags` now always falls back to recovering a flag's value from
   argv when parseArgs didn't surface it; the recovery scan mirrors parseArgs's
   consumption rules (flag-looking space-form values stay their own flag) and is
   a no-op for flags that were absent or already surfaced, so no list of
   built-in names is needed.

Adds `ExtensionRunner.aggregateFlags` (static) so getFlags and the CLI's
pre-session sink share one implementation.

Tests: pre-session flag resolution via the exact main.ts sink pattern;
list-free recovery of an arbitrary colliding built-in (`--model`); and the
flag-looking-value rule. Verified typecheck + extension/runner/acp suites.
2026-05-31 06:23:15 +02:00
can1357 346ae48b0c fix(session): prevented runtime model switches from persisting default role
- Restricted `setModel` to persist settings only when `persist: true` is passed; all runtime switches (Ctrl+P, `--model`, `/model`, model picker temp selections) no longer overwrite `modelRoles.default`.
- Changed `cycleRoleModels` to accept a direction ("forward"/"backward") instead of a `temporary` flag; both directions now use `applyRoleModel` without persisting.
- Added `persist: true` exclusively to the model picker's "Set as default" action in `SelectorController`.
- Added test suite covering persistence behavior for `setModel`, `cycleRoleModels`, and `cycleModel`.
2026-05-31 06:21:29 +02:00
can1357 3fe5d98eab docs(hashline): added rule prohibiting formatter-style edits via tool
- Clarified that reordering imports, re-indenting, and other mechanical restyling must be handled by the project formatter, not hand-edited through the patch tool.
2026-05-31 06:20:32 +02:00