Commit Graph

2570 Commits

Author SHA1 Message Date
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
can1357 535a828f9c chore: bump version to 13.10.0 2026-03-10 08:10:33 +01:00
can1357 2d808ec99a docs(coding-agent/prompts): clarified block-boundary edit shapes in hashline tool docs
- Restructured hashline tool documentation to clarify block-boundary edit shapes and consolidate critical rules.
- Removed redundant recovery section and merged guidance into main rules for improved clarity.
- Reorganized examples to explicitly label shape (a) and shape (b) block replacement patterns.
2026-03-10 08:07:52 +01:00
can1357 0ac395d153 fix(compaction): preserved text signature metadata during OpenAI history build
- Preserved text signature metadata (id and phase) when building OpenAI native history during session compaction.
- Added test case validating that codex assistant text signature metadata is correctly preserved in remote compaction history.
2026-03-10 07:52:01 +01:00
can1357 2a56458fa9 chore: bump version to 13.9.16 2026-03-10 07:45:20 +01:00
can1357 02a32d5b9a refactor: migrated OpenAI stream processing to shared module
- Extracted OpenAI Responses API stream processing logic into shared module with 424 lines of reusable utilities.
- Consolidated text signature encoding, tool call normalization, and message conversion functions into openai-responses-shared module.
- Refactored openai-responses.ts and azure-openai-responses.ts to delegate stream processing to shared processResponsesStream() helper.
- Removed 473 lines of duplicated stream event handling and utility functions across OpenAI provider implementations.
2026-03-10 07:43:36 +01:00
can1357 1962938fa5 feat: added payload interception and signature metadata for provider requests
- Added `onPayload` callback option to intercept and transform provider request payloads before transmission across agent and AI packages.
- Added structured text signature metadata with phase information to OpenAI and Azure OpenAI providers for enhanced response tracking.
- Added `before_provider_request` extension event to coding-agent for chaining payload transformations across multiple handlers.
- Improved error messages in `response.failed` events with detailed error codes, messages, and incomplete reasons from provider responses.
2026-03-10 07:38:13 +01:00
elliotllliu a648772ae5 fix: auto-retry on OpenAI stream stall errors (#355)
When the OpenAI responses stream stalls (e.g. with github-copilot/
gpt-5.4), the error message "stream stalled while waiting for the
next event" is now recognized as a retryable transient error.

Two locations updated:
- packages/ai/src/utils/retry.ts: add "stream stall" to
  TRANSIENT_MESSAGE_PATTERN (used by provider-level retry logic)
- packages/coding-agent/src/session/agent-session.ts: add
  "stream stall" to #isRetryableErrorMessage() regex (used by
  agent-session retry loop for both thrown errors and error
  AssistantMessages)

Fixes #348

Co-authored-by: GitHub User <user@example.com>
2026-03-10 07:28:16 +01:00
can1357 acf4b45062 fix(coding-agent): backported pi-mono changes (5133697..15e0957b0)
packages/ai:
- fix: improve GitHub Copilot OAuth polling and Codex stream recovery
- fix: allow google-vertex authentication via GOOGLE_CLOUD_API_KEY
- fix: send Gemini/Claude provider-specific thinking headers and thought-signature fallbacks correctly
- test: added coverage for Gemini CLI alignment, Codex streaming, and stream edge cases

packages/coding-agent:
- feat: add treeFilterMode setting for the session tree selector default
- fix: prefer later-loaded explicit extensions when commands conflict
- fix: truncate serialized tool results during compaction summarization to prevent overflow
- fix: normalize CRLF in write tool previews
- fix: use shell-based external editor launch on Windows
- test: added compaction serialization and extension runner precedence coverage

