Commit Graph

1980 Commits

Author SHA1 Message Date
can1357 0bbe52dee7 feat(coding-agent): changed context promotion to trigger on overflow errors instead of threshold
- Changed context promotion to trigger on context overflow errors instead of a configurable threshold percentage.
- Removed the contextPromotion.thresholdPercent configuration setting.
- Updated context promotion to retry immediately on the promoted model without requiring compaction.
- Refactored context promotion logic to attempt promotion before compaction in the overflow handling flow.
- Updated agent session to merge context promotion checks into the compaction method for unified overflow handling.
- Updated tests to reflect overflow-based promotion triggering instead of threshold-based promotion.
2026-02-16 18:33:05 +01:00
can1357 5dbf4922b8 feat(coding-agent/config): changed default grep context lines from 1 before/3 after to 0 before/0 after
- Changed default grep context lines from 1 before/3 after to 0 before/0 after for more focused search results.
2026-02-16 18:33:05 +01:00
can1357 0d49ddbc8a fix(compaction): updated test for 15% reserve token floor 2026-02-16 18:33:04 +01:00
can1357 0419a9e01f feat(coding-agent/lsp): fixed LSP cancellation with abort signal support for file operations and requests
- Added abort signal support to LSP file operations (ensureFileOpen, refreshFile) enabling cancellation of long-running file operations.
- Added abort signal propagation through LSP request handlers (definition, references, hover, symbols, rename) with $/cancelRequest notification support.
- Added shouldBypassAutocompleteOnEscape callback to custom editor allowing parent components to override escape key handling behavior.
- Changed escape key handling in custom editor to respect bypass callback, enabling global escape handling during active operations.
- Fixed LSP operations to properly handle abort signals and throw ToolAbortError when operations are cancelled, with input controller bypassing autocomplete during streaming/loading states.
2026-02-16 18:33:04 +01:00
can1357 a61ee16b65 feat(ai): implemented context promotion target model property for improved fallback handling
- Added contextPromotionTarget model property to specify preferred fallback model when context promotion is triggered.
- Added automatic context promotion target assignment for Spark models to their base model equivalents.
- Updated Qwen model context window and max token limits for improved accuracy.
- Updated o1 model context window from 256000 to 262144 tokens and max tokens from 64000 to 65536 tokens.
- Implemented context promotion logic to use configured contextPromotionTarget when available instead of role-based model resolution.
2026-02-16 18:33:04 +01:00
can1357 14beadd9b5 feat(coding-agent/session): enforced minimum 15% context window floor for session compaction reserves
- Added effectiveReserveTokens() function to enforce a minimum 15% context window floor for session compaction reserve calculations.
- Updated shouldCompact() to use effectiveReserveTokens() instead of raw configured reserve, ensuring more predictable compaction behavior regardless of configuration.
2026-02-16 18:33:03 +01:00
can1357 f193dc85b0 feat(session/compaction): limited file operation summary to 20 files per category with omitted count
- Implemented file operation summary limiting to 20 files per category with indication of omitted files when exceeded.
- Added truncateFileList() helper function to limit file arrays and append ellipsis message showing omitted file count.
- Added stripFileOperationTags() helper function to remove XML file operation tags from summary strings.
- Introduced upsertFileOperations() function to merge base summary with file operations by stripping old tags and concatenating new ones.
- Refactored branch-summarization and compaction modules to use new upsertFileOperations() function instead of formatFileOperations().
2026-02-16 18:33:03 +01:00
can1357 a2db7789b7 feat(coding-agent): implemented automatic context promotion to larger models when approaching limits
- Added automatic context promotion feature that switches to larger-context models when approaching context limits.
- Added 'contextPromotion.enabled' setting to control automatic model promotion with default value of enabled.
- Added 'contextPromotion.thresholdPercent' setting to configure context usage threshold for triggering promotion with default value of 90%.
- Implemented context promotion logic in AgentSession that monitors token usage and automatically switches models when threshold is exceeded.
- Added provider session cleanup during model switches to properly handle session state transitions.
- Added comprehensive test coverage for context promotion functionality including threshold-based promotion and non-promotion scenarios.
2026-02-16 18:33:03 +01:00
can1357 a4f845a465 feat: added CPU variant support for x64 native addons with AVX2/baseline fallback
- Added CPU variant support for x64 native addons with modern (AVX2/x86-64-v3) and baseline (x86-64-v2) variants, enabling automatic fallback when modern variants are unavailable.
- Added automatic AVX2 CPU detection on Linux, macOS, and Windows platforms to select appropriate native addon variant at runtime.
- Updated native addon filename scheme to include CPU variant suffix (e.g., pi_natives.linux-x64-modern.node) for x64 platforms.
- Updated CLI update mechanism to support downloading and installing multiple native addon variants per platform with fallback support.
- Removed fallback untagged pi_natives.node binary creation; platform and variant-tagged binaries are now required.
2026-02-16 18:33:03 +01:00
can1357 2e45297c43 docs(docs): moved documentation to root docs directory and updated all references
- Moved documentation files from packages/coding-agent/docs/ to root docs/ directory to flatten the documentation structure.
- Updated all internal documentation links to account for the new file locations, adjusting relative paths to maintain correct references across the monorepo.
- Updated README.md and issue template configuration to reference documentation at the new root docs/ location instead of packages/coding-agent/docs/.
2026-02-16 18:33:03 +01:00
can1357 63ec7b6667 docs(coding-agent): added comprehensive technical documentation for coding agent internals
- Added comprehensive technical documentation for bash tool runtime covering execution surfaces, pipeline stages, PTY/non-PTY modes, output handling, and operational caveats.
- Added documentation for blob and artifact storage architecture including content-addressed blobs, session-scoped artifacts, persistence mechanisms, and URL access models.
- Added documentation for Gemini manifest extension discovery covering directory scanning, manifest parsing, name normalization, and precedence rules.
- Added 13 additional technical documentation files covering MCP runtime lifecycle, server tool authoring, retry policies, notebook runtime, plugin management, provider streaming, rulebook matching, session operations, slash commands, task agent discovery, TTSR injection, and TUI internals.
2026-02-16 18:33:02 +01:00
can1357 35dbf43670 feat(coding-agent/web): added Brave web search provider with recency filtering and API integration
- Added Brave web search provider with support for query, result count, and recency filtering.
- Added BRAVE_API_KEY environment variable configuration for Brave search authentication.
- Updated web search provider priority order to include Brave as second-highest priority after Exa.
- Extended recency filter support to Brave search provider alongside Perplexity.
- Implemented BraveProvider class with API integration, response mapping, and parameter validation.
- Added helper functions for recency mapping, result clamping, and snippet building in Brave provider.
2026-02-16 18:33:02 +01:00
can1357 82d6caf0b6 docs(coding-agent): restructured documentation from guides to technical implementation references
- Restructured documentation from user-facing guides to technical implementation references across 18 files in packages/coding-agent/docs.
- Reorganized compaction.md, config-usage.md, custom-tools.md, and extensions.md to emphasize architecture and integration patterns over step-by-step tutorials.
- Expanded environment-variables.md, extension-loading.md, fs-scan-cache-architecture.md, and python-repl.md with detailed runtime behavior and implementation details.
- Consolidated hooks.md, rpc.md, sdk.md, and theme.md from comprehensive reference documentation to focused technical specifications.
- Refined session.md, session-tree-plan.md, skills.md, tree.md, and tui.md to clarify runtime behavior, discovery mechanisms, and technical contracts.
2026-02-16 18:33:02 +01:00
can1357 5882215f49 feat(coding-agent/web): added pagination support for GitHub issue comments with partial result display
- Added pagination support for fetching GitHub issue comments, allowing retrieval of all comments beyond the initial 50-comment limit.
- Added comment count display showing partial results when not all comments could be fetched (e.g., '5 of 10 comments').
- Changed GitHub issue comment fetching to use paginated API requests with 100 comments per page instead of single request with 50-comment limit.
- Extracted comment fetching logic into dedicated fetchGitHubIssueComments function for improved code organization.
- Added GitHubIssueComment interface to provide type safety for comment data structures.
2026-02-16 18:33:02 +01:00
can1357 25de46f16d docs: update README 2026-02-16 14:04:14 +00:00
can1357 81bf013d37 chore: bump version to 12.7.6 2026-02-16 15:02:50 +01:00
can1357 2214a9a62c feat(coding-agent/config): fix spark priority 2026-02-16 15:02:16 +01:00
can1357 045d2894ff chore: bump version to 12.7.5 2026-02-16 14:37:24 +01:00
can1357 9fcfb83fe0 feat(coding-agent/config): updated model selection with additional variants for fast and comprehensive discovery
- Updated SMOL_MODEL_PRIORITY to include additional model variants (gpt-5.3-spark, cerebras/zai-glm-4.7, haiku-4-5, haiku-4.5) for improved fast model discovery.
- Updated SLOW_MODEL_PRIORITY to include additional model variants (gpt-5.3-codex, gpt-5.3, gpt-5.1-codex, gpt-5.1, opus-4.6, opus-4-6, opus-4.5, opus-4-5, opus-4.1, opus-4-1) for improved comprehensive model discovery.
2026-02-16 14:36:36 +01:00
can1357 5d966ec439 chore: bump version to 12.7.4 2026-02-16 14:26:53 +01:00
can1357 2845b8b58b fix(coding-agent/prompts): fixed codex stopping before turn finish
- Fixed system prompt to enforce tool calls on every turn until task completion, preventing premature stopping before turn finish.
- Reorganized contract and diligence sections to clarify inviolable rules and completion requirements.
- Consolidated redundant completion guidance and removed duplicate prime directive language.
2026-02-16 14:26:39 +01:00
can1357 9d5f3f2ab7 docs(coding-agent/prompts): clarified contract rules requiring tool calls per turn and forbidding standalone updates
- Clarified contract rule 2 to explicitly require at least one tool call per turn unless task is complete.
- Added new contract rule 3 forbidding standalone progress updates without task continuation.
- Renumbered subsequent contract rules 3-7 to 4-8 to accommodate new rule.
- Reinforced critical section guidance with same tool call requirement for turn validity.
2026-02-16 14:18:34 +01:00
can1357 1186b408f4 chore: bump version to 12.7.3 2026-02-16 13:44:08 +01:00
can1357 13d06f712c fix(coding-agent): suppress hashline output for agents without edit tool
Hashline prefixes (LINE:HASH|content) in read/grep output exist solely to
support the hashline edit mode. Agents that don't have the edit tool
(e.g. explore, plan, reviewer) gain nothing from them — they just waste
tokens and add noise.

