Commit Graph

3618 Commits

Author SHA1 Message Date
can1357 8c323666be feat: added ordered systemPrompt arrays and normalized context prompts
- Converted systemPrompt APIs and state types to ordered `string[]` across agent, AI, and coding-agent surfaces.
- Added `normalizeSystemPrompts` and applied it to context normalization before building provider request payloads.
- Updated AI providers to emit separate normalized prompt blocks/messages instead of a single merged system prompt.
- Removed dedicated `projectPrompt` state and remapped that context into system-context buckets in session, dump, and token accounting.
- Aligned tests and changelogs to pass and assert `systemPrompt` as arrays with ordered prompt semantics.
2026-05-04 15:20:26 +02:00
can1357 1cce2ee96b feat(coding-agent/edit): added opt-in setting for pure-insert hashline duplicate dropping
- Added a new `edit.hashlineAutoDropPureInsertDuplicates` boolean setting with default `false` for hashline edits.
- Threaded the setting through tool execution contexts so hashline previews and execution honor the configured option.
- Changed pure-insert duplicate boundary absorption to run only when enabled and added tests for default-disabled and enabled behavior.
2026-05-04 05:58:43 +02:00
can1357 8283358d86 perf(coding-agent): used direct fs.readdir listing when gitignore was disabled
- Refactored directory tree child discovery into a dedicated direct-name helper.
- Used fs.readdir for non-gitignore directories instead of globbing.
- Kept child-name filtering for excluded and hidden entries in the same selection flow.
2026-05-04 05:58:43 +02:00
can1357 ebd17597f4 feat(coding-agent): added read tool summarize mode with depth limits
- Added DirectoryTree, DirectoryTreeOptions, and buildDirectoryTree exports for configurable tree rendering.
- Changed read tool directory output to use buildDirectoryTree with depth and exclusion limits.
- Added read.summarize settings and summary-mode parseable read output behavior when no selector is used.
- Added tests for truncated root/child listings and hidden or excluded entry filtering.
2026-05-04 05:58:43 +02:00
can1357 45209e233c feat(coding-agent): added workspace-tree context APIs for system prompts
- Added `WorkspaceTree` and `buildWorkspaceTree` APIs for working-directory tree rendering with limits.
- Extended `buildSystemPrompt` and `createAgentSession` to resolve and pass workspace tree context for system prompts.
- Updated the system prompt template to include a `<workspace-tree>` section with truncation notices before append output.
- Added workspace-tree and system-prompt tests covering sorting, truncation, exclusions, and prompt ordering.
2026-05-04 05:58:43 +02:00
can1357 e9735f6ad8 feat(pi-natives): added TS/rs/java body elidable-kind handling and tests
- `is_elidable_kind` now treats more AST kinds as elidable for TypeScript, Rust, and Java.
- Added summary tests for interface and class bodies in TypeScript, Rust, and Java.
- Merged brace-boundary read summary spans into a single `..` line-range representation.
- Grouped adjacent groupable nodes and emitted elision spans only after grouped runs met thresholds.
- Normalized end-line rows at column 0 and extended import-like groupable-kind rules across languages.
- Updated read-summary tests and added changelog notes for merged brace-pair `{ .. }` output behavior.
2026-05-04 05:58:43 +02:00
can1357 f4be78b97d perf(coding-agent/edit): consolidated brace-only line hashes into structural ordinals
- Added a structural hash path that returns an ordinal-suffix bigram for lines containing only whitespace and braces.
- Kept line-number variation for other non-content lines while leaving content-bearing line hashes independent of index for stability across small shifts.
2026-05-04 04:35:59 +02:00
can1357 a290b54993 fix(coding-agent/edit): resolved hashline duplicate drops with warning
- Extended hashline pure-insert absorption to auto-drop 2+ duplicated boundary lines at ANCHOR, BOF, and EOF inserts.
- Surfaced a warning when pure-insert boundary lines are auto-dropped.
2026-05-04 04:34:46 +02:00
can1357 4087e69e70 feat(coding-agent): added read CLI command for inspecting tool output
- Registered a new `read` command in the CLI command registry so `omp read` can be invoked.
- Implemented `runReadCommand` to execute the read tool, wrap it with meta notices, and print text or image-result blocks.
- Added a `read` command class with required path input, optional timeout flag, and usage examples.
2026-05-04 04:27:47 +02:00
can1357 a019994091 feat: added tree-sitter summarizeCode support and N-API summary exports
- Updated read schema, path utilities, and dispatch to parse selectors from :raw/:L suffixes on path, removing standalone sel usage.
- Changed truncation/error notices to continue with :<nextOffset> and :1 guidance for read and sqlite pagination.
- Added summarizeCode support with tree-sitter summaries, read.summarize settings, and N-API Summary types/exports.
- Added tests and docs updates for path-embedded selectors, summary behavior, and explicit raw/offset SQL/read cases.
2026-05-04 04:24:33 +02:00
can1357 904caec79e chore: bump version to 14.6.6 2026-05-04 02:31:12 +02:00
can1357 a747301066 feat: enabled OpenRouter attribution and caching headers for requests
- Updated OpenAI completion request construction to include OpenRouter attribution headers and always-on cache directives (1h TTL).
- Updated image-generation requests to replace legacy X-Title with OpenRouter-specific HTTP-Referer, title, and category headers.
- Removed old OpenRouter X-Title defaults from provider options and removed the matching image-gen header assertion test.
2026-05-04 02:28:42 +02:00
can1357 c2a0253028 feat(coding-agent): added unsent editor draft persistence for resumed sessions
- Added session-draft persistence methods in SessionManager to write unsent editor text to an artifacts-sidecar draft file and delete it after single-shot consumption.
- Persisted editor text during interactive shutdown and restored that draft on resume when the editor was empty, enabling Ctrl+D draft recovery.
- Updated Ctrl+D handling in the editor/controller path and added tests covering draft round-trip, artifact cleanup, stale-draft eviction, and in-memory no-op behavior.
2026-05-04 02:20:29 +02:00
can1357 0fd1e1f637 fix(coding-agent/core): merged same-file hashline sections before executing to preserve anchors
- Wrapped hashline execution by merging same-path input sections into one combined section in execution order.
- Applied a new hashline regression test that validates sequential sections against the same file use the original snapshot even when anchors shift beyond rebase limits.
2026-05-04 02:08:38 +02:00
can1357 a7d23a11da docs(coding-agent/prompts): refined hashline patch guidance in prompt documentation
- Clarified anchor operation semantics, including the `+ ANCHOR` insert-after and `< ANCHOR` insert-before forms.
- Added guidance to prefer narrow ops for additions and deletions, reserving `= A..B` for true replacements.
- Reworked examples with an anti-pattern and preferred one-line insert variant to discourage over-broad replacements.
2026-05-04 02:08:31 +02:00
can1357 fdac4829e8 chore: bump version to 14.6.5 2026-05-04 00:21:13 +02:00
can1357 39f299ad40 refactor(coding-agent): extracted local-submission tracking into reusable helpers
- Added `recordLocalSubmission` and `withLocalSubmission` to replace inline signature set mutations across input and compaction flush paths.
- Signatures are now cleaned up automatically on delivery failure, preventing stale entries from suppressing editor-draft protection on retries.
- Extended test fixtures and added cases covering signature lifecycle for idle, streaming, and fire-and-forget submission paths.
2026-05-04 00:19:06 +02:00
can1357 d93b0b2121 chore: bump version to 14.6.4 2026-05-03 20:02:52 +02:00
can1357 0e761ef9e0 feat(coding-agent/hindsight): added per-session HindsightSessionState
- Added `HindsightSessionState` to `AgentSession` and bound hindsight lifecycle hooks to session state.
- Removed global hindsight state/queue handling and replaced it with per-session `HindsightRetainQueue` batching and scoped flushing.
- Reworked recall, reflect, and retain tools to use `session.getHindsightSessionState()` instead of sessionId-based lookup.
- Updated SDK/task/backend/controller flows to pass `session`/`parentHindsightSessionState`, scope `/memory` behavior, and document it in changelog.
2026-05-03 10:27:06 +02:00
can1357 255ef926cf feat(coding-agent): added /memory mm handlers for mental-model seeds
- Added mental-model settings and config defaults for enablement, auto-seed, refresh interval, and render budget.
- Added built-in mental-model seeds and scope-aware rendering with `<mental_models>` extraction, truncation, and tag handling.
- Added `/memory mm` aliases and handlers for list, show, refresh, history, seed, reload, and delete commands.
- Added client APIs and bootstrap/cache wiring so snippets refresh and inject into prompts on startup.
- Added tests covering seed scope behavior, rendering caps, diffs, and backend/session reload behavior.
2026-05-03 09:48:11 +02:00
can1357 e54441eaa2 fix(coding-agent/edit): resolved hashline duplicate-boundary handling
- Added a `= A..B` hashline rule and adjacent-edge guidance to the tool prompt.
- Added `HashlineReplacementGroup` and `HashlineDeleteEdit` with helpers to find anchor-target lines.
- Added `findReplacementGroup()` and duplicate-boundary absorption to normalize edits with synthetic deletes and warnings.
- Added normalization flow into `applyHashlineEdits` before bucketing, and added duplicate-boundary edge-case tests.
- Updated `CHANGELOG.md` with Added and Fixed unreleased notes for hashline boundary-line behavior.
2026-05-03 09:44:00 +02:00
can1357 7efbb6255e chore: bump version to 14.6.3 2026-05-03 09:08:15 +02:00
can1357 b36a093664 feat(coding-agent/tools): added batched memory retention and prompt-backed tool descriptions
- Loaded recall, reflect, and retain tool descriptions from new markdown prompt files.
- Updated the retain tool to accept batched `items`, enqueue each memory entry, and return the queued-memory count.
- Reworked retain tests to pass the array payload, assert pluralized queue messages, and confirm single-batch flush behavior.
2026-05-03 09:01:57 +02:00
can1357 378c757571 fix(coding-agent/edit): changed default edit separator to '~' for better reliability
- Switched HL_EDIT_SEP initialization to read from process.env, trimming the value and defaulting to "~" when missing or invalid.
- Expanded the separator documentation with benchmark data and reliability notes explaining why "~" was selected as the fallback over other candidates.
2026-05-03 08:53:31 +02:00
can1357 51dc178be8 feat(hindsight): implemented per-session hindsight retain queue auto-flush
- Added per-session retain queues with size/time auto-flush, recursive drain, and lifecycle flushes on end/clear/enqueue.
- Changed `hindsight-retain` to validate session state, enqueue writes, and return `Memory queued.` immediately.
- Added `notice` event support and handlers that route error/warning/status messages with source-aware formatting.
- Updated client and tests with shared request mapping, `RequestOptions`, `buildMemoryItem`, and expanded batch/list/doc APIs.
2026-05-03 08:51:53 +02:00
can1357 1e6235d3fc feat(coding-agent): aliased subagent sessions to shared parent Hindsight state
- Added an optional `aliasOf` link and a `pickPrimaryState` helper to track reusable parent Hindsight state.
- Updated task-depth subagent startup to reuse the latest primary state's bank, client, config, tags, and missions while returning silently when no parent exists.
- Skipped alias states in recall-snippet selection and enqueue so auto-recall/retain work only on the parent session.
2026-05-03 08:37:39 +02:00
can1357 6475247eee feat(coding-agent/tools): added recall/retain/reflect tools for hindsight sessions
- Updated tool selection logic to add memory-specific tools when the session backend is set to "hindsight".
- Ensured the new tools "recall", "retain", and "reflect" are appended only if not already requested.
2026-05-03 08:29:13 +02:00
can1357 6e8daae059 feat(coding-agent): added inline hashline parse with conflict checks
- Added inline hashline parse and apply support for `<` prepend and `+` append operations with prefix+suffix edits.
- Added fail-fast behavior to reject inline modify ops combined with delete or replace on same line.
- Renamed HASHLINE_* and mode symbols to HL_* in prompt tooling, read/search checks, and prompt templates.
- Standardized separators to `PI_HL_SEP`/`HL_EDIT_SEP` and fixed `HL_BODY_SEP='|'`, updating parser formatting behavior.
- Updated benchmark subtype constants and python cleanup test setup to use HL_* values and AgentRegistry mock failure injection.
2026-05-03 08:17:09 +02:00
can1357 067c8eb8f2 fix(coding-agent): unified plugin cache clearing and registry path resolution for plugin roots
- Replaced duplicated plugin-registry cache invalidation blocks with clearPluginRootsAndCaches in command and selector setup paths.
- Updated OMP plugin registry path resolution to use getPluginsDir for reads and cache invalidation, matching marketplace write locations.
- Removed a redundant project-scope marketplace test after centralizing cache-root invalidation logic.
2026-05-03 07:51:53 +02:00
can1357 3d8d44f86f refactor(hindsight): migrated dependency to local HindsightApi client
- Removed the `@vectorize-io/hindsight-client` dependency from both package manifests.
- Added a local `HindsightApi` client and changed `createHindsightClient` to instantiate it.
- Replaced `HindsightClient` imports/types with `HindsightApi` across backend, bank, and tests.
- Implemented `HindsightApi` `#request` handling with `fetch`, safe JSON parsing, and `HindsightError` on failures.
2026-05-03 07:47:22 +02:00
can1357 af0f740baa fix(coding-agent/edit): changed default hashline separator to backslash
- Changed the default HASHLINE_CONTENT_SEPARATOR value to a backslash when PI_HASHLINE_SEP is not provided.
- Kept the environment variable override path intact so custom separators continue to work via PI_HASHLINE_SEP.
2026-05-03 07:41:04 +02:00
can1357 7937fe55da fix(coding-agent): added memory setting defaults to RPC host override list
- Added memory.backend and memories.enabled to the RPC defaulted settings list.
- Ensured RPC hosts can pick up explicit memory configuration defaults from the settings layer.
2026-05-03 07:39:52 +02:00
can1357 b19354d8cd feat(coding-agent): added PI_HASHLINE_SEP for hashline payload separator
- Added configurable hashline separator support via `PI_HASHLINE_SEP` with `|` fallback.
- Replaced hardcoded `|` payload markers with `{{hsep}}`/`$HSEP$` in prompts, grammar, and parsing.
- Updated payload parsing to strip shared separator prefixes while preserving whitespace-only prefixes.
- Replaced `resolveLarkLidPlaceholders` with `resolveHashlineGrammarPlaceholders` and added a compatibility alias.
2026-05-03 07:39:52 +02:00
can1357 e398f83163 fix(coding-agent): removed settings entries and derived submenu options
- Removed settings UI entries for `display.tabWidth`, `stt.language`, and similar values lacking valid `ui.options`.
- Refactored `pathToSettingDef()` in `settings-defs.ts` to derive submenu options directly from schema metadata.
- Introduced `SubmenuOption`/`AnyUiMetadata` in `settings-schema.ts` and added `options: "runtime"` support for dynamic lists.
2026-05-03 07:39:52 +02:00
can1357 b59ef9eb80 fix(coding-agent/edit): fixed doubled || prefix handling in hashline parser
- Updated `collectPayload` to accept a warnings accumulator, detect doubled payload prefixes, and strip one extra leading `|` when all payload lines used the doubled form.
- Changed `parseHashlineWithWarnings` to return collected parser warnings instead of an empty list.
- Added tests confirming auto-stripping, single-line `|` preservation, and mixed-prefix payload behavior.
2026-05-03 07:39:52 +02:00
can1357 0518955e0a ux(coding-agent/modes): removed token_total from default status-line preset
- Removed the token_total segment from the default status-line preset.
- Kept the remaining left-side segment order unchanged, including cost at the end.
2026-05-03 07:39:52 +02:00
can1357 76a02c385a feat(coding-agent): added hindsight scoping modes with bank scope tags
- Added `hindsight.scoping` and `HINDSIGHT_SCOPING` with global, per-project, and per-project-tagged modes.
- Migrated legacy `raw.hindsight` handling to scoping-based behavior and removed deprecated `dynamicBankId`/`agentName` keys.
- Replaced `deriveBankId` with `computeBankScope`, returning `bankId` plus optional retain/recall tags by mode.
- Forwarded scoped tags through memory ops so recall and retain/reflect calls use `tags`, `tagsMatch`, and `recallTags`.
- Validated `scoping` values from env/settings, warning and defaulting to `per-project-tagged` when invalid.
2026-05-03 07:39:52 +02:00
can1357 d14e4ae4b9 refactor(coding-agent): standardized Hindsight memory wrappers and tool names
- Standardized Hindsight context output to emit `<memories>` blocks and updated retention stripping to remove both `<memories>` and legacy `<hindsight_memories>`/`<relevant_memories>` tags.
- Renamed built-in Hindsight tool entry points and labels from `hindsight_retain`/`hindsight_recall`/`hindsight_reflect` to `retain`, `recall`, and `reflect`, including tool availability checks.
2026-05-03 07:39:52 +02:00
can1357 d57275fb5d feat(coding-agent): made memory.backend the authoritative selector for memory backends
- Updated runtime memory config loading and backend resolution so `memory.backend === "local"` now enables the local pipeline directly, while `memories.enabled` is treated only as a legacy migration input.
- Switched the `memory.backend` default to `off` and kept `memories.enabled` hidden from the Memory tab UI for migration compatibility.
- Adjusted memory runtime, resolver, and documentation/tests to match the new backend-selection semantics.
2026-05-03 07:39:52 +02:00
can1357 7784717935 feat(coding-agent): added first-turn hindsight recall injection to startup prompts
- Added a new optional `beforeAgentStartPrompt` hook to `MemoryBackend` and implemented it in the Hindsight backend to recall long-term context for the first turn.
- Updated `AgentSession` startup flow to inject the recalled context into the turn-specific system prompt before the first response is generated.
- Preserved `<hindsight_memories>` tags in Hindsight developer instructions and added tests for first-turn injection and state caching.
2026-05-03 07:39:52 +02:00
can1357 fea97766dd fix(coding-agent/modes): applied setting visibility conditions to all setting variants
- Refactored setting definitions so the optional visibility predicate now lives on the shared base interface.
- Updated path-to-def mapping to pass the shared condition through every setting variant.
- Adjusted SettingsSelectorComponent to evaluate condition for all setting types before rendering items.
2026-05-03 07:39:52 +02:00
can1357 ce2a109c09 feat(coding-agent): added hindsight memory backends and tools
- Added `memory.backend` and `hindsight.*` settings schema with migration from `memories.enabled` legacy mode.
- Added Hindsight memory backend runtime modules for resolved config, client creation, bank ID derivation, and state lifecycle.
- Added off/local/hindsight backends and resolver wiring across SDK, commands, and compaction context.
- Added `hindsight_recall`, `hindsight_reflect`, and `hindsight_retain` tools with schema validation and backend gating.
- Added Memory tab metadata and symbols to expose backend selection in the settings UI.
- Added package export barrels and tests for bank ID, content formatting, and hindsight config env precedence.
2026-05-03 07:39:52 +02:00
can1357 c65191911e feat(coding-agent/cli): added grievance clean action to the grievances command
- Added a `list`/`clean` positional action and examples to the grievances command, along with new `--id`, `--tool`, and `--all` flags for cleaning.
- Implemented `cleanGrievances` to delete grievances by id, tool, or all entries, enforce mutually exclusive selectors, and emit JSON counts when requested.
- Updated grievance DB access to use writable handles for clean operations and reset autoincrement sequence when removing all rows.
2026-05-03 07:39:52 +02:00
can1357 7f2b25ea95 fix(tools): resolved search and find behavior for missing path inputs
- Updated search, find, ast-edit, and ast-grep to skip missing paths and run on existing ones.
- Added multi-path error handling to throw ToolError only when all provided paths are missing.
- Updated search and find outputs to surface skipped `missingPaths` in text and renderer warnings.
- Updated CHANGELOG with multi-path tool behavior updates and `search_repos` global-search notes.
- Added `PartitionedPaths` and `partitionExistingPaths` to classify existing versus missing path inputs.
- Added test helpers and fixtures for multi-path missing-path cases in search/find behavior tests.
2026-05-03 07:39:52 +02:00
can1357 58b895db23 feat(tools): added GitHub code, commit, and repo search support
- Added `search_code`, `search_commits`, and `search_repos` to GitHub tool schema, docs, and titles.
- Extended `GithubTool.execute` and search arg building to dispatch new search ops and handle args correctly.
- Added richer search formatters for code, commit, and repo results with short SHA and repository metadata.
- Added tests for code, commit, and repo search outputs and `--repo` argument behavior.
2026-05-03 07:39:52 +02:00
can1357 242b121085 chore: bump version to 14.6.2 2026-05-03 05:00:22 +02:00
can1357 ee8b4ec252 fix(coding-agent): adjusted status-line session accent handling for border gaps
- Status-line rendering now treats `statusLine.sessionAccent` as disabled only when explicitly set to false.
- Updated status-line overflow tests to assert gap colors use session accent when enabled and theme border when disabled.
- Test teardown now restores `WSL_INTEROP` and `WSL_DISTRO_NAME` environment variables after mutation.
2026-05-03 04:59:43 +02:00
can1357 581148452c fix(coding-agent/modes): prevented status-line accent lookup before settings initialization
- Added an isSettingsInitialized helper to expose whether global settings were created.
- Updated interactive mode to use the session name when settings are not yet initialized.
- Guarded the status-line accent lookup behind settings initialization to avoid premature access.
2026-05-03 04:58:12 +02:00
can1357 a1a2331d5a fix(tui): avoided OSC 11 polling on Windows Subsystem for Linux
- Added WSL detection in terminal initialization and skipped periodic OSC 11 polling when running under Windows Subsystem for Linux.
- Removed mode 2031 activity tracking and stopped OSC 11 polling immediately when DA1/Mode 2031 reports were received.
- Extended OSC 11 appearance tests to restore platform/env state and verify no polling is started under WSL.

Fixes #914
2026-05-03 04:53:38 +02:00
can1357 3f05cb23d6 test(coding-agent): updated status-line overflow test setup and assertions
- Initialized in-memory settings during test setup and reset them after tests.
- Updated the status-line border assertion to verify border glyph text and styling directly.
- Removed reliance on session accent helper functions in the session-accent test case.
2026-05-03 04:52:10 +02:00