Commit Graph

2609 Commits

Author SHA1 Message Date
can1357 3056caee91 chore: reformat 2026-03-14 10:46:26 +01:00
can1357 7bf5cea3a3 fix(coding-agent): externalize provider image urls
Fixes #389
2026-03-14 10:46:13 +01:00
inprealpha 68894ab78b fix(coding-agent): attribute automatic compaction as agent (#397)
* fix(coding-agent): preserve Copilot initiator for auto-compaction

* fix(coding-agent): scope compaction initiator to auto mode

* test(ai): cover copilot initiator override in providers
2026-03-14 10:43:00 +01:00
maximhar 952db9fd93 feat: add ephemeral /btw side-question panel (#399)
* feat: add ephemeral /btw side-question panel

* fix: preserve /btw live context and payload hooks

* fix: send /btw question through session pipeline
2026-03-14 10:42:26 +01:00
Rens Tillmann 820a17aa29 fix(memories): isolate Phase 2 consolidation per project working directory (#401)
* fix(memories): isolate Phase 2 consolidation per project working directory

The global memory consolidation job used a single 'global' job key,
causing all projects to share one Phase 2 slot. Whichever project
claimed it first got every project's stage1 outputs written into its
memory directory — cross-project contamination.

Root cause:
- GLOBAL_KEY = 'global' was a single key shared by all projects
- listStage1OutputsForGlobal() had no cwd filter — returned ALL
  stage1 outputs across all projects
- markGlobalPhase2Succeeded/Failed/Unowned all operated on the same
  single global job row

Fix:
- Replace GLOBAL_KEY constant with globalJobKey(cwd) function that
  namespaces the job key per project: 'global:/path/to/project'
- Add cwd parameter to all Phase 2 storage functions so each project
  maintains its own job slot in the jobs table
- Filter listStage1OutputsForGlobal() by t.cwd = ? so each project
  only consolidates its own thread outputs
- Thread cwd from session.sessionManager.getCwd() through runPhase2()
  to all storage calls
- Add cwd to markStage1SucceededWithOutput/NoOutput so enqueueGlobal
  Watermark targets the correct per-project job key
- Add cwd parameter to enqueueMemoryConsolidation() public API and
  update its only external caller (command-controller)

Closes #369

* test(memories): add isolation tests for per-project Phase 2 consolidation

Three tests covering the regression fixed in the previous commit:
- listStage1OutputsForGlobal filters outputs by cwd (no cross-project leak)
- enqueueGlobalWatermark creates separate job rows keyed per-project
- tryClaimGlobalPhase2Job claims only the requested project's slot and
  leaves the other project's job independently claimable

* docs: add inline comments for memory isolation fix and tests

---------

Co-authored-by: Rens Tillmann <rens@super-forms.com>
2026-03-14 10:41:37 +01:00
ravshansbox 99b6be6518 Include off in thinking level cycling (#404) 2026-03-14 10:41:06 +01:00
can1357 6fc41a1599 chore: bump version to 13.11.1 2026-03-13 15:30:17 +01:00
can1357 ef392a330b style: reformat 2026-03-13 15:30:04 +01:00
can1357 4b6036a90f chore: stale comment removed 2026-03-13 15:27:43 +01:00
Gregor 15c7429ad0 add llama.cpp as local provider (#370)
* add llama.cpp as local provider

* use responses api instead of messages

* use api-keys correctly for llama.cpp provider

---------

Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-03-13 15:16:53 +01:00
Sense_wang f6e373bb9e fix(coding-agent): skip skills disabled via frontmatter (#382)
Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
2026-03-13 15:14:05 +01:00
can1357 24b0d3269c feat(coding-agent/patch): added line hashes to compact diff preview
- Added line hashes to compact diff preview for unchanged and added lines to enable integrity verification.
- Modified compact diff preview to track line number synchronization between old and new files when processing insertions and deletions.
- Fixed line number parsing in compact diff preview to handle variable-width line number fields with leading whitespace.
- Extracted parsing and formatting logic into dedicated functions (parseNumberedDiffLine, formatCompactHashlineLine, syncOldLineCounters, syncNewLineCounters) for maintainability.
- Updated 4 test cases to verify line hash generation, line number synchronization, and handling of variable-width fields.
2026-03-13 15:11:46 +01:00
Adrian Glapiński 87c48cd39b fix(lsp): check root markers when config overrides are present (#367)
When an lsp config file exists (e.g. ~/.omp/agent/lsp.yml), the override
path skipped root marker validation and started every non-disabled server
with a resolvable binary — regardless of whether the project matched that
server's language. This caused unrelated LSP servers to start in every
project (e.g. metals in a Java-only project, jdtls in a Rust project).

Add the same hasRootMarkers check that the auto-detect path already uses.
2026-03-13 15:08:23 +01:00
Adrian Glapiński b1248dadf6 feat(lsp): replace deprecated kotlin-language-server with official kotlin-lsp (#368)
The fwcd/kotlin-language-server is deprecated in favor of the official
JetBrains Kotlin LSP (github.com/Kotlin/kotlin-lsp). Update the default
server entry to use kotlin-lsp with --stdio arg.

Install: brew install JetBrains/utils/kotlin-lsp
2026-03-13 15:07:56 +01:00
Magicien 049dcc46d0 fix(coding-agent): reset powerbar immediately on new session (#371) 2026-03-13 15:07:11 +01:00
Sense_wang 3c643bd01f fix(coding-agent): fail early when plan file is missing (#381)
Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
2026-03-13 15:05:26 +01:00
can1357 09c0d28193 fix(coding-agent): corrected boolean coercion in fetch and executor modules
- Fixed boolean type coercion in fetch and executor modules by wrapping truncation flags with Boolean() cast.
- Removed maxBytes property from truncation metadata to simplify output metadata structure.
- Normalized optional result properties with explicit fallbacks in output-meta module.
- Updated test expectations to reflect undefined truncation properties instead of false/null values.
2026-03-13 15:05:11 +01:00
can1357 6a9e6c0ce9 feat: don't prefix protocol results, enforce full read for skill
- Simplified TruncationResult interface by making maxLines, maxBytes, and other derived fields optional, reducing redundancy.
- Refactored noTruncResult helper to auto-compute totalLines and totalBytes, eliminating repetitive parameter passing.
- Removed truncatedBy null checks and conditional formatting logic in truncation notice functions for cleaner output.
- Consolidated internal URL handling to use noTruncResult and removed unused displayMode variable.
- Clarified documentation in read.md to distinguish filesystem output from text output formatting.
2026-03-13 15:05:11 +01:00
can1357 7aafa7547a feat(coding-agent): introduced pluggable code search provider system
- Added pluggable code search provider system supporting Exa and grep.app with provider selection via `providers.codeSearch` setting.
- Removed Exa-specific tools (`exa_linkedin`, `exa_company`, `exa_search_deep`, `exa_crawl`) and simplified web search tools to focus on core functionality.
- Refactored code search from Exa-only to provider-agnostic architecture with new `code_search` tool supporting context-aware grep.app queries and Exa fallback.
- Removed `exa.enableLinkedin` and `exa.enableCompany` configuration settings in favor of provider-based architecture.
- Added comprehensive test coverage for code search functionality including grep.app result normalization and provider fallback behavior.
2026-03-13 15:05:10 +01:00
can1357 2fcfc335dd fix(coding-agent): initialize settings in YouTube parallel test 2026-03-12 22:55:42 +01:00
can1357 7ab04f617e chore: bump version to 13.11.0 2026-03-12 17:38:11 +01:00
can1357 09e73b549b refactor(coding-agent/tools): restructured tools to inject Settings through render functions
- Threaded Settings parameter through renderUrl and renderHtmlToText functions for dependency injection.
- Changed settings import from default export to type-only import in fetch.ts.
- Added vi.clearAllMocks() calls to test setup hooks for proper mock isolation.
2026-03-12 17:37:52 +01:00
can1357 7040d58396 feat(coding-agent): added Parallel AI provider for web search and content extraction
- Added Parallel AI provider integration for web search with fast and research modes.
- Added Parallel extract API for URL content and YouTube video extraction with fallback support.
- Added /login parallel command and PARALLEL_API_KEY environment variable authentication.
- Added providers.parallelFetch configuration setting to control Parallel extract usage.
- Integrated Parallel provider into web search priority order between Exa and Kagi.
- Updated HTML-to-text and YouTube scrapers to prefer Parallel extract over fallback providers.
2026-03-12 17:08:35 +01:00
can1357 afcb2ec52a fix(coding-agent/utils): corrected buffer encoding in image utilities
- Corrected buffer-to-base64 conversion by wrapping raw buffers with Buffer.from() to ensure proper encoding across image processing utilities.
- Updated 6 buffer conversion calls in fetch, image-input, and image-resize modules for consistency.
2026-03-11 16:59:50 +01:00
can1357 f751d413a5 refactor(prompts): clarified hashline tool documentation structure
- Simplified hashline tool documentation by consolidating workflow and checklist sections into concise opening guidance.
- Reorganized examples to emphasize block-boundary shapes (a) and (b) with clearer bad/good comparisons.
- Removed redundant rules section and integrated key constraints into critical section for single source of truth.
2026-03-11 03:49:01 +01:00
can1357 79840b07f4 refactor(prompts): clarified hashline tool behavior across operations
- Clarified hashline tool documentation to distinguish behavior of `lines` field across `replace`, `prepend`, and `append` operations.
- Refined `edits[n].pos` description to specify 'first line' for replace operation.
2026-03-11 03:48:55 +01:00
can1357 d393d01b97 fix(hashline): corrected no-op detection to check array length before comparing lines
- Fixed line normalization to trim trailing whitespace and strip carriage returns instead of removing all whitespace.
- Fixed no-op detection to check array length equality before comparing lines, preventing false classification of multi-line expansions.
- Added clarification to hashline tool documentation on `replace` operation semantics and `lines` boundary constraints.
- Added test case validating single-line to multi-line expansion behavior and firstChangedLine calculation.
2026-03-11 03:21:21 +01:00
can1357 bf0b6de4fa refactor(lsp): extracted diagnostic formatting into reusable utility
- Extracted diagnostic message formatting into reusable `formatGroupedDiagnosticMessages()` utility function.
- Consolidated diagnostic output formatting across lsp/index.ts and tools/output-meta.ts to use shared utility.
- Added `DIAG_PATH_RE` regex pattern to parse diagnostic message format with file path, line, and column.
2026-03-11 03:18:01 +01:00
can1357 ffa208adcf feat(modes): added /copy subcommands for flexible code and command extraction
- Added `/copy` command subcommands (code, all, cmd, last) for flexible code block and command copying.
- Added support for copying last executed bash or python command via `/copy cmd` subcommand.
- Refactored handleCopyCommand() to route subcommands with dedicated private methods for each copy operation.
- Added regex-based code block extraction from markdown with fallback warnings for missing blocks.
2026-03-11 03:08:51 +01:00
can1357 c8d4946d70 feat(coding-agent): refactored eager todo messaging for cleaner categorization
- Changed eager todo reminder message role from 'developer' to 'custom' with customType field for better message categorization.
- Removed userRequest parameter from eager todo prelude generation to simplify prompt template rendering.
- Updated eager todo prompt to avoid redundant todo_write calls unless task state materially changed.
- Modified eager todo reminder message to use string content with display: false property instead of array format.
2026-03-11 03:08:32 +01:00
can1357 1932b35062 refactor(session): restructured eager todo injection to prepended message pattern
- Refactored eager todo injection from recursive prompt call to prepended message pattern.
- Removed state fields for todo injection tracking and consolidated logic into message composition.
- Added prependMessages option to promptWithMessage for composing messages before main prompt.
- Updated system prompt to require todo creation before substantive work on user requests.
2026-03-11 02:52:39 +01:00
can1357 b18a528ff7 fix(coding-agent/session): fixed race condition in eager todo prompt handling on user abort
- Fixed race condition where outer prompt would continue after user abort during eager todo's inner prompt by checking generation counter before proceeding.
2026-03-11 01:11:30 +01:00
can1357 a1be87ad9b feat(coding-agent/task): added optional assignment field to track raw task text separately from templates
- Added optional `assignment` field to task result and progress interfaces to track raw per-task assignment text separately from full templated task.
- Updated task rendering to display assignment text instead of full task template when available, improving clarity of task display.
- Modified task section rendering to show trimmed assignment text with fallback to task field if assignment is not available.
- Propagated assignment field through task executor, template renderer, and result objects to maintain consistency across task processing pipeline.
2026-03-11 01:11:20 +01:00
can1357 2a5968ec47 fix(tui): fixed OSC 11 background color detection and query race conditions
- Fixed OSC 11 background color detection to handle partial escape sequences that arrive mid-buffer, preventing user input from being swallowed.
- Fixed race condition where overlapping OSC 11 queries would be incorrectly cancelled by DA1 sentinels from previous queries by implementing a query queueing mechanism.
- Refactored OSC 11 query handling to use queuing instead of immediate restart, improving robustness of terminal appearance detection.
- Added comprehensive test coverage for terminal appearance detection including partial buffer handling, query queueing, and debouncing behavior.
- Added test cases for theme auto-detection to verify terminal-reported appearance takes precedence over environment variables and platform-specific detection.
2026-03-11 01:11:00 +01:00
汐 af383e5618 fix(path): PI_CONFIG_DIR discovery (#358)
* fix(path): PI_CONFIG_DIR discovery

* refactor: centralize agent dir name into getConfigAgentDirName()

- Add getConfigAgentDirName() to utils/dirs.ts as single source of truth
- Replace duplicated "/agent" suffix construction in helpers.ts and config.ts
- Let biome format mcp/manager.ts canonically

---------

Co-authored-by: can1357 <me@can.ac>
2026-03-11 01:07:57 +01:00
lederniermagicien 486fd4c753 refactor(theme): replace CoreFoundation FFI with OSC 11 for machine-agnostic dark/light detection (#347)
* refactor(theme): replace CoreFoundation FFI + Mode 2031 with OSC 11 for dark/light detection

Replace the 415-line Rust CoreFoundation FFI module and Mode 2031-only
detection with OSC 11 background color queries — the machine-agnostic
method used by Neovim, fish, bat, and terminal-colorsaurus.

Detection stack:
- OSC 11 query + DA1 sentinel at startup (works over SSH, mobile clients)
- Mode 2031 subscribe: re-queries OSC 11 with 100ms debounce (Neovim
  convention) instead of trusting binary dark/light value directly
- 2s OSC 11 poll for terminals without Mode 2031 (Warp, Alacritty,
  WezTerm, iTerm2); self-disables once Mode 2031 fires
- COLORFGBG env var fallback (free, no I/O)
- macOS defaults read fallback (Zellij edge case)

Deleted:
- crates/pi-natives/src/appearance.rs (414 lines of unsafe FFI)
- packages/natives/src/appearance/ (66 lines of TS bindings)
- macOS appearance observer and SIGWINCH coupling in theme.ts

Net: -424 lines. Rust crate lighter, detection works over SSH.

* fix(theme): ignore bogus zellij osc11 dark reading

* fix(theme): scope macOS fallback to broken terminal paths

* fix(tui): swallow DA1 sentinels for OSC 11 probes

---------

Co-authored-by: can1357 <me@can.ac>
2026-03-11 00:58:17 +01:00
can1357 1a5bbc3e51 feat(coding-agent): added details field to TodoItem for storing implementation specifics
- Added optional `details` field to TodoItem type for storing implementation specifics, file paths, and edge cases.
- Enhanced todo item display to show multi-line details with automatic indentation in interactive and reminder modes.
- Updated eager-todo system prompt to enforce separation of short task content (5-10 words) from detailed implementation information.
- Extended TodoWriteTool to support creating and updating tasks with details field via add_task and update operations.
- Added comprehensive test coverage for details field handling across todo operations (replace, add_task, update).
2026-03-11 00:56:54 +01:00
can1357 6535e9ce7e fix(coding-agent/tools): fixed path resolution to accept bare directory names in path lists
- Fixed path resolution to accept bare directory names without trailing slashes in comma/space-separated path lists.
- Added existence check for bare path tokens before rejecting them as invalid, allowing directory names like 'packages' to be resolved correctly.
- Added test case verifying grep tool accepts bare space-separated directory names without trailing slashes.
2026-03-11 00:55:12 +01:00
can1357 bb0026cb32 feat(coding-agent): added eager todo configuration and per-turn tool choice overrides
- Added 'todo.eager' configuration setting to automatically create a comprehensive todo list after the first user message.
- Added 'buildNamedToolChoice' utility function to build provider-aware tool choice constraints for named tools.
- Modified tool choice resolution to support per-turn tool choice overrides via consumeNextToolChoiceOverride() method.
- Implemented eager todo enforcement mechanism that injects a synthetic prompt to encourage todo creation when conditions are met.
- Extracted tool choice building logic into reusable utility module for better code organization.
- Added comprehensive test coverage for eager todo enforcement functionality in AgentSession.
2026-03-11 00:54:55 +01:00
can1357 08a4fe78a2 fix(coding-agent/modes): corrected role model cycling order to [smol, default, slow]
- Corrected role model cycling order from [slow, default, smol] to [smol, default, slow] to match expected progression.
2026-03-11 00:21:51 +01:00
can1357 4ed4cfb27c fix: honor per-role thinking in modelRoles helpers
Fixes #186
2026-03-11 00:03:48 +01:00
can1357 36d2fed5d9 fix(coding-agent/tools): fixed error messages in tools to reference correct scope path variable
- Corrected error messages in ast-edit, ast-grep, grep, and find tools to reference the correct scope path variable instead of incorrect variable names.
2026-03-10 23:59:44 +01:00
can1357 88364ee830 feat(coding-agent/tools): added multi-path search support to find, grep, ast_grep, and ast_edit tools
- Added support for comma/space-separated path lists in find, grep, ast_grep, and ast_edit tools, allowing users to search multiple directories with a single query (e.g., 'apps/,packages/,phases/' or 'apps/ packages/ phases/').
- Added resolveMultiSearchPath and resolveMultiFindPattern utility functions to path-utils for intelligent parsing and resolution of multi-path search inputs with automatic common base path detection.
- Updated tool documentation for find, grep, ast_grep, and ast_edit to clarify that path parameters accept files, directories, glob patterns, or comma/space-separated path lists.
- Refactored path resolution logic in find, grep, ast_grep, and ast_edit tools to use unified multi-path handling with intelligent delimiter detection (comma or whitespace).
2026-03-10 22:35:32 +01:00
can1357 61aa2c2bee chore: bump version to 13.10.1 2026-03-10 20:15:23 +01:00
can1357 7818c5c316 feat(coding-agent): enabled interactive input submission and fixed continue path state handling
- Exported `submitInteractiveInput()` function for programmatic submission of user input in interactive mode.
- Fixed continue special path to skip optimistic submission state check for already-started prompts.
- Added 2 test cases covering continue submission behavior and optimistic state cancellation.
2026-03-10 20:15:03 +01:00
can1357 48927fd5dc fix(coding-agent/tools): corrected tool output to hide internal harness fields
- Added `__partialJson` to hidden argument keys to prevent internal harness fields from appearing in user-facing tool output.
2026-03-10 20:01:58 +01:00
can1357 bcfbc710de fix(mcp): force OAuth token refresh on 401/403 auth errors
#resolveAuthConfig only refreshed tokens within the 5-minute pre-expiry
window, so the onAuthError retry path reused stale credentials when
tokens were revoked, clocks skewed, or expires was missing. Add a
forceRefresh parameter and pass true from the auth error handler so
401/403 always triggers an unconditional refresh attempt.
2026-03-10 18:40:18 +01:00
Kevin Loftis 6f02d42eb4 feat: add MCP OAuth token refresh (#359)
* Add OAuth token refresh for MCP connections

Proactive refresh with 5-minute buffer before token expiry, plus
retry on 401/403 with automatic token refresh for HTTP transports.
Persist tokenUrl, clientId, and clientSecret in auth config so
refresh can happen without re-prompting the user.

* docs(coding-agent): updated CHANGELOG for MCP OAuth token refresh
2026-03-10 18:31:01 +01:00
Miroslav Drbal [ApoC] 49adac4890 fix(coding-agent): fix EBUSY crash in terminal breadcrumb write on Windows (#357)
writeTerminalBreadcrumb used void Bun.write() — discarding the promise.
When parallel tasks write the same breadcrumb file concurrently on
Windows, Bun.write fails with EBUSY. The discarded promise rejects
unhandled, crashing the process.

Replace void with .catch(() => {}) to properly swallow best-effort
failures.

Co-authored-by: Miroslav Drbal <miroslav.drbal@gendigital.com>
2026-03-10 18:29:40 +01:00
Adrian Glapiński 224fa9680b fix(coding-agent): clarify Exa web search settings (#356)
* fix(coding-agent): clarify Exa web search settings

* Delete packages/coding-agent/test/settings-defs.test.ts

---------

Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-03-10 18:29:21 +01:00