resolveFileDisplayMode now takes a session-like object with an optional
hasEditTool flag. When false, hashlines are suppressed regardless of
settings. ToolSession gains hasEditTool (set from toolNames in the SDK),
and AgentSession exposes it as a getter over the tool registry.
2026-02-16 13:43:35 +01:00
can1357 774acb04d6 chore: bump version to 12.7.2 2026-02-16 12:26:25 +01:00
can1357 6497f72ba3 docs(coding-agent/prompts): simplified system prompt to emphasize action over planning
- Simplified system prompt instructions to emphasize action over planning and metadata.
2026-02-16 12:23:25 +01:00
can1357 24c0bdb5a6 chore: bump version to 12.7.1 2026-02-16 11:37:30 +01:00
can1357 abccce7e3a docs(coding-agent/prompts): restructured execution guidance to prioritize scope assessment and tool-driven progress
- Restructured execution procedure guidance to emphasize scope assessment and continuous tool-driven progress over planning-first approach.
- Updated task tracking instructions to prohibit metadata-only turns and require immediate completion marking of todo items.
- Clarified parallel execution guidance to distinguish between genuine parallelization and sequential work, with explicit criteria for Task tool usage.
- Modified output style requirements to mandate stating intent before tool calls and reordered style constraints for clarity.
- Reinforced requirement that every turn must include at least one tool call advancing the deliverable, with explicit failure condition for planning-only turns.
- Added prime directive section emphasizing completion of requested output as primary objective.
2026-02-16 11:36:59 +01:00
can1357 733522cbab chore: bump version to 12.7.0 2026-02-16 10:09:23 +01:00
can1357 c12be01a5f fix(coding-agent): backported pi-mono changes (34878e..5133697)
packages/ai:
- fix: hardened OpenAI tool-call JSON parsing for malformed trailing arguments
- feat: routed GitHub Copilot Claude 4.x models through anthropic-messages
- feat: centralized dynamic Copilot headers and anthropic bearer auth handling
- feat: added optional StreamOptions.metadata propagation
- test: added Copilot headers/auth/routing coverage
- fix: updated model generator and models.json for Copilot Claude API mapping

