Commit Graph

1709 Commits

Author SHA1 Message Date
can1357 2a76b6de59 fix(coding-agent): fixed config file parsing to handle missing files gracefully
- Fixed config file parsing to properly handle missing files instead of treating them as errors.
2026-02-06 03:02:54 +01:00
can1357 de397b3b04 feat(coding-agent): restored plan mode on resume from session
- Added ModeChangeEntry type export to public API for tracking agent mode transitions.
- Added mode and modeData fields to SessionContext to track active agent mode state across sessions.
- Added appendModeChange() method to SessionManager for recording mode transition entries.
- Added plan mode state restoration from session entries when resuming interactive mode sessions.
- Updated HTML export filter to treat mode_change entries as settings entries alongside model changes and thinking level changes.
- Added type validation for tool arguments in HTML export template with error handling for invalid values.
2026-02-06 02:55:41 +01:00
can1357 5339369abd style: replaced ASCII ellipsis with Unicode character for improved typography
- Replaced ASCII ellipsis characters (three dots '...') with Unicode ellipsis character ('...') throughout the codebase for improved typography.
- Adjusted string truncation logic to account for single-character Unicode ellipsis instead of three-character ASCII ellipsis, reducing reserved space from 3 to 1 character in truncation calculations.
- Updated truncation offsets in multiple files (session-manager, agent, executor, footer) to preserve 2 additional characters before ellipsis due to more compact Unicode representation.
2026-02-06 02:51:07 +01:00
can1357 43473e3b0e perf(coding-agent): optimized tool rendering with caching, improved tool grouping, and enhanced string preview formatting
- Implemented caching for tool output block rendering to avoid redundant computations on re-renders.
- Enhanced read tool grouping to prevent coalescing across narrative boundaries (text/thinking blocks between tool calls).
- Improved string preview formatting to detect multi-line strings and display line counts with ellipsis indicators.
- Refactored tool execution component to use reactive render state tracking for better state management.
- Enhanced error handling in tool renderers with logging for failures.
- Fixed truncation indicator to use ellipsis character instead of verbose suffix.
2026-02-06 02:47:59 +01:00
can1357 9c0828ead5 feat: improved dyn config resolution, git URL parsing, and type safety across packages
- Made shell command execution in configuration values asynchronous to prevent blocking the TUI, improving responsiveness during long-running operations.
- Added deduplication of concurrent shell command executions to prevent redundant processing when the same command is requested multiple times simultaneously.
- Enhanced git URL parsing with credential stripping and validation of URI-encoded hash fragments to improve security and robustness.
- Improved @ prefix normalization for path syntaxes to correctly handle well-known patterns while preserving literal paths like '@my-file.txt'.
- Refactored prompt cache key calculation in OpenAI responses to improve code clarity and ensure cache retention is only set when a cache key exists.
2026-02-06 02:20:41 +01:00
can1357 a5db81b90b fix(coding-agent/task): fixed task executor to handle null data in submit_result and added schema mismatch warnings
- Fixed task executor to properly handle agents calling `submit_result` with null data by treating it as missing and attempting to extract output from conversation text rather than silently failing.
- Added documentation caution in task.md about schema vs agent mismatch causing null output, with guidance on using `schema` parameter to override built-in schemas.
- Added warning message when subagent calls submit_result with null data to help diagnose schema mismatch issues.
2026-02-06 02:14:53 +01:00
can1357 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +01:00
can1357 fbf1b764ef feat(coding-agent/tools): added puppeteer query handler support and improved click action reliability
- Added support for puppeteer query handlers (aria/, text/, xpath/, pierce/) in selector parameters across all browser actions.
- Added automatic normalization of legacy p- prefixed selectors (p-aria/, p-text/, p-xpath/, p-pierce/) to modern puppeteer query handler syntax.
- Added enhanced actionability checking for click operations, validating visibility, pointer events, opacity, viewport intersection, and element occlusion.
- Fixed click action to properly handle text/ query handlers with timeout and retry logic instead of failing immediately.
- Fixed viewport application to only apply when in headless mode or when explicitly requested, preventing conflicts in headed browser mode.
2026-02-06 00:14:47 +01:00
can1357 0171cd7b75 refactor(utils): restructured stream utilities for improved reusability and correctness
- Extracted stream abort handling into dedicated `createAbortableStream` utility function for reuse across stream operations.
- Refactored `sanitizeBinaryOutput` to handle surrogate pairs correctly and filter additional control characters (DEL and C1 control block) with lazy array allocation.
- Simplified JSONL parsing by replacing manual buffer management with new `pullJSONL` generator method in ConcatSink class.
- Removed unused `createSanitizerStream` and `createTextDecoderStream` helper functions that are no longer needed.
- Refactored `readSseJson` to use generator-based line processing with fast-path optimization for OpenAI-style done markers.
- Updated stdio transport to use new `readJsonl` utility instead of manual JSON parsing with TextDecoder.
2026-02-05 23:39:05 +01:00
can1357 c2227e6a81 chore: bump version to 11.2.3 2026-02-05 21:07:09 +01:00
can1357 b12a27830c refactor(stream): improved SSE parsing & added GPT-5.3, Claude 4.6 Opus
- Extracted stream parsing utilities into reusable functions in pi-utils package (readLines, readJsonl, parseJsonlLenient, readSseJson).
- Replaced manual buffer management with ConcatSink class for efficient stream handling across multiple modules.
- Simplified SSE stream parsing in google-gemini-cli provider by using readSseJson utility instead of manual reader setup.
- Refactored MCP stdio transport to use readLines utility for cleaner line-based stream processing.
- Updated RPC client and mode to use readJsonl utility, removing duplicate JSONL parsing logic.
- Optimized buffer allocations by using allocUnsafe where data is immediately populated and reusing empty buffer instances.
2026-02-05 21:06:58 +01:00
can1357 0a8bd08565 chore: bump version to 11.2.2 2026-02-05 17:02:31 +01:00
can1357 50321eb783 fix: missing import 2026-02-05 16:59:49 +01:00
can1357 5a5dcba9ba chore: bump version to 11.2.1 2026-02-05 14:34:50 +01:00
can1357 92fc4f2d9a fix(coding-agent): fixed CLI invocation with flags only to route to default command
- Fixed CLI invocation with flags only (e.g. `pi --model=codex`) to route to the default command instead of erroring.
2026-02-05 14:34:32 +01:00
can1357 e71fabf279 chore: bump version to 11.2.0 2026-02-05 14:31:09 +01:00
can1357 f8950c22b4 refactor(auth-storage): cleanup auth.json mentions
- Migrated authentication storage from JSON-based (auth.json) to database-based (agent.db) format across test files and configuration.
- Simplified auth storage discovery in sdk.ts by removing manual path construction and fallback logic in favor of centralized getAgentDbPath() function.
- Removed dbPath instance property from AuthStorage class as database path is now managed centrally.
- Updated environment variable precedence documentation to reflect agent.db instead of auth.json as the lowest priority source.
- Removed OAuth provider section header comments from multiple test files for cleaner test organization.
- Added support for JSON and JSONC configuration file formats without requiring migration to YAML.
2026-02-05 14:30:22 +01:00
can1357 e47657c4d1 refactor(coding-agent/web): restructured web search providers to use modular class-based architecture
- Reorganized web search provider system to use individual provider classes in separate files under providers/ directory.
- Moved SearchProvider base class and SearchParams interface to dedicated providers/base.ts module.
- Consolidated provider management logic into provider.ts, replacing provider-info.ts.
- Updated web search execution to pass maxOutputTokens, numSearchResults, and temperature parameters to providers.
- Changed Perplexity search context size from 'high' to 'medium' and increased default max tokens from 4096 to 8192.
- Updated Anthropic and Gemini search providers to support max_tokens and temperature parameters.
2026-02-05 14:13:15 +01:00
can1357 9033482710 feat(coding-agent/session): removed legacy file-based auth migration and simplified AuthStorage to use only agent.db
- Removed legacy auth.json file-based authentication migration system and simplified AuthStorage to use only agent.db for credential storage.
- Simplified AuthStorage API by removing authPath and fallbackPaths parameters, now accepting only dbPath for improved startup performance.
- Deleted storage-migration.ts module containing legacy JSON-to-SQLite migration logic that is no longer needed.
- Removed getAuthPath() configuration function from config.ts as auth.json file-based storage is no longer supported.
2026-02-05 14:02:09 +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 178d1b604a refactor(coding-agent/cli): restructured CLI help rendering into dedicated oclif-help module
- Extracted custom help class implementation into dedicated oclif-help.ts module to centralize CLI help rendering logic.
- Refactored printHelp() function to delegate detailed help output to oclif's Help class, reducing code duplication and complexity.
- Extracted getExtraHelpText() function to isolate environment variables help section for reuse across help implementations.
2026-02-05 13:50:26 +01:00
can1357 22df49b81c feat(coding-agent): migrated CLI from custom parser to oclif framework for improved structure
- Migrated CLI from custom argument parser to oclif framework for improved command structure and maintainability.
- Reorganized CLI subcommands into individual command files under src/commands/ directory with oclif Command classes.
- Added oclif configuration to package.json with bin name 'omp', commands directory, and autocomplete plugin support.
- Refactored CLI entry point in src/cli.ts to use oclif's run() function with improved error handling.
- Simplified extension flag parsing by directly iterating raw arguments instead of using dynamic flag definitions.
- Updated CHANGELOG.md with comprehensive documentation of new oclif-based CLI commands and migration details.
2026-02-05 13:41:20 +01:00
can1357 99ea5b517b fix(agent): fixed abort error handling, exit codes, and stdout text conversion in streams
- Fixed handling of aborted requests to properly throw abort errors when stream terminates without a terminal event.
- Fixed exit error handling in ChildProcess.wait() to properly capture exit reasons and non-zero exit codes.
- Fixed stdout text conversion in ChildProcess.wait() to use Response API for proper text decoding.
2026-02-05 11:26:24 +01:00
can1357 b9ab0cc5cf feat(coding-agent/web): added web search CLI subcommand and refactored provider management
- Added new `omp q` CLI subcommand for testing web search providers with query, provider, recency, and limit options.
- Added web search provider information API with centralized provider-info module supporting authentication requirements and provider metadata.
- Added support for `hour` recency filter option in Perplexity web search.
- Refactored web search provider definitions into centralized provider-info module for improved maintainability.
- Updated web search result rendering to support long-form answers with text wrapping in CLI mode.
- Removed related questions section from web search result rendering.
2026-02-05 11:22:25 +01:00
can1357 3ff628764d feat(coding-agent/web): improved Perplexity search results with pro search type and fallback handling
- Added 'pro' search type to Perplexity API requests for improved search quality and relevance.
- Implemented fallback to search results when Perplexity API returns no citations, ensuring search results are always available to users.
- Added search_type field to PerplexityRequest web_search_options interface.
2026-02-05 11:16:30 +01:00
can1357 16ed34ebed feat(utils): refactored stderr handling API from boolean option to enum-like option
- Changed stderr handling API from `exposeStderr` boolean option to `stderr: "full" | null` enum-like option for clearer intent.
- Refactored ChildProcess constructor to accept stderr parameter directly instead of options object for simpler API.
2026-02-05 11:07:48 +01:00
can1357 435b778a29 refactor(coding-agent/web-search): added provider registry 2026-02-05 11:00:13 +01:00
can1357 1f7c4f6f90 refactor(stream-parsing): restructured stream utilities to use Web standard APIs and generic SSE parsing
- Refactored SSE stream parsing to use generic `readSseJson` utility instead of domain-specific handlers across multiple packages.
- Migrated from Node.js Buffer API to Web standard APIs (Uint8Array, TextDecoder, DataView) for cross-platform compatibility.
- Simplified stream transformation pipeline by consolidating multiple stream operations into unified `createTextLineSplitter` utility.
- Refactored `ptree.ts` to remove complex stream pumping infrastructure and simplify stderr handling with direct async iteration.
- Rewrote stream utilities to operate at binary level with byte-level parsing for improved efficiency and reduced string allocations.
- Updated TypeScript configuration to include DOM.AsyncIterable type definitions for async iterable DOM API support.
2026-02-05 10:59:47 +01:00
can1357 251d5a91ef fix(coding-agent/modes): fixed model switches deferred during streaming to apply correctly on completion
- Fixed model switches deferred during streaming to apply correctly when the stream completes, preventing model changes from being lost.
- Added pendingModelSwitch field to track deferred model changes during active streams.
- Added flushPendingModelSwitch() method to apply deferred model switches after streaming completes.
- Modified switchToPlanModel() to defer model changes when a stream is active instead of applying immediately.
- Modified exitPlanMode() to defer model restoration when a stream is active instead of applying immediately.
- Modified EventController to call flushPendingModelSwitch() when stream completion is detected.
2026-02-05 09:31:54 +01:00
can1357 f69671676d build(deps): migrated from @types/node to @types/bun for Bun runtime compatibility
- Migrated from @types/node to @types/bun across all packages to align with Bun runtime.
- Removed @types/node and bun-types from root and package-specific devDependencies.
- Updated tsconfig.base.json to remove 'node' from types array and 'DOM.AsyncIterable' from lib, keeping only Bun-compatible configurations.
- Simplified ReadableStream type annotation in openai-codex-stream.test.ts by removing explicit Uint8Array generic parameter.
2026-02-05 09:10:45 +01:00
can1357 928c210051 feat(coding-agent): added image file mention support with auto-detection and resizing
- Added support for image file mentions with automatic detection, resizing, and attachment via @filepath syntax.
- Enhanced file mention messages to support both text content and image attachments with optional line count for text files.
- Implemented image dimension information display in file mention UI.
- Updated file mention processing to respect image auto-resize settings.
- Modified file mention data structure to include optional image property and optional lineCount field.
- Refactored variable naming in file processor to remove unused variable convention.
2026-02-05 08:47:57 +01:00
can1357 adf3ad0383 fix(coding-agent/session): fixed plan mode context injection during streaming to prevent file edits
- Fixed plan mode toggles during streaming to inject plan-mode context immediately, preventing file edits while in plan mode.
- Updated file mention processing to respect image auto-resize settings.
- Added sendPlanModeContext method to inject plan mode context message into conversation history.
2026-02-05 08:45:22 +01:00
can1357 d1ccb24e7e chore: bump version to 11.1.0 2026-02-05 08:27:52 +01:00
can1357 a1786ce3b5 feat(coding-agent): added diagnostic sorting by severity, location, and message for consistent output
- Added `sortDiagnostics()` utility function to sort diagnostics by severity, location, and message for consistent output ordering.
- Changed diagnostic output to sort results by severity (errors first), then by file location and message for improved readability.
- Added `getSeverityRank()` helper function in render-utils to map diagnostic severity levels to numeric ranks for sorting.
- Integrated diagnostic sorting in LSP index module to apply consistent ordering before formatting diagnostics.
2026-02-05 08:11:07 +01:00
can1357 1a2e833974 feat: added Windows process handle duplication and signal handling for safe job termination
- Added Windows-specific process handle duplication mechanism to safely manage process termination across multiple handles.
- Implemented Windows signal handling support with Signal enum variants (Terminate, Kill, Interrupt) and kill_process() function using Windows API.
- Added background job termination on cancellation with platform-specific implementations (TERM/KILL signals on Unix, TerminateProcess on Windows).
- Implemented cancellation token support in shell execution with proper cleanup of background jobs when timeout or abort occurs.
- Added test coverage for background job termination on timeout and abort scenarios.
2026-02-05 08:10:52 +01:00
can1357 71f3acb6dc feat(coding-agent/task): added task isolation setting and dynamic schema configuration for isolated worktrees
- Added task isolation setting to enable running subagents in isolated git worktrees.
- Made task schema dynamically include isolated parameter only when isolation is enabled.
- Added validation to reject isolated parameter when task isolation is disabled.
- Updated task tool to conditionally render isolation documentation based on feature flag.
- Refactored task schema into factory function to support dynamic isolation configuration.
2026-02-05 08:00:08 +01:00
can1357 12b712dcbb feat(coding-agent/prompts): added thinking-level configuration to agent prompts
- Added thinking-level configuration parameters to agent prompts (explore: minimal, init: medium, plan: high, reviewer: high).
2026-02-05 07:50:02 +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 b902723cc9 refactor(coding-agent): converted class properties to TypeScript parameter properties across 51 files
- Converted class properties to TypeScript parameter properties across 51 files to reduce boilerplate code.
- Removed explicit field declarations and manual assignments in constructors by using TypeScript's parameter property syntax with access modifiers.
- Applied consistent pattern of declaring private readonly and public readonly properties directly in constructor parameters.
2026-02-05 06:34:12 +01:00
can1357 314a0044a3 feat(coding-agent/modes): refactored submenu settings API for improved ergonomics and type safety
- Converted SubmenuSettingDef.getOptions() method to options getter property for improved API ergonomics.
- Changed OptionProvider type to support both static arrays and function providers, enabling simpler configuration of option lists.
- Added createSubmenuSettingDef() helper function to simplify creation of submenu settings with flexible option providers.
- Refactored internal option provider definitions to use static arrays instead of arrow functions where applicable.
- Updated SelectSubmenu to enforce immutability of options parameter using ReadonlyArray type.
- Refactored select-list.ts to use TypeScript parameter properties for cleaner constructor implementation.
2026-02-05 06:34:01 +01:00
can1357 d656dcf7ac feat(coding-agent): refactored setThinkingLevel API to accept optional persist parameter
- Modified setThinkingLevel() API to accept optional persist parameter with default value of false, allowing callers to control whether thinking level changes are persisted to settings.
- Updated SetThinkingLevelHandler type signature to include optional persist parameter for consistency across extension handlers.
- Simplified setThinkingLevel method signature from accepting options object to accepting boolean persist parameter, improving API clarity.
2026-02-05 06:21:42 +01:00
can1357 37c74bb19d perf: migrated timing measurements to Bun.nanoseconds() for higher precision
- Migrated timing measurements from `performance.now()` to `Bun.nanoseconds()` for higher precision benchmarking across all benchmark and timing-sensitive code.
- Updated elapsed time calculations to convert nanoseconds to milliseconds using division by 1e6 to maintain consistent time units.
- Increased benchmark precision from 4 to 6 decimal places for per-operation timing measurements.
- Refactored grep benchmark to use averaged timing values instead of storing individual iteration times, reducing memory overhead.
2026-02-05 06:19:49 +01:00
can1357 e131000ed2 refactor(coding-agent): extracted external editor handling into shared utility module
- Extracted external editor handling logic into shared utility module to reduce code duplication across hook-editor and input-controller components.
- Created new external-editor utility module with getEditorCommand() and openInEditor() functions for centralizing editor process management and temporary file handling.
- Simplified hook-editor component by replacing manual editor spawning and file operations with openInEditor() utility function call.
- Simplified input-controller component by replacing manual editor spawning and file operations with openInEditor() utility function call.
2026-02-05 06:13:58 +01:00
can1357 f0b97f44fe chore: bump version to 11.0.3 2026-02-05 04:59:33 +01:00
can1357 8858250127 docs(coding-agent/cli): updated help text and documentation for expanded tool availability
- Updated help text to reflect expanded tool availability and simplified main description.
- Added documentation for new subcommands: commit, stats, jupyter, and grep in help text.
- Added documentation for browser and todo_write tools in available tools list.
- Updated --tools option documentation to clarify default behavior includes all tools.
- Reorganized environment variables section in help text for better clarity.
2026-02-05 04:59:19 +01:00
can1357 77a4455900 fix(coding-agent): fixed temporary model roles persisting by using override instead of set
- Fixed temporary model roles persisting by using override instead of set in settings initialization.
- Refactored model role assignment to use dedicated overrideModelRoles method instead of manual object manipulation.
2026-02-05 04:56:14 +01:00
can1357 a1a4824cd7 docs(coding-agent): added LLM provider env vars and expanded CLI help documentation
- Added comprehensive environment variables documentation including API keys for 11 new LLM providers (Groq, Cerebras, xAI, OpenRouter, Mistral, z.ai, MiniMax, OpenCode, Cursor, Vercel AI Gateway, Perplexity) and cloud provider configuration.
- Expanded CLI help text with detailed API keys section documenting all supported LLM providers, cloud providers, search services, and model override configuration variables.
- Fixed redundant fallback check in porting guide example by removing duplicate `Bun.env.HOME` reference.
2026-02-05 04:51:42 +01:00
can1357 89e6479661 refactor: migrated environment variable access from process.env to Bun.env across 71 files
- Migrated all environment variable access from Node.js `process.env` to Bun runtime `Bun.env` API across the entire codebase.
- Updated 71 files including source code, tests, documentation, and configuration to use Bun's native environment variable API.
- Added comprehensive environment variables documentation in `packages/coding-agent/docs/environment-variables.md` covering 100+ environment variables organized by category.
- Updated CHANGELOG entries to reflect migration from `process.env` to `Bun.env` and environment variable prefix changes (PI_* vs OMP_*).
- Maintained identical behavior and logic across all changes - only the environment variable access method was updated.
2026-02-05 04:51:18 +01:00