Commit Graph

1739 Commits

Author SHA1 Message Date
can1357 3a3c6fb17d chore: bump version to 11.6.0 2026-02-07 05:00:24 +01:00
can1357 ba8b9de696 fix(coding-agent): backported pi-mono changes (9ce0007..f9161c4)
packages/agent:
- feat: added hasQueuedMessages() and dequeue helpers for steering/follow-up queues
- fix: resume queued messages from continue() after auto-compaction

packages/ai:
- feat: added Bedrock cache retention support with PI_CACHE_RETENTION env var
- feat: added adaptive thinking for Bedrock Opus 4.6+ models
- feat: added AWS_BEDROCK_SKIP_AUTH for unauthenticated Bedrock proxies
- feat: added AWS_BEDROCK_FORCE_HTTP1 for custom endpoints requiring HTTP/1.1
- feat: re-exported Static, TSchema, Type from @sinclair/typebox
- fix: disabled OpenAI Responses storage by default (store: false)
- fix: clamped reasoning effort for gpt-5.3 Codex models (minimal -> low)
- fix: Bedrock supportsPromptCaching checks model cost fields

packages/coding-agent:
- feat: added /quit slash command as alias for /exit
- feat: added per-model overrides (modelOverrides) in models.json
- feat: merged custom models with built-ins by provider+id instead of replacing
- fix: assistant message spacer before tool executions without visible content
- fix: extension runner emit() type safety with narrowed event/result types
- fix: extension runner tool_result event chaining via dedicated emitToolResult()
- fix: queued messages not delivered after auto-compaction completes
2026-02-07 04:59:57 +01:00
can1357 5b335aa6a6 fix(coding-agent/tui): sanitize tabs and strip swarm_context in task renderer
- Apply replaceTabs to all text rendering paths in task tool (output,
 task section, context, review explanations, finding bodies)
- Strip <swarm_context> block from expanded task view since it is the
 shared context duplicated across every task