packages/coding-agent:
- fix: made CLI model resolution deterministic with provider-aware pattern parsing
- fix: corrected compaction boundary/context usage handling after compaction
- feat: expanded extension events and terminal input hook integration
- fix: hardened git source parsing to avoid local-path misclassification
- test: added git-url parser coverage and model-resolver cases

packages/tui:
- fix: scoped @ fuzzy autocomplete to typed path prefixes
- feat: added Windows VT input mode support via bun:ffi

docs:
- chore: updated porting sync point to 5133697
2026-02-16 10:08:53 +01:00
can1357 0615f5328e fix(coding-agent/cli): fixed GitHub API rate limiting by using npm registry for release info
- Changed release info fetching from GitHub API to npm registry to avoid unauthenticated rate limiting.
- Constructed deterministic GitHub release download URLs instead of relying on API response.
2026-02-16 09:59:07 +01:00
zhzy0077 62864782a5 fix(coding-agent): add null safety for finding.title in renderFindings
Handle cases where finding.title is null/undefined by defaulting to 'Untitled'.
2026-02-16 15:47:29 +08:00
can1357 a39702f003 feat(web-search): added Z.AI web search provider with MCP integration
- Added Z.AI web search provider with MCP integration for remote web search capabilities.
- Added 'zai' as a selectable web search provider option in settings and CLI.
- Added Z.AI to the automatic provider fallback chain for web search after Gemini and Codex.
- Implemented ZaiProvider class with support for multiple Z.AI API response formats and retry logic.
- Added comprehensive error handling and response parsing for Z.AI MCP endpoint integration.
2026-02-16 05:22:50 +01:00
can1357 cbbaa5e74d chore: bump version to 12.6.0 2026-02-16 05:02:54 +01:00
can1357 f1a05f5133 fix(coding-agent/modes): fixed welcome screen layout to handle small terminal widths gracefully
- Fixed welcome screen layout to gracefully handle small terminal widths and prevent rendering errors on narrow displays.
- Fixed welcome screen title truncation to prevent overflow when content exceeds available width.
- Improved welcome screen responsiveness to dynamically show or hide the right column based on available terminal width.
2026-02-16 04:59:07 +01:00
Can Bölük 5d9ef17d3b Merge pull request #81 from romanalexander/feat/extension-register-provider
feat(extensions): add registerProvider() to ExtensionAPI for custom LLM providers
2026-02-16 04:54:19 +01:00
can1357 d6bd208c25 fix: deferred model resolution and extension provider registration
- Fixes deferred `--model` resolution to match extension-provided models before fallback
- Fixes CLI `--api-key` handling to support deferred model selection
- Adds OAuth provider support for extensions with source-scoped registration cleanup
- Adds custom API registration helpers with built-in collision checks
- Expands `Api` type to support extension-defined identifiers
- Adds tests for runtime provider registration and model selection
2026-02-16 04:52:33 +01:00
Can Bölük f5503a423d Merge pull request #78 from DeprecatedLuke/feat/rpc-busy-poll-on-stdin-close
fix(coding-agent/rpc): exit cleanly when stdin closes instead of busy-polling
2026-02-15 22:18:06 +01:00
Roman Alexander 8ccd3859b1 Fix 2026-02-16 00:40:52 +07:00
Roman Alexander 9743ed4f8a Fix 2026-02-16 00:33:50 +07:00
Roman Alexander 04c1a189b5 feat(extensions): add registerProvider() to ExtensionAPI for custom LLM providers
packages/ai:
- feat: added custom API provider registry (api-registry.ts)
- feat: stream() and streamSimple() check custom registry before built-in switch

