Commit Graph

49 Commits

Author SHA1 Message Date
can1357 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +01:00
can1357 881737fec4 refactor(coding-agent): restructured web search and config systems with class-based architecture and type generalization
- Renamed web search types and functions to remove 'Web' prefix for broader applicability (WebSearchProvider -> SearchProviderId, WebSearchResponse -> SearchResponse, WebSearchTool -> SearchTool, etc.).
- Refactored web search provider system from object-based configuration to class-based architecture with abstract SearchProvider base class and concrete provider implementations.
- Refactored ModelRegistry to use direct constructor instantiation instead of discoverModels() helper function, simplifying model discovery pattern.
- Refactored config system to use new ConfigFile class with schema validation, caching, and multi-format support (JSON, JSONC, YAML).
- Simplified Exa API key discovery to check environment variables only, removing .env file reading logic.
2026-02-05 13:56:38 +01:00
can1357 39634776a7 feat(coding-agent): refactored task API to use 'assignment' field and structured context separation
- Refactored task API to use 'assignment' field instead of 'args' for per-task instructions, enabling clearer separation between shared context and task-specific work.
- Introduced structured context/assignment separation pattern with '<swarm_context>' wrapper for template rendering, replacing placeholder-based substitution.
- Changed agent frontmatter field from 'thinkingLevel' to 'thinking-level' (kebab-case) for consistency with YAML conventions.
- Removed 'context' parameter from ExecutorOptions as context is now prepended at template level rather than executor level.
- Removed 'args' field from AgentProgress and SingleResult interfaces, simplifying task result tracking.
- Updated task rendering to display full task text instead of formatted args, improving clarity in progress output.
2026-02-05 07:43:53 +01:00
can1357 4d4328109c docs(coding-agent/prompts): clarified subagent submit reminder about aborted status and blocker details
- Added clarification to subagent submit reminder about when to use aborted status and requirements for including blocker details.
2026-02-05 06:45:44 +01:00
can1357 eb52f00651 docs(coding-agent/prompts): refined system prompts to clarify aborting, confirmation, and checkpoint procedures
- Updated subagent system prompt to clarify that aborting is only acceptable when truly blocked after exhausting tools and reasonable attempts.
- Updated system prompt to emphasize proceeding without confirmation after stating assumptions and to avoid asking for file paths that can be resolved from repo context.
- Clarified checkpoint procedure to be an internal step that continues in the same response without waiting for user input.
- Updated requirements conflict guidance to only ask for resolution after exhausting exploration with tools and context.
2026-02-05 06:42:56 +01:00
can1357 f82a5d121f feat(coding-agent/task): added task recursion depth control and hierarchical subagent naming
- Added task.maxRecursionDepth setting to control how many levels deep subagents can spawn their own subagents (0=none, 1=one level, 2=two levels, -1=unlimited).
- Added nested task artifact naming with parent task prefixes (e.g., '0-Auth.1-Subtask') to support hierarchical task identification.
- Added taskDepth and parentTaskPrefix options to CreateAgentSessionOptions for supporting nested/subagent sessions.
- Changed task tool spawns configuration from 'explore' to '*' to allow spawning any type of subagent.
- Updated system prompt to unconditionally include parallel delegation guidance for all agent types instead of only coordinators.
- Implemented automatic task tool disabling at maximum recursion depth to prevent excessive task nesting.
2026-02-05 02:18:10 +01:00
can1357 c95f502464 docs(coding-agent/prompts): updated system prompt to reduce round-trips and strengthen ask tool guidance
- Updated system prompt guidance to state assumptions and proceed without asking for confirmation, reducing unnecessary round-trips.
- Tightened ask tool conditions to require multiple approaches with significantly different tradeoffs before prompting user.
- Strengthened ask tool guidance to default to action and only ask when genuinely blocked by decisions with materially different outcomes.
- Changed refactor workflow to automatically remove now-unused elements and note removals instead of asking for confirmation.
2026-02-04 08:25:45 +01:00
can1357 fac1bf28f8 docs(coding-agent/prompts): added critical instruction to system prompt emphasizing task completion
- Added critical instruction to system prompt emphasizing task completion and preventing premature stopping.
2026-02-04 06:51:59 +01:00
can1357 a857ae4d70 fix(coding-agent): fixed LSP timeout handling and externalized subagent reminder prompt
- Fixed timeout handling in LSP write-through operations to properly clear formatter and diagnostics results when operations exceed the 10-second timeout threshold.
- Added timeout detection mechanism in LSP index that sets a flag when the timeout signal is aborted.
- Added nonAbortable property to EditTool and WriteTool classes to prevent these operations from being aborted during execution.
- Externalized subagent submit reminder prompt to a separate template file for improved maintainability and dynamic retry tracking.
2026-02-03 17:46:13 +01:00
can1357 4e8c0121a7 docs(coding-agent/prompts): applied semantic compression to system prompt and skill documentation
- Applied semantic compression rules to system prompt and skill documentation, removing grammatical scaffolding while preserving meaning-carrying content.
- Updated semantic-compression skill documentation with more aggressive compression stance, expanded deletion tiers, and clarified preservation rules.
- Refactored system prompt for brevity using fragments, label:value pairs, and direct phrasing without sacrificing clarity or instruction fidelity.
2026-02-03 12:57:22 +01:00
can1357 3580beeb6a docs(skills/semantic-compression): added semantic-compression skill docs and enhanced system prompt guidance
- Added semantic-compression skill documentation with deletion tiers, preservation rules, and compression examples.
- Enhanced system prompt with explicit assumption-stating guidance, pre-finishing checklist, and conflict resolution procedures.
- Added verification guidance for test-first approach and naive-before-optimizing pattern for algorithmic work.
- Clarified commitment to high-reliability contexts and user stamina constraints in stakes section.
2026-02-03 12:29:17 +01:00
can1357 ca1d26e205 feat(coding-agent): consolidated LSP operations and removed Rust-analyzer specific functionality
- Consolidated LSP actions by merging workspace_symbols into symbols operation and workspace_diagnostics into diagnostics operation.
- Removed Rust-analyzer specific LSP operations: flycheck, expand_macro, ssr, runnables, related_tests, and reload_workspace.
- Removed LSP actions: workspace_diagnostics, workspace_symbols, actions, incoming_calls, and outgoing_calls in favor of consolidated operations.
- Removed LSP tool parameters: replacement, kind, action_index, end_line, and end_character.
- Removed Python prelude helper functions: pwd(), mkdir(), ls(), head(), tail(), sh(), cat(), touch(), wc(), basenames(), and batch().
- Simplified LSP tool documentation and system prompts to reflect consolidated operations and removed functionality.
2026-02-02 15:13:13 +01:00
can1357 a94510109d docs(coding-agent/prompts): removed ls tool references from system prompt tool precedence and critical sections
- Removed `ls` tool references from system prompt tool precedence and critical sections.
2026-02-02 14:56:25 +01:00
can1357 e66d71f6b9 refactor(tools): consolidated directory listing functionality from ls tool into read tool
- Consolidated directory listing functionality from dedicated `ls` tool into the `read` tool.
- Removed the `ls` tool and all related exports, types, and configurations from the public API.
- Updated `read` tool to return formatted directory listings with modification times instead of redirecting to `ls` tool.
- Removed `bashInterceptor.simpleLs` setting and related interception logic from bash tool.
- Removed `ls.enabled` setting and related tool registration logic.
- Removed test cases for the `ls` tool and updated tool type definitions to remove `LsToolResultEvent`.
2026-02-02 14:55:48 +01:00
can1357 5926226e5c feat(coding-agent): added enable/disable settings for specialized tools with conditional documentation
- Added enable/disable settings for specialized tools (find, grep, ls, notebook, fetch, web_search, lsp, calc) allowing fine-grained control over tool availability.
- Implemented conditional tool documentation in system prompt that dynamically lists only enabled specialized tools based on configuration.
- Updated tool filtering logic to respect enable/disable settings, preventing unavailable tools from being exposed to the agent.
2026-02-02 14:41:51 +01:00
can1357 877f4aead7 style(coding-agent/prompts): condensed prompt documentation for improved clarity and conciseness
- Condensed prompt documentation throughout by removing articles, auxiliary verbs, and redundant explanations for improved clarity and conciseness.
- Simplified system prompts by replacing multi-line explanations with terse, semicolon-separated fragments and removing verbose motivational language.
- Reformatted tool documentation to use abbreviated language, removing 'the', 'a', and 'is' throughout for more direct technical writing.
- Removed blank lines and consolidated spacing in prompt files to reduce vertical whitespace and improve document density.
2026-02-02 14:29:21 +01:00
can1357 c537523212 docs(coding-agent/prompts): reorganized system prompt guidance for parallel task execution
- Reorganized system prompt guidance for parallel task execution, moving coordinator section earlier and restructuring parallel_reflex section for improved clarity.
2026-02-01 13:21:03 +01:00
can1357 f494d2a68a docs(coding-agent/prompts): improved prompt formatting and removed redundant instructions
- Removed redundant instruction about preferring delegation in coordinator prompt.
- Improved task context template formatting with consistent markdown code fence markers.
- Removed dependencies section from task template constraints as it was redundant.
- Enhanced readability of task examples with better spacing and formatting.
2026-02-01 04:57:57 +01:00
can1357 3d0d010536 fix(coding-agent): guide plan mode to use edit tool for incremental updates 2026-01-31 10:29:22 +01:00
can1357 2fc19f69ca feat(coding-agent): added subagent context passing and automatic tool injection for agent sessions
- Added getCompactContext() API to agent session for accessing parent conversation context.
- Implemented automatic submit_result tool injection for subagents with explicit tool lists.
- Added contextFile parameter to ExecutorOptions for passing parent conversation context to subagents.
- Enhanced subagent system prompt with conditional context file instructions and improved code formatting.
- Removed schema override notification from task summary prompt to simplify output.
- Implemented formatCompactContext() method to format conversation history for subagent consumption.
2026-01-31 10:03:50 +01:00
can1357 331a9d5a28 docs(coding-agent/prompts): clarified delegation rules and enhanced context documentation for subagents
- Clarified that user instructions about delegation override tool-use defaults in system prompt.
- Updated coordinator guidance to emphasize Task tool preference for substantial work with improved emphasis on context window limitations.
- Enhanced `context` parameter documentation to require self-contained information for subagents, including file contents and user requirements.
2026-01-31 07:16:43 +01:00
can1357 1a64cca199 feat(coding-agent): added persistent shell sessions
- Added persistent shell session support for bash tool with environment variable preservation across commands.
- Added shellForceBasic setting to force bash/sh even if user's default shell is different (default: true).
- Added OMP_SHELL_PERSIST environment variable to control persistent shell behavior (set to 0 to disable).
- Restructured system prompt with coordinator-specific guidance for parallel task delegation.
2026-01-31 05:22:07 +01:00
can1357 4d66372720 feat(coding-agent): replaced ripgrep with glob-based file discovery and added outline UI components
- Added outline option to dialog and select UI components for rendering outlined lists in extension dialogs and ask tool.
- Replaced ripgrep-based file listing with fs.glob for project scans in system-prompt, find, and read tools.
- Added timeout tracking to ask tool multi-select flow to prevent hanging on selection operations.
- Created new OutlinedList component in hook-selector for rendering bordered list containers.
- Implemented globPaths utility function in pi-utils for glob-based file discovery with gitignore support.
2026-01-28 17:15:24 +01:00
can1357 85705a1e23 docs(coding-agent/prompts): restructured system prompt templates for improved clarity and consistency
- Restructured system prompt templates for improved clarity and consistency.
- Simplified XML tag structure in custom and system prompts by removing redundant wrapper elements and consolidating metadata.
- Updated skill and rule references to use inline path notation (e.g., `skill://<name>`, `rule://<name>`) instead of separate location tags.
- Improved prompt readability by reorganizing sections with clearer headers and more concise instructional text.
2026-01-28 15:36:19 +01:00
can1357 1583812610 feat(coding-agent): added project tree visualization to system prompts with configurable depth and entry limits
- Added project tree visualization to system prompts with configurable depth and entry limits.
- Implemented scanProjectTree function to recursively scan directory structure with intelligent truncation and sorting by modification time.
- Added renderProjectTree function to format scanned directory structure as XML with path collapsing for single-child directories.
- Integrated projectTree snapshot into both custom and main system prompt templates with conditional rendering.
- Added XML escaping utility to safely render file paths and names in prompt context.
2026-01-28 15:28:15 +01:00
can1357 eb3ca1ddd2 refactor(coding-agent): restructured prompt rendering and tool utilities into dedicated modules
- Extracted tool choice mapping logic into dedicated utility module for provider-specific format conversions.
- Refactored task summary generation to use template-based rendering instead of string concatenation.
- Migrated system prompt generation to use Handlebars templates with structured data instead of hardcoded strings.
- Extracted JTD to TypeScript conversion logic into dedicated utility module for schema documentation.
- Consolidated prompt template rendering across multiple modules using unified renderPromptTemplate function.
- Simplified type assertions in stream module to use generic OptionsForApi type instead of provider-specific types.
2026-01-28 03:47:16 +01:00
can1357 70a2c30177 feat(coding-agent): added tools list to system prompt and improved output preview logic
- Added available tools list to system prompt for agent coherence.
- Improved output preview logic to show full output for smaller results and truncate larger outputs to 10 lines.
2026-01-28 03:17:18 +01:00
can1357 34f03bc7fb feat(coding-agent): added subagent skill preloads
- Inline preloaded skill contents in system prompts and allow task-level skill selection.
- Record session init entries with system prompt, task, tools, and output schema.
- Fix session persistence to keep pre-assistant entries in subagent logs.
2026-01-27 05:18:30 +01:00
can1357 db8089cc23 refactor(coding-agent/tools): standardized search tool parameters across find and grep
- Renamed `head_limit` to `limit` in grep and find tools for consistency.
- Added `context` as optional alias for the `c` parameter in grep.
- Made hidden files inclusion configurable in find with `hidden` parameter.
- Integrated .gitignore and .ignore file support in find tool.
- Updated plan mode documentation for self-contained plan files.
2026-01-25 22:38:06 +01:00
can1357 4dd3e17c5a docs(coding-agent/prompts): clarified and condensed plan mode prompts
- Refined descriptions to be more concise and focused.
- Restructured content for improved clarity and consistency across all plan mode prompts.
- Tightened critical sections with more direct language.
- Improved plan mode prompt clarity and organization.
2026-01-25 19:41:14 +01:00
can1357 79079e6ecd feat(coding-agent): added plan mode with approval workflow and tool gating
- Plan mode provides structured workflow where agents propose plans for user approval before execution.
- Added plan:// internal URL protocol for accessing plan files and injecting plan-mode context into subagent prompts.
- Added plan mode toggle shortcut and paused status indicator in status line.
- Fixed plan reference injection to properly pass workflow state to plan-mode system prompts.
- Improved autocomplete fuzzy matching to support subsequence matching for skill suggestions.
2026-01-25 19:35:26 +01:00
can1357 25f1849915 refactor(prompts): refactored system prompt to consolidate tool guidance
- Consolidated tool precedence and usage rules into the core system prompt.
- Removed redundant tool usage guidance from individual tool prompts.
- Refined agent persona, decision-making, and task completion criteria.
- Emphasized correctness, thoroughness, and parallel execution.
2026-01-23 11:12:29 +01:00
can1357 d676150f9c refactor(coding-agent/core): simplified Python gateway coordination by removing reference counting
- Simplified Python gateway coordination by removing reference counting and idle timeout functionality.
- Updated Python kernel initialization to support environment variable setup and working directory configuration.
- Modified interactive status display to show Python and venv paths instead of client counts.
- Updated system prompt to clarify CHECKPOINT step 0 timing after user request completion.
2026-01-23 09:31:40 +01:00
can1357 b952e379ae feat(coding-agent): renamed task parameter from vars to args
- Renamed task parameter from vars to args throughout task tool interface.
- Enhanced task template rendering with built-in {{id}} and {{description}} placeholders.
- Simplified task template validation by removing strict placeholder requirements.
- Streamlined CHECKPOINT step requirements in system prompts.
2026-01-23 08:16:16 +01:00
can1357 f0fce652b9 feat(coding-agent/core): added internal URL routing system with agent:// and skill:// protocols
- Added internal URL routing system with agent:// and skill:// protocol handlers.
- Enhanced fetch tool to support internal URLs and JSON extraction from agent outputs.
- Extended read tool to handle internal URLs with pagination and query extraction.
- Removed Output tool and replaced functionality with agent:// URL integration.
- Replaced minimatch dependency with Bun.Glob for pattern matching across modules.
2026-01-23 07:38:08 +01:00
can1357 2273cf80d7 chore(coding-agent): added format-prompts script and standardized prompt formatting
- Added format-prompts script for standardizing prompt file formatting across the codebase.
- Updated system prompt tags from `<required>`/`<antipatterns>` to `<important>`/`<avoid>` for clarity.
- Enhanced prompt formatting by removing blank lines after colons and around blocks for consistency.
- Standardized whitespace handling across all prompt files to improve readability.
2026-01-23 07:03:46 +01:00
can1357 deb1b97016 docs(coding-agent/prompts): refactored task decomposition with checkpoint validation
- Updated task decomposition guidance with clearer triggers for using Task tool.
- Added mandatory CHECKPOINT step for task evaluation before first tool call.
- Enhanced skills and rules checking with explicit validation requirements.
- Improved task decomposition criteria with dependency analysis.
- Added failure conditions for checkpoint and parallel processing validation.
2026-01-23 06:49:35 +01:00
can1357 17aa8ac54e refactor(coding-agent): simplified web-search tool parameters and unified system prompts
- Simplified web-search tool parameters by removing advanced configuration options.
- Standardized web-search tool to use built-in system prompt for consistent responses.
- Updated web-search tool to use `recency` parameter instead of `search_recency_filter`.
- Added unified web search system prompt with research assistant guidelines.
2026-01-23 06:28:09 +01:00
can1357 50af9519ab refactor(agent-prompts): restructured tool descriptions
- Removed centralized tool descriptions from prompt generation logic.
- Eliminated consolidated tool list rendering in system prompts.
- Added explicit tool name headings to individual tool documentation files.
- Simplifies prompt construction by decentralizing tool information.
2026-01-23 05:24:12 +01:00
can1357 8e708d7f4c docs(coding-agent): restructured system prompt for better readability and organization
- Updated system prompt structure and formatting for better readability.
- Reorganized tool hierarchy and discipline sections.
- Added parallel work guidance for task-based workflows.
- Enhanced verification and integration methodology sections.
- Updated skills and rules formatting for cleaner presentation.
- Added stronger emphasis on completeness and quality standards.
2026-01-21 22:34:30 +01:00
can1357 96822471c2 feat(coding-agent): added cell-by-cell Python execution tracking with duration and exit codes
- Added cell-by-cell Python execution tracking with duration and exit codes.
- Added template system with {{placeholders}} for task tool context rendering.
- Enhanced patch applicator to preserve exact indentation when intended.
- Changed Python tool to use cells array instead of single code parameter.
- Updated task tool schema to require vars instead of task field.
2026-01-21 11:58:29 +01:00
can1357 94f406d4f0 chore: bump version to 6.8.0 2026-01-20 16:30:47 +01:00
can1357 1d414c1383 feat: added IPython-backed Python tool with streaming output and Jupyter integration
- Added IPython-backed Python tool with streaming output and image/JSON rendering.
- Implemented Jupyter kernel gateway integration with WebSocket communication.
- Added Python prelude with 30+ shell-like utility functions for file operations.
- Migrated environment variables from PI_ to OMP_ prefix with automatic migration.
- Added streaming output system with automatic spill-to-disk for large outputs.
- Reorganized settings interface into behavior, tools, display, voice, status, lsp, and exa tabs.
2026-01-18 19:32:27 +01:00
can1357 96475db41b feat(coding-agent): added pre-serialized settings support to model resolver
- Improved model resolution to accept pre-serialized settings for better performance.
- Enhanced system prompt guidance for position-addressed vs content-addressed file edits.
- Added comprehensive edit tool documentation with bash alternatives comparison.
- Refactored model resolver to accept optional settings parameters for role resolution.
2026-01-16 13:26:43 +01:00
can1357 3d1757a393 feat(ai): simplified Codex system instructions and replaced with pi assistant documentation references
- Replaced detailed Codex system instructions with simplified pi assistant instructions that reference internal documentation via pi-internal:// protocol.
- Reduced Codex instructions from 321 lines to 11 lines by moving detailed guidance to referenced documentation.
- Changed assistant identity from 'coding agent running in opencode' to 'pi, an expert coding assistant'.
- Added documentation references for creating custom models, providers, extensions, themes, skills, and TUI components.
- Expanded bash tool guidance to explicitly list appropriate use cases including file operations, build commands, and process management.
- Reframed bash guidance from negative-only to showing both appropriate and inappropriate uses.
2026-01-15 13:21:11 +01:00
can1357 b4782538c3 feat(ai): improved Google provider schema sanitization and added schema validation tests
- Exported sanitizeSchemaForGoogle utility function for public use.
- Added filtering of unsupported JSON Schema fields ($schema, $ref, $defs, format, examples, etc.) in Google provider schema sanitization.
- Added handling to ignore unsupported additionalProperties: false in Google provider.
- Removed format: date-time from timestamp type conversion in JTD to JSON Schema transformation.
- Added schema validation tests to verify tool schemas don't contain problematic JSON Schema features.
- Reorganized system prompt to display context, environment, and tools sections before discipline guidelines.
2026-01-12 00:07:36 +01:00
can1357 03876d0360 feat(coding-agent): added todo_write tool, persistent todo panel, grouped Read display, and refactored prompts
- Added todo_write tool for creating and managing structured task lists during coding sessions.
- Added persistent todo panel above the editor that displays task progress with Ctrl+T toggle.
- Added grouped display for consecutive Read tool calls in a compact tree view.
- Changed system prompt to use more direct, field-oriented language with emphasis on verification and assumptions.
- Changed Ctrl+Enter to insert newline when not streaming, and Ctrl+T from toggling thinking blocks to toggling todo list.
- Replaced yaml package dependency with Bun's built-in YAML parser and extracted frontmatter parsing to dedicated module.
2026-01-11 23:33:27 +01:00
can1357 2090f4345a perf(coding-agent/core): optimized agent behavior by pre-listing AGENTS.md files in system prompt
- Added automatic discovery and pre-listing of AGENTS.md files in the system prompt.
- Eliminated runtime searching for AGENTS.md files by providing an authoritative list upfront.
- Added buildAgentsMdSearch function to scan for AGENTS.md files at prompt build time.
- Added listAgentsMdFiles helper with glob pattern matching and node_modules filtering.
2026-01-11 02:55:58 +01:00
can1357 7faa151de0 refactor(coding-agent): migrated prompt system to Handlebars templating and reorganized prompt files
- Removed rulebook tool and migrated rules loading to use read tool instead.
- Reorganized prompt files into subdirectories: agents/, compaction/, and system/.
- Added Handlebars helpers for template rendering including list, join, table, codeblock, xml, when, pluralize, and arithmetic operations.
- Migrated prompt template rendering from simple string replacement to Handlebars-style templating with structured data objects.
- Refactored system prompt generation to pass structured data instead of pre-formatted strings.
- Removed rulebookRules property from ToolSession interface and updated all test files accordingly.
2026-01-11 00:36:15 +01:00