packages/tui:
- fix: chain slash-command argument autocomplete after tab-completing the command name
- fix: normalize pasted tabs in Input using configured indentation
- fix: render blockquote lists, tables, and fenced code blocks correctly
- fix: ignore unsupported Kitty CSI-u modifiers and enable modifyOtherKeys fallback cleanup
- test: added editor, input, keys, and markdown regression coverage
2026-03-10 07:27:30 +01:00
can1357 0eff46b0f3 feat(ai): added model-specific credential selection with plan-based prioritization
- Added `modelId` parameter to `getApiKey()` for model-specific credential selection.
- Implemented plan-based account prioritization for OpenAI Codex Pro models, preferring Pro plan accounts.
- Added `AuthApiKeyOptions` type to support model-specific authentication configuration.
- Added helper functions for OpenAI Codex Pro model detection and plan-based ranking logic.
2026-03-10 07:13:48 +01:00
can1357 82e4f168b9 feat: implemented background model discovery with provider caching for faster startup
- Added background model discovery with provider status tracking and 24-hour model caching to improve startup performance.
- Changed model discovery timeout from 3000ms to 250ms and deferred blocking refresh to background operations for faster initialization.
- Fixed model discovery to preserve cached models when providers are unavailable or unauthenticated.
- Added validation in Kitty key formatting to reject unsupported modifiers and improved error handling.
- Reorganized CI workflow to run TypeScript linting in check job and conditional Rust checks in native job matrix.
- Updated system prompt and tool guidance to recommend combined investigation-and-edit workflows and maintainable code practices.
2026-03-10 07:08:00 +01:00
can1357 6e98995085 refactor(web-search): simplified web-search API by removing provider param
- Removed provider parameter from web search tool schema; provider selection now handled internally.
- Removed deprecated no_fallback option from search parameters; fallback behavior is now automatic.
- Renamed SearchParams type to SearchToolParams and introduced SearchQueryParams for CLI queries.
- Updated executeSearch() to accept SearchQueryParams with optional provider selection.
2026-03-10 06:26:09 +01:00
can1357 f256376e90 feat(coding-agent): added cancellation support for pending user submissions
- Introduced SubmittedUserInput type to track submission state including cancelled and started flags. Added startPendingSubmission, cancelPendingSubmission, markPendingSubmissionStarted, and finishPendingSubmission methods to manage the lifecycle of user input submissions. Enhanced escape key handling to prioritize canceling pending optimistic submissions before aborting active sessions.
2026-03-10 06:25:38 +01:00
can1357 dc90bb15c0 chore: bump version to 13.9.15 2026-03-10 05:51:27 +01:00
can1357 e019a3e352 refactor(coding-agent): restructured loading animation lifecycle into ensureLoadingAnimation
- Extracted loading animation lifecycle management into centralized ensureLoadingAnimation() method.
- Consolidated duplicate loading animation setup across event-controller and interactive-mode into single reusable method.
- Updated showError() to properly clean up loading animation state when errors occur.
- Added comprehensive test coverage for InputController escape key behavior with optimistic submission.
2026-03-10 05:51:09 +01:00
can1357 8fe602173b chore: bump version to 13.9.14 2026-03-10 04:24:07 +01:00
can1357 fc9cd327f7 refactor: less tools for explore, less enthusiastic exploring 2026-03-10 04:23:54 +01:00
can1357 d30d55119c chore: bump version to 13.9.13 2026-03-10 04:10:50 +01:00
can1357 d139e30e1d test(coding-agent): updated interactive mode status test to use buildSessionContext
- Imported buildSessionContext from session-manager module.
- Replaced inline session context object with buildSessionContext factory call in test assertion.
2026-03-10 04:10:36 +01:00
can1357 e27afce0b2 feat: system prompt changes + better AST-grep guidance 2026-03-10 04:08:08 +01:00
can1357 0015dff67a fix(coding-agent/config): changed inspect_image.enabled default from true to false
- Updated the default value for the inspect_image.enabled setting to false to align with expected behavior.
2026-03-10 02:54:09 +01:00
maximhar b24a4fe600 Fix provider-scoped Responses history replay (#338) 2026-03-10 02:54:01 +01:00
maximhar 6394a87da2 feat(coding-agent): add inspect_image tool and image guidance flow (#295)
* feat(coding-agent): add inspect_image tool with dedicated renderer

Closes #280

* test(coding-agent): adapt block-images read test for inspect_image default

* fix(coding-agent): satisfy resolver test formatting

* test(coding-agent): stabilize inspect image tool tests

* test(coding-agent): normalize inspect image stubs
2026-03-10 02:49:32 +01:00
Miroslav Drbal [ApoC] ef33f7b4c8 fix(coding-agent): show compaction summary after manual /compact (#318)
The manual /compact command path in executeCompaction() called
rebuildChatFromMessages() but never added the compactionSummary
message to the chat. The auto-compaction path in event-controller
explicitly adds it, but the manual path was missing this step.

Capture the CompactionResult returned by session.compact() and
render the summary via addMessageToChat(), matching the behavior
of the auto-compaction flow.

Co-authored-by: Miroslav Drbal <miroslav.drbal@gendigital.com>
2026-03-10 02:48:52 +01:00
can1357 b73b9ba64d revert(coding-agent/config): restored hardcoded model policies application in registry
- Reapplied #applyHardcodedModelPolicies method to enforce gpt-5.4 context window policy across all model loading paths.
- Updated model registry to apply hardcoded policies after both initial load and dynamic discovery.
- Adjusted test expectations to reflect the restored policy enforcement behavior.
2026-03-10 02:46:42 +01:00
can1357 206839254d fix(coding-agent): clear stale optimistic user state on rebuild 2026-03-10 02:43:09 +01:00
ravshansbox c4715a918a Fix delayed display of submitted user messages (#312) 2026-03-10 02:42:46 +01:00
can1357 6eb5b3fc59 chore: bump version to 13.9.12 2026-03-09 16:15:02 +01:00
can1357 f728fcb2c3 fix(tests): type safety in signature persistence 2026-03-09 16:14:49 +01:00
can1357 68ae4b7bee feat(coding-agent): added Tavily web search provider with OAuth auth
- Added Tavily web search provider with API key authentication and credential discovery from environment or database.
- Integrated Tavily as highest-priority search provider in fallback chain with structured response mapping and error handling.
- Added Tavily OAuth login flow in CLI and auth-storage with manual API key input and validation.
- Added comprehensive test suite for Tavily provider covering registration, response mapping, error handling, and credential validation.

Fixes #313
2026-03-09 16:11:38 +01:00
can1357 46be698745 feat(coding-agent): removed Kagi summarizer integration from fetch tool
- Removed Kagi Universal Summarizer integration from fetch tool and YouTube scraper.
- Removed `fetch.useKagiSummarizer` configuration setting from settings schema.
- Simplified renderHtmlToText() and renderUrl() functions by removing Kagi summarization fallback logic.
- Fixed indentation inconsistencies in test files from tabs to spaces.
2026-03-09 15:56:04 +01:00
can1357 2ec4401bcd fix: isolate auto-compaction abort state
Fixes #275
2026-03-09 15:54:24 +01:00
can1357 d74cd0de5c fix handoff system prompt reset 2026-03-09 15:52:34 +01:00
can1357 adce19b3ae fix exa fallback availability review 2026-03-09 15:45:33 +01:00
Eric Pfister 92faa65b54 fix: web search falls through to Exa when Anthropic api_key is stored in DB (#322)
findAnthropicAuth() only checked OAuth credentials in agent.db, missing
api_key type credentials entirely. Users authenticated via stored API key
(not env var, not OAuth) got null from isAvailable(), causing the provider
chain to skip Anthropic.

Added tier 4 (api_key in agent.db) between OAuth check and env var
fallback. Refactored store lifecycle so tiers 3-4 share one instance.

Also fixed ExaProvider.isAvailable() which unconditionally returned true,
ignoring exa.enabled/exa.enableSearch settings and never checking for
credentials. It now respects both settings and requires an actual API key.
2026-03-09 15:45:19 +01:00
Miroslav Drbal [ApoC] 24c3cf232b fix(session): bypass user-prompt pipeline in handoff (#331)
* fix(session): bypass user-prompt pipeline in handoff

handoff() was calling #promptWithMessage, which gates on an API key
check before reaching this.agent.prompt(). That gate is appropriate for
user-facing prompts but has no place in an internal document-generation
call: it blocked the test spy on agent.prompt and required callers to
carry real credentials just to run the handoff path.

Fix: call #promptAgentWithIdleRetry directly (preserving the
busy-wait behaviour and #promptInFlightCount tracking) and skip the
user-prompt pipeline (API key validation, bash/python flushes, file
mention expansion, plan messages, extension events) entirely. handoff
creates a fresh session immediately after, so none of that setup
applies.

Tests now reach agent.prompt with no stub on modelRegistry.getApiKey.

* fix(patch): HASHLINE_PREFIX_RE strips comment lines with word: pattern

The regex used [0-9a-zA-Z]{1,16} for the hash ID segment, which matched
common comment patterns like '# Note:', '# TODO:', '# FIXME:'. When a
single-line replacement contained such a comment, nonEmpty===1 and
hashPrefixCount===1, triggering stripping and eating the comment prefix.

Actual hashline IDs are always exactly 2 chars from ZPMQVRWSNKTXJBYH.
Constrain the regex to that exact alphabet so no English word can match.

Also update tests that used fake IDs (AB, CD, EF) not in the real alphabet.

* Revert "fix(patch): HASHLINE_PREFIX_RE strips comment lines with word: pattern"

This reverts commit 112ad083de956d4ed8b78a7e6e9af2c061befbd5.

---------

Co-authored-by: Miroslav Drbal <miroslav.drbal@gendigital.com>
2026-03-09 15:44:21 +01:00
can1357 2d732bb033 fix(coding-agent): resolved symlinked paths before passing to brush
- Resolved symlinked paths before passing to brush shell to keep `pwd` output aligned with canonical Git worktree paths.
- Added `resolveShellCwd` helper that safely resolves symlinks and falls back to original path on error.
- Added test case verifying symlinked directories are canonicalized before execution.
2026-03-09 15:39:05 +01:00
can1357 aa18e3f26d feat: add hash prompt actions
Fixes #283
2026-03-09 15:38:39 +01:00
can1357 111d5f9cc6 test: add thinking signature regressions 2026-03-09 15:38:39 +01:00
can1357 99127dc95d test(model-registry): cover gpt-5.4 context metadata 2026-03-09 15:38:39 +01:00