- Added computeHashlineDiff function to compute diffs for hashline-based edits without applying them.
- Added support for hashline edits in tool execution with caching mechanism to avoid redundant diff computations.
- Added formatStreamingHashlineEdits function to format and display hashline edits with configurable limits.
- Enhanced EditRenderArgs interface with optional previewDiff and edits fields for hashline mode support.
- Refactored import paths from absolute package-scoped imports to relative imports for better module resolution.
- Exported `./patch/*` subpath in package.json for direct access to patch utilities.
- Updated import statements to use relative paths instead of package name imports.
- Added streaming functions `streamHashLinesFromUtf8` and `streamHashLinesFromLines` for processing large files with configurable chunking.
- Added `HashlineStreamOptions` interface to control streaming behavior with `startLine`, `maxChunkLines`, and `maxChunkBytes` options.
- Changed hashline format from 4-character to 2-character hex hashes for more compact output.
- Updated `computeLineHash` function to normalize whitespace and removed line number from hash seed for consistency.
- Improved CLI argument parsing with explicit handling of `--help`, `--version`, and subcommand detection.
- Removed `@types/diff` dev dependency as it is no longer needed.
- Created lightweight CLI framework in @oh-my-pi/pi-utils/cli as drop-in replacement for oclif with zero dependencies.
- Migrated coding-agent CLI from oclif framework to @oh-my-pi/pi-utils/cli with lazy command loading and simplified architecture.
- Changed default root command from 'index' to 'launch' for improved UX.
- Removed @oclif/core and @oclif/plugin-autocomplete dependencies from coding-agent package.
- Deleted custom oclif help renderer (oclif-help.ts) as help rendering is now integrated into the new CLI framework.
- Moved launch command from nested index/index.ts to top-level launch.ts for clearer command structure.
- Fixed line hash computation to normalize whitespace before hashing, ensuring consistent hashes for semantically identical lines.
- Removed index parameter from hash computation to prevent hash variance based on line position.
- Changed `HashlineEdit.src` from string format (e.g., `"5:ab"`, `"5:ab..9:ef"`) to structured `SrcSpec` object with discriminated union types (`{ kind: "single", ref: "..." }`, `{ kind: "range", start: "...", end: "..." }`, `{ kind: "insertAfter", after: "..." }`, `{ kind: "insertBefore", before: "..." }`, `{ kind: "substring", needle: "..." }`).
- Refactored `parseSrc` function to `parseSrcSpec` to handle structured `SrcSpec` objects instead of string parsing, replacing string validation and delimiter parsing logic with explicit case handling for each operation kind.
- Updated tool schema in `index.ts` to define `srcSpecSchema` as a discriminated union type with five variants, replacing the previous simple string-based `src` parameter definition.
- Added substring-based source matching for hashline edits to support matching lines by content when hash references are unavailable.
- Added automatic detection and repair of single-line merges where models incorrectly combine multiple lines into one.
- Added normalization of Unicode-confusable hyphens to ASCII hyphens to handle model-generated variations.
- Added heuristics to restore indentation and preserve wrapped line formatting during edits.
- Relaxed comma validation in src to allow commas while rejecting inputs with multiple line references.
- Enhanced parseLineRef to accept shorter hash prefixes instead of requiring exact hash matches.
- Improved error messages for hash mismatches to provide more actionable guidance.
- Replaced HashlineEdit API from old/new/after fields to src/dst fields with unified range syntax supporting single lines, ranges, insert-after, and insert-before operations.
- Added parseSrc() function to parse structured line references from src strings supporting formats like '5:ab', '5:ab..9:ef', '5:ab..', and '..5:ab'.
- Added heuristics to strip anchor line echoes and range boundary echoes from model-generated replacement content.
- Implemented preserveWhitespaceOnlyLinesLoose() for improved whitespace preservation using loose matching strategy when replacement line counts don't match.
- Added comprehensive benchmark reports for Claude Sonnet 4.5, Gemini 2.5 Flash Lite, and GPT-5.1 Codex Mini models evaluating hashline edit performance across 60 tasks.
- Added abort signal support to MCP server connection and tool listing operations, enabling cancellation via Escape key during testing.
- Enhanced MCP connection timeout handling with improved abort signal integration in the withTimeout function to prevent race conditions.
- Improved MCP test command UI to display '(esc to cancel)' indicator and handle cancellation gracefully.
- Updated HTTP transport session termination to include timeout mechanism preventing indefinite hangs.
- Fixed MCP test command cleanup to prevent resource leaks when operations are cancelled or aborted.
- Added abort event listener registration in bash executor to properly handle abort signals and clean up resources in finally block.
- Improved bash tool error handling to distinguish between user-initiated aborts via AbortSignal and other cancellations, throwing ToolAbortError for aborted requests.
- Wrapped bash executor command execution in try-finally block to ensure abort event listeners are properly removed after execution completes.
- Added MCPRequestOptions interface with signal property for request cancellation via AbortSignal.
- Added abort signal support to MCP tool execution enabling request cancellation via Escape-to-interrupt or other abort mechanisms.
- Enhanced MCP request handling with abort signal propagation through HTTP, SSE, and stdio transports with proper cleanup.
- Improved stdio transport request handling to use Promise.withResolvers for cleaner async flow and better abort signal integration.
- Updated HTTP transport to combine operation abort signals with timeout signals using AbortSignal.any() for unified cancellation.
- Modified SSE response parsing to support abort signals and distinguish between timeout and user-initiated cancellation.
- Added automatic stripping of `LINE:HASH|` display prefixes and unified-diff `+` markers from replacement content in hashline edits.
- Enhanced replace edits to preserve original whitespace on lines where only whitespace differs, preventing spurious formatting diffs when models reformat code.
- Added helper functions `stripNewLinePrefixes()`, `preserveWhitespaceOnlyLines()`, and `equalsIgnoringWhitespace()` to improve edit robustness.
- Enhanced system prompt to display tool descriptions alongside tool names for improved clarity on available capabilities.
- Added toolDescriptions data structure to system prompt rendering context, mapping tool names to their descriptions from the tools registry.
- Updated system prompt template to render tools in structured XML format with name and description elements instead of comma-separated list.
- Added `toArray()` helper function to normalize `string | string[]` inputs for hashline edit operations with comma-separated line reference support.
- Added `HashlineMismatchError` class that displays grep-style output with `>>>` markers for hash validation failures.
- Added `HashMismatch` type for representing individual hash mismatches with line number, expected hash, and actual hash.
- Updated `HashlineEdit` type to accept `string | string[]` for `old` and `new` fields, allowing both singular and plural input formats.
- Reduced hash length from 4 to 2 hex characters (16-bit hashes) for more concise line references.
- Enhanced `parseLineRef()` to strip display-format suffixes and `validateLineRef()` to throw `HashlineMismatchError` with context lines for better error reporting.
- Optimized line hash computation by precomputing hex lookup table and using bitwise operations instead of string formatting.
- Simplified conditional logic in read tool for hash and line number configuration.
- Refactored react-edit-benchmark model/provider parsing to use concise ternary operator.
- Added HashlineMismatchError class with formatted error messages showing mismatched hashes with context lines.
- Added HashMismatch type to represent hash validation errors with line number, expected, and actual hash values.
- Enhanced hash validation in applyHashlineEdits to collect all hash mismatches before applying edits instead of failing on first mismatch.
- Renamed HashlineEdit fields from 'src'/'dst' to 'old'/'new' for improved naming clarity and consistency.
- Added hashline edit mode for line-addressed edits using hash-verified line references with xxHash64 integrity verification.
- Replaced `edit.patchMode` boolean setting with `edit.mode` enum supporting 'replace', 'patch', and 'hashline' modes.
- Added `readHashLines` configuration setting to include line hashes in read output for hashline edit mode.
- Implemented `computeLineHash`, `formatHashLines`, `parseLineRef`, `validateLineRef`, and `applyHashlineEdits` utility functions for hashline operations.
- Updated read tool to support optional `hashes` parameter and prioritize hash lines over line numbers when both are requested.
- Changed `getEditModelVariants()` return type from `Record<string, 'patch' | 'replace'>` to `Record<string, EditMode | null>` and removed hardcoded model-specific defaults.
- Added inline hint support for slash commands with getInlineHint() method on SlashCommand and AutocompleteProvider interfaces.
- Added SubcommandDef interface for declarative subcommand definitions with name, description, and usage properties.
- Added subcommands and inlineHint properties to BuiltinSlashCommand interface for enhanced command configuration.
- Added getArgumentCompletions and getInlineHint functions to materialized slash commands for browser and mcp subcommand completion.
- Converted browser command to support subcommands (headless, visible) with inline hints.
- Converted mcp command to support 10 subcommands (add, list, remove, test, reauth, unauth, enable, disable, reload, help) with descriptions and usage hints.
- Added missing type annotation for `settings` parameter in `resolvePrimaryModel` function.
- Added missing type annotation for `settings` parameter in `resolveSmolModel` function.
- Added missing type annotation for `settings` parameter in `ModelSelectorComponent` constructor.
- Added `temperature` configuration setting to control LLM sampling temperature with values from 0 (deterministic) to 1 (creative) to -1 (provider default).
- Added temperature option selector in settings UI with preset values: Default, 0, 0.2, 0.5, 0.7, 1.
- Renamed `settingsInstance` parameter to `settings` in `CreateAgentSessionOptions` for consistency.
- Updated all internal references from `settingsInstance` to `settings` throughout SDK and components.
- Integrated temperature setting into agent configuration and selector controller.
- Removed unsafe OAuth endpoint extraction from error message text
- Fixed PKCE verifier storage with typed #codeVerifier field
- Fixed refresh token fallback using access token as refresh token
- Enforced restrictive file permissions (0o700/0o600) for MCP configs
- Fixed wizard buildConfig() to respect user-chosen env var and header names
- Fixed reauth endpoint discovery for non-OAuth servers
- Stored original config on connection, resolved config only for transport
- Added runtime type validation for enabled/timeout in config loaders
- Converted all TS private keywords to ES # private fields
- Wrapped uncaught throws in /mcp add with try/catch error handling
- Replaced new Promise with Promise.withResolvers() pattern
- Sanitized TUI output with replaceTabs/truncateToWidth
- Enforced http/https URL validation in add wizard
- Fixed greedy /mcp prefix match in input controller
- Corrected config filename references in MCP guide
- Added server name validation to updateMCPServer
- Fixed timeout timer leak in stdio transport
* + /mcp
- Reloads MCP manager in runtime state (no restart needed) and syncs with mcp.json.
- Handles OAuth discovery/auth flow automatically for auth-required servers.
- Validates server names and config shape before saving.
- Persists OAuth credentials in auth storage and links them to MCP config.
- Provides immediate connection checks and clear status messages.
- Supports enable/disable, reauth, and unauth flows that are easy to get wrong by hand.
* active agent tool registry runtime reload + token support for bearer auth http based transport
* +session rebind on succesful connection
* fix(coding-agent): address /mcp check failures
---------
Co-authored-by: can1357 <me@can.ac>
- Improved browser script evaluation to handle both expression and statement forms by adding fallback evaluation logic, fixing failures for certain script types.
- Migrated console.error() calls to structured logger.warn() and logger.error() throughout codebase.
- Updated os.tmpdir() import style in browser tool from destructured to namespace import.
- Enhanced skipped file messages to include file size information for better user visibility.
- Updated auto-read skip messages to display actual file size when files are too large to process.
- Inlined MAX_CLI_TEXT_BYTES calculation for improved code clarity.
- Fixed bash tool hanging with background jobs by implementing timeout-based cancellation and draining stdout/stderr pipes instead of waiting indefinitely for EOF.
- Fixed crash when auto-reading large @mentions by adding file size validation (5MB for text, 25MB for images) before reading file contents.
- Prevented out-of-memory issues by skipping files exceeding size limits and displaying file size information in UI for skipped files.
- Added GB file size formatting support to handle very large files in human-readable format.
- Added file size display in UI for skipped files to inform users why files were not included.
- Added test case verifying bash executor returns correctly when command spawns background jobs.
- Clarified that subagents automatically inherit full system prompt including AGENTS.md, context files, and skills -- do not repeat project rules or conventions in task context.
- Updated task context guidance to focus on session-specific information subagents lack, eliminating redundant documentation of project constraints already available to them.
- Refined constraints template to emphasize task-specific rules and session decisions rather than global project conventions.
- Expanded anti-patterns section to explicitly flag redundant context that wastes tokens by repeating AGENTS.md rules, project constraints, and tool preferences.
- Improved error handling in Python cell execution to preserve and display combined output from previous cells when an error occurs.
- Fixed tab character rendering in Python tool output display to properly format whitespace in cell output and status events.
- Enhanced error messages for failed Python cells to include full combined output context instead of just the error message.
- Updated error cell output styling to use error color theme instead of standard tool output color for better visual distinction.