Commit Graph

1520 Commits

Author SHA1 Message Date
can1357 f114cd8122 chore: bump version to 13.16.1 2026-03-27 11:41:22 +01:00
can1357 17d596ab44 feat: fff
- Added SearchDb class for stateful shared search database instances enabling persistent file indexing and frecency tracking across grep, glob, and fuzzyFind operations.
- Added optional db parameter to grep(), glob(), and fuzzyFind() functions for database-backed searching with improved performance via cached file indices.
- Replaced grep-searcher with fff-grep and added fff-search dependency for enhanced file discovery and search capabilities with memory-mapped file support.
- Migrated fuzzy file discovery from fd module to fff module with SearchDb integration for stateful caching and improved search performance.
- Exported SearchDb type from @oh-my-pi/pi-natives public API for type-safe usage in grep, glob, and fuzzyFind workflows.
2026-03-27 11:28:49 +01:00
can1357 c7989526c1 chore: bump version to 13.16.0 2026-03-27 04:39:25 +01:00
can1357 736aac3dfc feat(prompts/tools): clarified hashline block boundary handling with examples
- Improved hashline tool documentation with clearer guidance on block boundary handling and closing delimiter duplication prevention.
- Added concrete example demonstrating correct anchor placement when replacing entire blocks including closing braces.
- Reorganized boundary duplication warnings into actionable self-check guidance with visual comparison steps.
2026-03-27 04:39:08 +01:00
can1357 0513097761 feat(tools): added root path alias to resolve bare / to working directory
- Added root path alias feature to resolve bare `/` to session working directory in path resolution.
- Updated browser tool to use `resolveToCwd()` for consistent workspace-relative path handling.
- Added comprehensive test suite validating root path alias resolution across grep, read, find, ast_grep, and ast_edit tools.
2026-03-26 22:15:27 +01:00
can1357 18fdcde6ea refactor(coding-agent): restructured validation and rendering for consistency
- Refactored theme color validation to use single source of truth with THEME_COLOR_RECORD object.
- Simplified model registry to defer per-model overrides to dedicated method and use constant for role IDs.
- Refactored tree list rendering to pre-render items once for consistent line counts across phases.
- Refactored question result formatting to use early returns and consistently include question ID in output.
- Updated hook editor hint text to include ctrl+g external editor option when prompt style is enabled.
- Removed unused isLogicalLineStart property from LayoutLine interface in editor component.
2026-03-26 19:47:45 +01:00
can1357 3ef9466c87 Merge review/pr-379-fix 2026-03-26 19:15:57 +01:00
can1357 1d565bc3f7 Merge review/pr-477-fix 2026-03-26 19:14:52 +01:00
can1357 5390239999 Merge review/pr-538-fix 2026-03-26 19:13:08 +01:00
can1357 ebf58f7c28 chore: bump version to 13.15.3 2026-03-26 16:17:37 +01:00
daandden 6ea9504b03 Make temporary model selector keybinding configurable (#539)
Fixes #533
2026-03-26 15:33:26 +01:00
daandden b8c423e319 Fix stale OpenAI Responses replay across session boundaries (#534)
* Fix stale OpenAI Responses replay across session boundaries

Fixes #505

* Fix CI tests for session replay change

* Harden session reload and switch rollback

* Guard session switch snapshots

* fix(coding-agent): preserve responses replay snapshots
2026-03-26 15:27:58 +01:00
Vu Anh Nguyen 99ce9a0fee Merge origin/main into omp-506 2026-03-26 16:22:21 +07:00
Vu Anh Nguyen 99dabb7c18 fix(ask): keep multiline custom input in prompt gutter 2026-03-26 16:14:52 +07:00
Leo P bf9d58b8ac docs(coding-agent): update changelog for custom model tags and cycle order 2026-03-23 08:55:39 -04:00
can1357 4adaee02da chore: bump version to 13.15.0 2026-03-23 05:58:44 +01:00
can1357 2c93655796 feat(autoresearch): added auto-resume, path validation, and security guards
- Added auto-resume mechanism with state tracking to automatically resume pending experiment runs and prevent duplicate resumptions.
- Added contract path validation to reject unsafe path specifications with absolute paths and parent directory traversal attempts.
- Added secondary metrics input to autoresearch setup flow for specifying tradeoff metrics alongside primary objectives.
- Enhanced command parsing with shell operator detection to reject piped, redirected, or chained autoresearch.sh commands.
- Added prototype pollution guards in object cloning functions to prevent injection via __proto__, constructor, and prototype keys.
- Fixed boundary duplication warnings in hashline detection to properly report multiple overlapping hashline references.
2026-03-23 02:16:39 +01:00
can1357 003f46f42c feat(coding-agent/autoresearch): added contract validation and run tracking system
- Added contract system for validating benchmark commands, metrics, scope paths, constraints, and off-limits paths.
 - Contract validation enforces matching initialization parameters against autoresearch.md before init_experiment.
 - Segment fingerprinting detects configuration drift and warns when metrics are not directly comparable.
 - Added pending run detection and recovery to resume incomplete experiments from .autoresearch/runs/.
 - Run directories organize artifacts with benchmark logs and optional checks logs for traceability.
 - Extended experiment state to track run number, command, scope, off-limits, constraints, and fingerprint.
2026-03-23 01:49:03 +01:00
can1357 9e824d9235 feat(coding-agent): restructured hashline edit schema to nested loc/content objects
- Restructured hashline edit schema from flat op/pos/end/lines fields to nested loc/content objects with discriminated union types.
- Replaced operation names (replace_line, replace_range, append_at, prepend_at) with unified loc object patterns supporting line, block, append, and prepend anchors.
- Updated content field to accept array of strings or null instead of lines parameter in edit entries.
- Refactored edit resolution logic to dispatch on loc shape instead of op enum, simplifying location handling.
2026-03-23 01:45:35 +01:00
can1357 f09c5bd67c feat(patch): added boundary duplication detection to prevent off-by-one range errors
- Added boundary duplication warning to detect off-by-one range errors in replace_range and replace_line operations.
- Updated hashline tool documentation with boundary duplication trap guidance to prevent closing delimiter duplication.
2026-03-22 22:42:42 +01:00
can1357 cac628ccce feat(coding-agent): added git isolation and keybinding utilities for autoresearch
- Added git branch isolation for autoresearch sessions with automatic branch creation, reuse, and worktree safety checks.
- Added scope definition sections (Files in Scope, Off Limits, Constraints) to autoresearch template for explicit session boundaries.
- Added keybinding matcher utilities for consistent escape/cancel key handling across interactive components.
- Added ASI metadata validation (hypothesis and rollback context) in log_experiment tool for experiment tracking.
- Refactored keybinding logic across 13 components to use centralized matcher functions instead of inline key checks.
2026-03-22 21:47:48 +01:00
can1357 012e0c90b9 feat(coding-agent): renamed hashline operation types for clarity
- Renamed hashline operation types for clarity: append->append_at, prepend->prepend_at, append_eof->append_file, prepend_bof->prepend_file.
- Updated all operation type references in patch implementation, tests, and documentation to reflect new naming convention.
- Restructured hashline tool documentation with hierarchical sections and simplified examples for improved clarity.
- Consolidated validation rules and added explicit warning about invalid anchors and operation/field combinations.
2026-03-22 21:14:31 +01:00
can1357 66a478e6e6 feat(coding-agent): implemented dynamic tool activation for autoresearch lifecycle management
- Added `defaultInactive` property to ToolDefinition for conditional tool registration and activation control.
- Added dynamic tool activation/deactivation API `setActiveTools()` for managing experiment tools in autoresearch mode.
- Replaced single `command-start.md` workflow with separate `command-initialize.md` and `command-resume.md` prompts for autoresearch initialization and session resumption.
- Added interactive intent dialog for autoresearch optimization goals with automatic session resumption detection based on autoresearch.md presence.
- Refactored autoresearch command handler to distinguish resume vs initialize flows and dynamically activate/deactivate experiment tools based on mode and session state.
2026-03-22 21:14:17 +01:00
can1357 c9a7bb0c96 feat(patch): restructured hashline edits with explicit replace_line/replace_range and boundary operations
- Refactored hashline edit operations from implicit `replace` to explicit `replace_line` and `replace_range` with mandatory `end` parameter for ranges.
- Added file-level operations `append_eof` and `prepend_bof` for boundary insertions, making `pos` required for anchor-based operations.
- Enforced stricter anchor validation per operation type and simplified edit application logic by separating file-level from anchor-based operations.
- Updated hashline edit application to preserve duplicated boundary lines without auto-correction, changing previous behavior.
2026-03-22 17:17:13 +01:00
can1357 2771c2399d feat(autoresearch): introduced autonomous experiment loop with metric-driven optimization
- Added autoresearch extension with autonomous experiment loop supporting init, run, and log experiment tools for metric-driven optimization.
- Added widget placement system enabling extensions to position UI components above or below the editor via ExtensionWidgetOptions.
- Added dashboard controller with interactive overlay for viewing experiment results, metrics, and progress with keyboard navigation.
- Removed auto-correction logic for off-by-one range edits in hashline editor to preserve user intent in patch operations.
- Added state reconstruction utilities to parse autoresearch.jsonl logs and rebuild experiment state across sessions.
- Added comprehensive type definitions and helper utilities for metric parsing, ASI validation, and process management.
2026-03-22 16:50:13 +01:00
can1357 c0f5711588 revert: exclusive end 2026-03-22 16:49:49 +01:00
can1357 d4b6e869cb feat(coding-agent): implemented pattern-based bash interceptor rules + exclusive range semantics
- Changed bash interceptor configuration from boolean flags to customizable pattern-based rules array.
- Clarified hashline range replace semantics: end parameter is now strictly exclusive boundary.
- Fixed bash interceptor to apply built-in default rules when no custom patterns are configured.
- Updated hashline range validation and calculations to enforce exclusive end semantics throughout.
2026-03-22 12:53:16 +01:00
can1357 855d89cc5e feat(coding-agent): added inline markdown rendering with theme-aware styling
- Added renderInlineMarkdown() utility function to support inline markdown rendering with optional base color styling.
- Refactored ask tool to render questions and option labels with markdown formatting for improved text styling.
- Updated hook-input and hook-selector components to render titles as markdown with theme-aware styling.
- Implemented recursive token processing for nested markdown elements including bold, italic, code, links, and strikethrough.

Fixes #491
2026-03-22 12:38:07 +01:00
can1357 b64b6b8a79 feat(modes): introduced ACP mode for headless agent operation with session management and event streaming
- Added ACP (Agent Client Protocol) mode for headless agent operation via --mode acp flag.
- Integrated Agent Client Protocol SDK with session management, streaming communication, and event mapping.
- Added ensureOnDisk() method to SessionManager for immediate session persistence without requiring assistant messages.
- Changed session persistence to use atomic file rewrite for unflushed sessions.
- Implemented AcpAgent class with session management, prompt handling, MCP server configuration, and event streaming.
2026-03-22 01:35:20 +01:00
can1357 32e6379fbe chore: bump version to 13.14.0 2026-03-20 23:53:34 +01:00
can1357 4f7b61ab62 feat(coding-agent): added MCP server auto-reconnect with SSE monitoring
- Added auto-reconnect capability for MCP servers with SSE stream monitoring and exponential retry backoff.
- Added tool-level reconnect handling for retriable connection errors (ECONNREFUSED, ECONNRESET, 404/502/503).
- Added `/mcp reconnect <name>` command for manual MCP server recovery.
- Improved reconnect robustness by aborting retries when MCP configuration changes via epoch checking.
- Extended transport reconnect handling to all transport types (stdio, HTTP/SSE) with unified onClose logic.
- Added comprehensive test coverage for MCPManager reconnect behavior and tool-level abort propagation.
2026-03-20 23:48:38 +01:00
can1357 138e7e1d91 fix(interactive-mode): corrected mic cursor width measurement to prevent TUI overflow
- Fixed STT Alt+H mic cursor rendering to measure the actual microphone glyph width, preventing one-column TUI overflow crashes when the active symbol preset uses a wide icon (#484).
- Extracted mic cursor styling into dedicated method to consolidate color and width calculation logic.

Fixes #484
2026-03-20 23:40:48 +01:00
can1357 c60607bfb0 feat(coding-agent/prompts): enabled thinking and streamlined explore agent output schema
- Updated explore agent thinking level from off to med for improved reasoning.
- Simplified explore agent output schema: consolidated file references into single `ref` field with optional line ranges instead of separate `path`, `line_start`, `line_end` fields.
- Removed `code` section from explore agent output (critical code excerpts no longer extracted).
- Removed `dependencies`, `risks`, and `start_here` sections from explore agent output.
2026-03-20 23:32:07 +01:00
Miroslav Drbal [ApoC] 8b028224e3 feat: auto-reconnect MCP servers on connection loss (#482)
* feat: auto-reconnect MCP servers on connection loss

When an HTTP SSE stream drops (server restart, network interruption),
the transport fires onClose, and the manager proactively reconnects
with retry backoff (500ms, 1s, 2s, 4s). Tools are kept in the registry
during reconnection so they remain selected and available to the agent.

If proactive reconnection fails, stale tools stay registered. When the
agent calls one, the tool bridge detects the retriable connection error
(ECONNREFUSED, ECONNRESET, stale session 404/502/503, etc.), triggers
reconnectServer on the manager, and retries the call once on the fresh
connection. Concurrent reconnect attempts for the same server are deduped.

connectToServer now always installs a default onRequest handler for ping
and roots/list (using getProjectDir()), so all connections -- including
short-lived test/probe ones -- properly respond to server-initiated
requests during initialization.

Post-connection setup (resources, prompts, subscriptions) is extracted
into a shared #loadServerResourcesAndPrompts method used by both initial
connection and reconnection paths.

Add /mcp reconnect <name> command for manual recovery after extended
outages where both proactive and reactive reconnection have failed.

* docs: add changelog entry for MCP auto-reconnect

* fix: address P1 review findings in MCP reconnection

- Save server configs before connection attempt so deferred tools can
  reconnect even when the initial connection timed out (P1-1)
- Make waitForConnection() and getConnectionStatus() aware of in-flight
  reconnections so callers wait instead of failing immediately (P1-2)
- Add epoch counter incremented on disconnectAll() and checked in
  connectAndWireServer() to invalidate stale reconnect attempts that
  outlive a manager reset/reload (P1-3)
- Skip servers with pending reconnections in connectServers() to prevent
  parallel connection attempts for the same server

* fix: deferred tool reconnect and non-blocking transport teardown

- DeferredMCPTool.execute now reconnects when getConnection() fails
  ("MCP server not connected"), not only on network errors from
  callTool. Servers that missed the startup window can now be woken
  by the first tool call against their cached tools. (P1-4)
- #doReconnect fire-and-forgets the old transport close instead of
  awaiting it. HttpTransport.close() sends a DELETE with 30s timeout;
  blocking here delayed the first reconnect attempt by that amount
  on every server restart. (P1-5)

* fix: abort-aware reconnect waits and preserve tool selection on reconnect

- Wrap all reconnect() awaits with withAbort(signal) so user
  cancellation (Esc) interrupts the reconnect backoff loop instead
  of blocking for up to 7.5s. Applies to MCPTool (1 site) and
  DeferredMCPTool (2 sites). (P2-1)
- Remove activateDiscoveredMCPTools call from /mcp reconnect handler.
  refreshMCPTools already preserves the user's prior MCP tool
  selection; the extra activation was silently opting into all
  server tools including ones the user had not enabled. (P2-2)

* fix: rebind MCPTool connection after reconnect, add stdio retriable error

- MCPTool.connection is now mutable; after a successful reconnect retry,
  this.connection is rebound to the fresh connection so subsequent calls
  on the same instance (e.g. batched tool calls) use it instead of
  triggering another reconnect cycle. (P2-3)
- Add "Transport closed" to RETRIABLE_PATTERNS. StdioTransport rejects
  pending requests with this message when the subprocess dies, which
  should trigger the reconnect path just like HTTP transport errors. (P2-4)

---------

Co-authored-by: Miroslav Drbal <miroslav.drbal@gendigital.com>
Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-03-20 23:27:30 +01:00
daandden 8013be90c9 fix(ai): guard resumed OpenAI Responses replay (fixes #488) (#489)
Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-03-20 23:24:37 +01:00
Rens Tillmann c148489315 docs: add changelog for screenshot path option
Bug fixes:
- Add browser.screenshotDir to settings-schema.ts (lost during rebase conflict)
- Fix stale expandHome comment to expandPath in settings-selector.ts
- Final screenshotDir description: Directory to save screenshots with ~ support
2026-03-20 20:11:26 +01:00
can1357 999d066d71 chore: bump version to 13.13.2 2026-03-18 23:21:20 +01:00
can1357 8cab107a48 feat(coding-agent): added automatic stripping of hashline prefixes from write tool output
- Added automatic stripping of hashline display prefixes (LINE#ID:) from write tool content when hashline edit mode is enabled, preventing models from accidentally copying display markers into files.
- Implemented stripHashlinePrefixes() utility to remove hashline-only prefixes without affecting diff markers.
- Added stripWriteContent() helper to conditionally clean write content based on file display mode configuration.
- Updated write tool result message to notify users when hashline prefixes were auto-stripped.
2026-03-18 23:20:21 +01:00
can1357 09b0bad87d feat(ai): added MCP server discovery properties and refactored tool call handling
- Added mcpServerName and mcpToolName optional properties to tool definitions for MCP server discovery and tool name tracking.
- Changed aborted tool call handling to preserve existing tool results instead of replacing with synthetic 'aborted' results at turn boundaries.
- Extracted flushPendingToolCalls() and flushPendingAbortedToolCalls() helpers to consolidate orphaned tool call handling logic.
- Updated tool result handling to use message timestamps instead of Date.now() for synthetic results consistency.
2026-03-18 23:12:22 +01:00
can1357 e58908615f chore: bump version to 13.13.1 2026-03-18 23:00:40 +01:00
can1357 22a876bb8f feat(coding-agent): added automatic deduplication of context files by content
- Added automatic deduplication of identical context files by content, keeping the closest (lowest depth) copy when duplicates are discovered.
- Implemented dedupeExactContextFiles() function to filter duplicate context entries in both explicit and discovered file lists.
- Added 3 test cases covering deduplication of explicit context entries, discovered context entries, and preservation of distinct entries.
2026-03-18 23:00:17 +01:00
can1357 fb76484aa4 fix: route all app-level shortcuts through KeybindingsManager
fixes #468
2026-03-18 22:46:22 +01:00
can1357 964ee1bba8 chore: bump version to 13.13.0 2026-03-18 10:56:16 +01:00
can1357 7cd4c65574 feat(coding-agent): added auto-generated file detection controls and improved accuracy
- Added `edit.blockAutoGenerated` setting to control enforcement of auto-generated file detection.
- Improved auto-generated file detection to use language-specific comment parsing instead of broad regex patterns, reducing false positives.
- Enhanced marker detection to scan only leading header comments (1024-byte limit) rather than entire file prefix for better accuracy.
- Fixed tool argument validation to properly handle string 'null' values on optional LLM tool arguments.
- Improved type safety by changing validateToolCall and validateToolArguments return types from any to ToolCall["arguments"].
2026-03-18 10:53:37 +01:00
can1357 22a08d6534 feat(tools): added auto-generated file guard to prevent tool modifications
- Added auto-generated file detection guard to prevent modification of generated code in Edit and Write tools.
- Implemented checkAutoGeneratedFile() to validate file paths against auto-generated markers (protoc, sqlc, buf, swagger).
- Implemented checkAutoGeneratedFileContent() to scan file content prefix for auto-generated patterns before processing.
- Added pre-write validation in Write tool to block overwriting of auto-generated files.
2026-03-18 09:18:38 +01:00
can1357 88cb72b653 chore: bump version to 13.12.10 2026-03-17 19:42:38 +01:00
can1357 f8b73cc3d7 feat(coding-agent/ipy): added command tracking and exit code handling to ShellResult
- Added `args` field to ShellResult to capture the executed command.
- Added `exit_code` property to ShellResult as an alias for `returncode`.
- Added `check_returncode()` method to ShellResult to raise CalledProcessError on non-zero exit codes.
- Renamed `code` field to `returncode` in ShellResult with backward-compatible `code` property.
- Updated `run()` command documentation to clarify available ShellResult fields.
2026-03-17 19:26:28 +01:00
can1357 ca332be917 chore: bump version to 13.12.9 2026-03-17 16:50:20 +01:00
can1357 afc2276a12 refactor(ai): extracted OpenAI compat logic into dedicated module
- Extracted OpenAI compatibility detection and resolution logic into dedicated `openai-completions-compat` module.
- Refactored `detectCompat()` and `getCompat()` to delegate to new compat module functions with simplified conditional logic.
- Fixed OAuth redirect URI validation to preserve exact configured values without trailing slash normalization.
- Improved session deletion to return boolean status and display error messages in UI instead of silently failing.
- Added `/session delete` command with Delete key support and confirmation dialogs for session management.
2026-03-17 16:07:26 +01:00
slact 2825c894f5 feat: session deletion (#448)
* feat: session deletion

* better session deletion cleanup error handling

* fix: complete deletion including artifacts
fix: native confirmation for session deletion

* even better native configmation for session picker

* fix(coding-agent): detach active session before deletion

* fix(coding-agent): keep failed session deletes visible

* fix(coding-agent): await session delete command

* fix(coding-agent): surface session artifact cleanup failures

---------

Co-authored-by: can1357 <me@can.ac>
Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-03-17 14:51:21 +01:00