2026-02-07 04:55:59 +01:00
can1357 ff4dba9045 fix(coding-agent/tui): wrap long lines in todo_write renderer instead of truncating
todo_write renderResult used truncateToWidth with Ellipsis.Omit which
silently drops content, and the empty-todos fallback returned a raw
component that bypassed width handling entirely. Switched all paths
to return Text(text, 0, 0) which applies wrapTextWithAnsi at render
time, preserving full todo content on narrow terminals.
2026-02-07 04:51:27 +01:00
can1357 cb89110a37 chore: bump version to 11.5.2 2026-02-07 03:10:52 +01:00
can1357 9d8ba23b7d fix(coding-agent/tui): wrap long lines in ask tool renderer instead of overflowing
Ask tool renderResult returned raw line arrays that bypassed the Text
component's word wrapping, causing a TUI crash when user input exceeded
terminal width. Switched all renderResult code paths to return
Text(text, 0, 0) which applies wrapTextWithAnsi at render time.
2026-02-07 03:09:34 +01:00
can1357 fc342e3db5 chore: bump version to 11.5.1 2026-02-07 02:45:45 +01:00
can1357 5b6f88dd95 fix: fixed #11 schema normalization, #10 version parsing, and variable declarations
- Fixed schema normalization in Google provider to handle array-valued type fields by converting them to single type with nullable flag.
- Refactored version parsing in install script to use bash parameter expansion instead of IFS field splitting.
- Changed variable declarations from let to var in theme module global scope.
2026-02-07 02:43:56 +01:00
can1357 2a7a2796a8 chore: bump version to 11.5.0 2026-02-06 09:44:20 +01:00
can1357 25d7156ac5 feat(coding-agent/session): added terminal breadcrumb tracking for concurrent session management
- Added terminal breadcrumb tracking to remember the last session per terminal, enabling `--continue` to work correctly with concurrent sessions in different terminals.
- Implemented `getTerminalId()` function to identify the current terminal using TTY device path or environment variables (Kitty, tmux, macOS Terminal, Windows Terminal).
- Implemented `writeTerminalBreadcrumb()` function to persist terminal-to-session mappings in the agent directory.
- Implemented `readTerminalBreadcrumb()` function to retrieve the last session for the current terminal, scoped to the current working directory.
- Modified session initialization to write breadcrumbs when loading or creating sessions, ensuring terminal context is preserved.
2026-02-06 09:41:38 +01:00
can1357 5a49b4707f refactor(coding-agent/tools): removed unused imports and functions from browser tool
- Removed unused import of resolveToCwd from path-utils module.
- Removed unused resolveArtifactsDir function that was not called elsewhere.
- Prefixed unused ctx parameter with underscore to indicate intentional non-usage.
2026-02-06 09:40:55 +01:00
can1357 aa69f5dd3d feat(coding-agent): refactored screenshot and image handling for PNG-only format and improved memory efficiency
- Changed screenshot format to always use PNG instead of supporting JPEG with quality parameter.
- Changed default extract_readable format from text to markdown.
- Changed screenshot storage to use temporary directory with Snowflake IDs instead of artifacts directory.
- Changed ResizedImage interface to return buffer as Uint8Array with lazy-loaded base64 data getter for improved memory efficiency.
- Removed JPEG quality parameter from screenshot options.
- Removed ability to save screenshots to custom paths or artifacts directory.
2026-02-06 09:20:32 +01:00
can1357 6ce097cf87 chore: bump version to 11.4.1 2026-02-06 07:39:07 +01:00
can1357 4eef01bdaa fix: fixed tab character display holes in UI by sanitizing output
- Fixed tab character display in error messages and bash tool output by applying replaceTabs() sanitization.
- Added TUI rendering sanitization documentation to AGENTS.md with guidelines for sanitizing text in tool renderers.
- Applied replaceTabs() function to error text in patch shared module to ensure proper tab-to-space conversion.
- Applied replaceTabs() function to bash tool output lines in both expanded and collapsed display modes.
2026-02-06 07:38:46 +01:00
can1357 31d26d75d6 chore: bump version to 11.4.0 2026-02-06 07:32:50 +01:00
can1357 8904798cc0 refactor(coding-agent): renamed XML tag <important> to <caution> for semantic clarity
- Renamed XML tag `<important>` to `<caution>` across system prompts and tool documentation for improved semantic clarity.
- Collapsed multi-line function calls to single lines in diff component formatting for improved code conciseness.
- Consolidated emoji guideline into critical section in write tool documentation.
- Fixed whitespace visualization in CHANGELOG diff output and corrected incomplete text.
2026-02-06 07:27:12 +01:00
can1357 f0c6399d69 fix(patch): fixed patch applicator to preserve indentation in context-only hunks
- Fixed patch applicator to preserve indentation in context-only hunks by skipping unnecessary adjustments when pattern equals actual content.
- Implemented linear regression-based tab width inference to correctly convert space-indented diffs to tab-indented files using ax+b model.
- Added regression tests for context-only hunk handling and space-to-tab indentation conversion with offset models.
- Updated patch tool documentation to emphasize never using edit operations for indentation or formatting fixes.
2026-02-06 07:24:48 +01:00
can1357 228ea7daeb feat(coding-agent/modes): added visualization of indentation in patch application with dim glyphs
- Added visualization of leading whitespace (indentation) in diff output with dim glyphs--tabs display as ` -> ` and spaces as `·` for improved readability.
- Implemented visualizeIndent() function to normalize and display indentation patterns, collapsing 3-space groups into tab arrows and marking individual spaces with middle dots.
2026-02-06 07:14:57 +01:00
can1357 685736667e fix(coding-agent): fixed tab character rendering causing UI holes by converting tabs to spaces
- Fixed tab character rendering in tool output previews and code cell displays by converting tabs to spaces for consistent terminal display.
- Applied replaceTabs() function across patch rendering, write tool output, and code cell output to ensure uniform tab handling.
2026-02-06 07:10:33 +01:00
can1357 97628bfe0f fix(coding-agent): fixed todo carryover in session initialization and formatting
- Fixed `newSession()` to properly await session manager operations for full initialization.
- Changed session formatting to use XML structure instead of YAML for tools and tool invocations.
- Added formatArgsAsXml() helper function to serialize objects as XML parameter elements.
- Removed trailing whitespace from task.md prompt file.
- Added regression test for AgentSession.newSession() to verify proper session switching and artifact isolation.
2026-02-06 07:10:06 +01:00
can1357 bf8267e807 chore: bump version to 11.3.0 2026-02-06 05:36:37 +01:00
can1357 1849d51458 fix(coding-agent/tui): fixed background color stability in output blocks with SGR reset sequences
- Fixed background color stability in output blocks when inner content contains SGR reset sequences, preventing background color from being cleared mid-line.
2026-02-06 05:35:56 +01:00
can1357 4dfeebe36a fix(coding-agent/tui): fixed spurious ellipsis and improved hash collision resistance
- Fixed spurious ellipsis appended to output lines that were already padded to terminal width by trimming trailing spaces before truncation check.
- Improved hash function to include string length in hash computation for better collision resistance.
2026-02-06 05:31:14 +01:00
can1357 fa82cd3b1f perf(tui): optimized cache key computation in Box component with incremental hashing
- Optimized cache key computation in Box component by replacing JSON serialization with incremental hashing.
- Fixed indentation inconsistencies in tree-list rendering logic.
2026-02-06 05:28:28 +01:00
can1357 7222bc1eae feat(tui): removed cursor positioning and refactored TUI rendering with explicit env defaults
- Removed getCursorPosition() method from Component interface and implementations, eliminating hardware cursor positioning support.
- Changed PI_HARDWARE_CURSOR environment variable default from implicit true to explicit '1' with fallback pattern.
- Changed PI_CLEAR_ON_SHRINK environment variable default from implicit false to explicit '0' with fallback pattern.
- Added screen clearing on TUI startup to prevent shell prompts from bleeding into first rendered frame.
- Refactored full-render logic into reusable fullRender() helper function.
2026-02-06 05:18:02 +01:00
can1357 3240318338 feat(coding-agent/session): externalized large images to content-addressed blob store
- Added BlobStore class for content-addressed storage of large binary data externalized from session files.
- Added getBlobsDir() function to retrieve the path to the blob store directory.
- Added blob reference format (blob:sha256:<hash>) for tracking externalized image data in sessions.
- Changed image persistence to externalize images >=1KB to content-addressed blob store instead of compressing inline, reducing JSONL file size.
- Changed session loading to automatically resolve blob references back to base64 image data.
- Changed session forking to resolve blob references in copied entries to ensure data integrity.
2026-02-06 03:20:49 +01:00
can1357 311c3de836 refactor(coding-agent/modes): removed unused seenNonToolContent tracking logic from event controller
- Removed unused seenNonToolContent tracking logic from event controller.
2026-02-06 03:15:34 +01:00
can1357 72f99393ea feat(coding-agent/tools): added automatic image compression to screenshot tool with enhanced output details
- Added automatic image compression to screenshot tool using the same resizing logic as pasted images, reducing API payload size while maintaining quality.
- Enhanced screenshot output to display compression details including final dimensions and MIME type when images are resized.
2026-02-06 03:10:37 +01:00
can1357 a91a2f9d5d refactor(coding-agent/modes): extracted Alt+Enter follow-up message handling into dedicated handleFollowUp() method
- Extracted Alt+Enter follow-up message handling from inline editor callback into dedicated handleFollowUp() method.
- Moved follow-up keybinding registration to use new handleFollowUp() method instead of inline callback.
2026-02-06 03:07:40 +01:00
can1357 42dec91f2a feat(coding-agent): implemented width-aware text truncation and render caching across tool renderers
- Implemented width-aware text truncation across all tool renderers to respect terminal width constraints and prevent output overflow.
- Enhanced render caching to include width parameter for cache invalidation when terminal width changes, improving cache accuracy.
- Migrated truncateToWidth function imports from render-utils to centralized tui module for better code organization.
- Introduced Hasher utility for generating width-aware cache keys in calculator, find, grep, todo-write, and write tools.
- Optimized box component rendering to only truncate lines that exceed content width, reducing unnecessary truncation operations.
2026-02-06 03:07:30 +01:00
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