packages/coding-agent:
- feat: added registerProvider() to ExtensionAPI for registering custom model providers
- feat: added ProviderConfig and ProviderModelConfig types
- feat: ModelRegistry.registerProvider() registers models and custom streaming functions
- feat: extension loader queues provider registrations, runner processes them on initialize

This enables extensions to register custom LLM providers with their own streaming
implementations. For example, a Vertex AI Claude extension can register a provider
that uses @anthropic-ai/vertex-sdk for Google Cloud ADC authentication:

  pi.registerProvider("google-vertex-claude", {
    baseUrl: "https://us-east5-aiplatform.googleapis.com",
    apiKey: "GOOGLE_CLOUD_PROJECT",
    api: "vertex-claude-api",
    models: [...],
    streamSimple: streamVertexClaude,
  });

Backported from pi-mono's extension provider registration system.
2026-02-16 00:20:42 +07:00
luk 1c4721dae2 fix(coding-agent/rpc): exit cleanly when stdin closes instead of busy-polling 2026-02-15 14:42:28 +00:00
can1357 e7d90ff703 chore: bump version to 12.5.1 2026-02-15 15:38:46 +01:00
can1357 0d3fc0d614 style: prompt formatting 2026-02-15 15:38:23 +01:00
can1357 aab245bc63 feat(edit): better hashline & benchmark prompts, re-ran codex 2026-02-15 15:38:06 +01:00
can1357 3a2b604db3 docs(coding-agent/prompts): clarified hashline anchor format and tool usage patterns in documentation
- Clarified hashline anchor format to emphasize `LINE:HASH` only without content suffix.
- Added explicit guidance on `set_line` with empty text behavior versus `replace_lines` for deletion.
- Added instruction to prefer `insert_after` over line replacement when adding fields/arguments/imports.
- Added common failure patterns section documenting anchor copying errors and wide range pitfalls.
- Updated all example tool calls to use concrete `LINE:HASH` format instead of template placeholders.
2026-02-15 15:22:16 +01:00
can1357 6cc367f37b feat(coding-agent): added repeatToolDescriptions config to control tool description rendering
- Added `repeatToolDescriptions` configuration setting to control tool description rendering in system prompts.
- Implemented conditional tool display logic that renders full tool descriptions when enabled or a concise comma-separated list when disabled.
- Threaded `repeatToolDescriptions` setting through SDK and system prompt building pipeline.
2026-02-15 14:55:44 +01:00
can1357 082eae59d1 chore: bump version to 12.5.0 2026-02-15 14:23:09 +01:00
can1357 8ff758ed07 feat(coding-agent/modes): fixed theme selector with non-destructive preview and deduplication
- Added new previewTheme() function to enable non-destructive theme preview during settings browsing.
- Implemented asynchronous theme loading with request deduplication to prevent race conditions when rapidly browsing theme options.
- Enhanced theme preview cancellation behavior to restore the previously active theme instead of the current value.
- Fixed theme preview updates being applied out-of-order when rapidly browsing theme options by using request ID tracking.
2026-02-15 14:22:43 +01:00
can1357 79cfe855c9 feat: enhanced glob patterns, symlink handling, and Tailwind CSS compilation
- Added `recursive` option to GlobOptions to control whether simple glob patterns match recursively by default (true).
- Changed glob pattern behavior to always apply recursive matching for simple patterns instead of requiring explicit `**/` prefix.
- Improved symlink handling in glob file type filters to resolve symlink targets and match based on their actual type (file/dir).
- Enhanced skill discovery in coding-agent to use dual-pass glob approach with deduplication and improved extension module detection.
- Implemented dynamic Tailwind CSS compilation in stats package by extracting actual class names from source files instead of building with empty candidates.
- Refactored Tailwind stylesheet imports to use centralized `tailwindcss/index.css` import with custom stylesheet loader callback.
2026-02-15 14:15:04 +01:00