Commit Graph

1457 Commits

Author SHA1 Message Date
can1357 c8230be4a7 fix(coding-agent): fail fast when RPC startup exits early 2026-02-20 11:01:37 +01:00
can1357 55cf4de4b2 fix(ai): corrected OAuth token refresh error handling with provider details
- Improved OAuth token refresh error messages to include provider-specific error details from API responses.
- Separated rate limit and usage limit error handling in OpenAI response handler with distinct error messages and retry timing.
- Enhanced error message propagation in OAuth refresh flow to preserve original error reasons for better debugging.
- Fixed regex pattern in auth storage to use word boundaries for accurate HTTP status code matching.
2026-02-20 10:51:03 +01:00
can1357 f4fd00700f feat(session): added soft-delete support for auth credentials with audit trail
- Added `includeDisabled` parameter to `listAuthCredentials()` to optionally retrieve disabled credentials.
- Added `disableAuthCredential()` method for soft-deleting auth credentials while preserving database records.
- Changed auth credential removal to use soft-delete (disable) instead of hard-delete when OAuth refresh fails, keeping credentials in database for audit purposes.
- Added `disabled` column to auth_credentials table schema with automatic migration from v3 to v4.
- Added prepared statements for querying active (non-disabled) credentials with optional provider filtering.
2026-02-20 10:46:31 +01:00
can1357 f53864fccc feat(coding-agent): enabled intent tracing by default
- Changed default value of `tools.intentTracing` setting from false to true.
2026-02-20 10:46:17 +01:00
can1357 09f0a46c6d fix(coding-agent): allow non-adjacent insert anchors 2026-02-20 10:38:37 +01:00
Emil Sit c6f3eff8c4 fix(coding-agent): inline doc content in generated index instead of static imports
Static imports from '../../../../docs/' resolve correctly in the monorepo
but break when the package is installed from npm -- the docs/ directory
at the repo root is not included in the published tarball.

Switch the generator to read each file at build time and emit the content
as inlined string literals, eliminating all runtime file resolution.
2026-02-20 10:11:52 +01:00
can1357 cd5676a36d fix(coding-agent): inline embedded docs to avoid global install path breakage 2026-02-20 06:08:43 +01:00
Can Bölük afe6be6dc2 Merge pull request #115 from kenvunz/fix/screen-flickering
fix(coding-agent): stopped forced redraws on autocomplete updates
2026-02-19 22:29:06 +01:00
can1357 51ec9bd05d feat(coding-agent): enabled docs:// protocol and custom tool discovery from .omp/tools/
- Added docs:// internal URL protocol handler for accessing embedded markdown documentation files with path traversal validation.
- Added support for executable tool files (.ts, .js, .sh, .bash, .py) in custom tools discovery from .omp/tools/ and .claude/tools/ directories.
- Added generate-docs-index build script to automatically scan and embed markdown documentation files at build time.
- Updated system prompt to document docs:// protocol usage and identify agent as operating within Oh My Pi harness.
2026-02-19 22:19:00 +01:00
can1357 7ce3bb6906 feat(coding-agent): introduced hashline format v2 with colon separators and tag-based API
- Changed hashline format separator from pipe (|) to colon (:) for improved readability across all tools and output formats.
- Refactored hashline edit API with operation-based structure: renamed delete->rm, rename->mv, set->target/new_content, and added explicit op field for operation types.
- Updated hashline hash encoding from 4-character base36 to 2-character hexadecimal for more compact representation.
- Replaced anchor terminology with tags throughout hashline documentation and API for clearer semantics.
2026-02-19 22:04:18 +01:00
Ken Vu b0a6d710fb fix(coding-agent): stopped forced redraws on autocomplete updates
onAutocompleteUpdate was calling requestRender(true), which resets all
differential rendering state on every keystroke while the slash menu is
open (debounced at 100ms). This caused the TUI to perform a full screen
clear and repaint on each filter update, producing visible flicker when
the editor is pushed to the bottom of the terminal.

onAutocompleteCancel retains requestRender(true) since it fires only
once on dismissal and the forced redraw is needed to erase the stale
menu rows that the differential renderer would otherwise leave on screen.

onAutocompleteUpdate is changed to requestRender() (no force), letting
the differential renderer repaint only the changed lines within the
autocomplete area.
2026-02-20 09:25:41 +13:00
can1357 7f3079bf2f feat(coding-agent): added streamed tool intent display and hashline edit operations
- Added streamed tool intent display in working message to show real-time intent tracking during agent execution.
- Changed intent tracing field name from `$intent` to `_intent` across tool schemas and agent core for consistency.
- Added support for file deletion and renaming operations in hashline edit mode.
- Renamed hashline edit operation fields: `set` to `target`/`new_content`, `set_range` to `first`/`last`/`new_content`, `insert` to `inserted_lines`.
2026-02-19 18:05:35 +01:00
can1357 a80d00abfe feat: added intent tracing to capture tool call metadata
- Added optional `intent` field to `ToolCall` interface for capturing harness-level intent metadata.
- Added `intentTracing` configuration option to enable intent goal extraction from tool calls with automatic `$intent` field injection and argument stripping.
- Implemented intent injection and extraction logic in agent-loop to populate tool call intent metadata when intentTracing is enabled.
- Added `tools.intentTracing` setting to coding-agent configuration schema with environment variable override support.
2026-02-19 17:06:38 +01:00
can1357 aea59fa3e5 style: formatting 2026-02-19 17:06:21 +01:00
can1357 d22fb5e878 feat(patch): added file deletion and rename operations to hashline edit mode
- Added file deletion and rename operations to hashline edit mode with atomic semantics.
- Renamed hashline edit operation keys and fields for clarity: set->target, set_range->first/last, insert->before/after, body->new_content/inserted_lines.
- Added optional content-replace edit variant in hashline mode via PI_HL_REPLACETXT environment variable.
- Enhanced edit validation with per-variant type checking and detailed error messages for malformed operations.
2026-02-19 17:00:45 +01:00
can1357 c9c1077272 feat(tools/grep): added artifact:// URL resolution to grep tool for backing file search
- Added support for resolving internal artifact:// URLs in grep tool to search backing files.
- Fixed grep tool to properly handle internal URL resolution with validation for missing backing files.
- Added comprehensive test suite covering artifact URL resolution, regex patterns, and error handling.
- Optimized CI matrix to conditionally include platform variants based on git tag presence.
2026-02-19 15:47:15 +01:00
can1357 2bdcd618ad feat: introduced hashline API redesign with structured operations and LINE#ID format
- Redesigned hashline edit API with new operation names (set, set_range, insert) and structured body parameter accepting string arrays for multiline edits.
- Changed hashline reference format from LINE:HASH to LINE#ID throughout tools and documentation for improved clarity.
- Enhanced insert operation to support optional before/after anchors enabling flexible insertion positioning and boundary echo stripping.
- Made hashline autocorrect heuristics conditional on PI_HL_AUTOCORRECT environment variable for controlled behavior.
- Added benchmark reports for claude-haiku-4-5 and GPT-5.2-Codex models demonstrating hashline edit variant performance.
2026-02-19 15:02:59 +01:00
can1357 6c884713af feat(ai,coding-agent): add NanoGPT provider and login flow
Fixes #111
2026-02-19 13:51:47 +01:00
can1357 edeb816624 feat(coding-agent): added output flush sync to bash-interactive component
- Added flushOutput() public method to bash-interactive component for synchronizing terminal output completion.
- Enhanced SSH host discovery to load from managed omp config paths (.omp/ssh.json and ~/.omp/agent/ssh.json) with deduplication.
- Improved terminal output handling in interactive bash sessions to ensure queued writes complete before processing pending chunks.
- Refactored write queue consumption in bash-interactive to use index-based tracking instead of array shift operations.
2026-02-19 13:07:24 +01:00
can1357 e41ebe61ec feat(coding-agent): added SSH host management with CLI and slash commands
- Added SSH host management feature with `ssh` CLI command and `/ssh` slash command for add, list, and remove operations.
- Added SSH configuration support at project (.omp/ssh.json) and user (~/.omp/agent/ssh.json) scopes with host discovery from project files.
- Added SSH host configuration flags: --host, --user, --port, --key, --desc, --compat, and --scope for flexible host setup.
- Removed automatic line relocation on stale hash references; now fails with error instead.
2026-02-19 12:52:43 +01:00
can1357 a9fb9c9791 feat(react-edit-benchmark): resolved hashline regression with strict validation
- Added provider failure detection and exponential backoff retry logic to handle authentication and authorization errors in benchmark tasks.
- Implemented HashlineMismatchError behavior in coding-agent to fail on stale hash references instead of silently relocating edits.
- Simplified hashline validation by removing automatic line relocation logic and hash tracking infrastructure.
- Added benchmark report for claude-sonnet-4-6 model showing 85% task success rate with detailed failure analysis and performance metrics.
2026-02-19 12:52:13 +01:00
can1357 ab1c78c750 fix(bash-interactive): corrected terminal output serialization to prevent data loss
- Fixed terminal output handling to properly queue and serialize writes, preventing dropped or corrupted output in interactive bash sessions.
- Implemented write queue with callback-based draining to ensure sequential terminal writes.
- Removed try-catch fallback in output handling, relying on queued serialization for correctness.
2026-02-19 08:29:06 +01:00
can1357 f8a4c40216 fix(ai): corrected retry logic to detect connection failures consistently
- Added 'unable to connect' to transient error patterns in retry logic to properly handle connection failures.
- Updated retry error detection in coding-agent to match ai package pattern for consistency.
2026-02-19 07:20:19 +01:00
can1357 c4e83d317a fix(coding-agent): deduplicate provider lists, fix priority order
- Export SEARCH_PROVIDER_ORDER from provider.ts as single source of truth
- Remove duplicate provider arrays from web-search.ts and web-search-cli.ts
- Add missing 'kimi' to CLI command validation (was causing --provider kimi to reject)
- Move perplexity to top of auto-resolve priority
- Fix kimi position in priority order to match documentation
2026-02-19 05:54:42 +01:00
oglassdev 929e3d2c9b fix(coding-agent): format web search options 2026-02-19 05:53:14 +01:00
oglassdev 487eb9166c feat(coding-agent): add kimi web search provider 2026-02-19 05:53:14 +01:00
can1357 081f1063d9 fix(coding-agent): hardened mermaid prerender failure handling
Fixes #109
2026-02-19 05:31:10 +01:00
can1357 4dac726c8d feat(coding-agent): added streaming text preview with real-time delta updates
- Added streaming text preview during agent specification generation with real-time text delta updates.
- Added `onRequestRender` callback to agent dashboard for async UI re-renders on state changes.
- Improved system prompt preview rendering with text wrapping and line count indicators.
- Enhanced agent creation flow to display generation status hint and reordered spec review before input form.
2026-02-19 05:13:33 +01:00
can1357 e403ab698c feat(coding-agent): introduced AI-powered agent creation with architect model
- Added AI-powered agent creation flow with architect model for generating custom agent specifications from natural language requests.
- Added keyboard shortcuts (N for new agent, R for regenerate) and scope selection (project/user) for agent creation workflow.
- Added model suggestions UI and success/error notices to agent dashboard for improved creation feedback.
- Added system prompts for agent-creation-architect and agent-creation-user roles with 6-step methodology and JSON schema validation.
- Added file persistence with YAML frontmatter for storing agent specifications at project or user scope.
2026-02-19 05:07:26 +01:00
can1357 69664396a8 fix(tui): fixed history navigation visibility and paging
Fixes #99
2026-02-19 05:06:10 +01:00
can1357 e2bb5041d2 feat(coding-agent): add Agent Control Center dashboard
Closes #93
2026-02-19 04:56:52 +01:00
can1357 50eeaed282 fix: hardened codex session state and cleared tui shrink artifacts 2026-02-19 04:33:45 +01:00
can1357 9fd37c0f0f fix(coding-agent): prevented enter from clearing hook editor
Handle plain Enter/Return in HookEditorComponent as newline input so the editor no longer triggers the submit-reset path when no onSubmit handler is wired.

Ctrl+Enter submit behavior remains unchanged.

Fixes #100
2026-02-19 04:12:54 +01:00
can1357 f85e880f52 fix(coding-agent): lazy-load puppeteer to avoid cosmiconfig crash
Puppeteer uses cosmiconfig to search for its configuration at import time. cosmiconfig walks up from CWD parsing every package.json it finds. If any package.json in the search path has invalid JSON, the strict parse-json parser throws synchronously
during module evaluation, surfacing as an uncaught exception that crashes the entire process.
2026-02-18 19:14:50 +01:00
can1357 8c4023b9ed refactor(ai): extracted provider descriptor helpers to reduce boilerplate
- Extracted provider descriptor helper functions (descriptor, catalog, catalogDescriptor, simpleModelsDevDescriptor, openAiCompletionsDescriptor, anthropicMessagesDescriptor) to reduce boilerplate across 47+ provider definitions.
- Refactored model generation script to simplify OAuth credential lifecycle by moving storage cleanup to finally block and parallelizing special discovery sources with Promise.all().
- Consolidated provider validation logic in model registry into reusable validateProviderConfiguration() function with context-aware validation modes.
- Reorganized models.json structure to place contextWindow and maxTokens before compat field for consistency across all provider entries.
2026-02-18 17:48:00 +01:00
can1357 ba6f668644 fix(coding-agent): prevented auto-compaction after handoff 2026-02-18 17:48:00 +01:00
can1357 a4e704dbcf refactor(ai/provider-models): restructured provider models to unified descriptor pattern with priority sorting
- Unified provider descriptors into single source of truth in descriptors.ts module for runtime and catalog discovery.
- Consolidated model generation script to use declarative CatalogProviderDescriptor interface, reducing code duplication.
- Refactored model registry and selector to use descriptor pattern with priority-based sorting and version extraction.
- Added priority field to Model interface enabling provider-assigned model prioritization in discovery and selection.
- Added support for Synthetic model provider in web search command and improved model sorting by priority and version.
2026-02-18 17:48:00 +01:00
can1357 4011d7f565 feat(web-search): added Synthetic web-search + fixed Anthropic
- Implemented API client for the Synthetic web search provider.
- Configured Synthetic as a selectable option for web searches.
- Integrated Synthetic into the automatic provider fallback chain.
Fixes #102
2026-02-18 17:48:00 +01:00
can1357 e4a3648654 fix(ai): add Bearer auth header and fix web search tool name for OAuth
- Set Authorization: Bearer header in buildAnthropicHeaders when using OAuth
  (raw fetch path was sending no credentials)
- Use plain web_search tool name instead of prefixed web_search_20250305
  (Anthropic API rejects the prefixed name)
- Remove dead applySearchToolPrefix function and unused import

Fixes #102
2026-02-18 17:47:59 +01:00
can1357 53ee943c38 refactor(ai): migrated model policies to declarative provider descriptors
- Extracted model post-processing policies into dedicated model-policies module for improved testability and maintainability.
- Refactored model generation script to use declarative provider descriptors instead of 620+ lines of inline provider-specific logic.
- Consolidated provider model manager initialization to use descriptor-driven iteration, eliminating 29+ individual conditional blocks.
- Removed static bundled models for Ollama and vLLM from models.json to rely on dynamic discovery instead.
2026-02-18 17:47:59 +01:00
can1357 a1efc5f4e1 refactor(coding-agent): simplified error handling and import organization
- Reorganized import statements in openai-compat.ts for consistency.
- Consolidated multi-line ternary expression into single line in openai-compat.ts.
- Simplified AgentBusyError instantiation to use default message.
- Updated test assertion to check error type instead of message content.
2026-02-18 17:47:59 +01:00
can1357 e6f8001d9e feat: added 11 AI providers with OAuth and $pickenv() fallback support
- Added support for 11 new AI providers (Hugging Face, NVIDIA, Together, Ollama, LiteLLM, Xiaomi, Moonshot, Venice, Qwen Portal, vLLM, Cloudflare AI Gateway) with API key authentication and login flows.
- Implemented $pickenv() utility for environment variable fallback chains, enabling multi-key resolution for providers with alternative credential names.
- Extended KnownProvider and OAuthProvider types to include all 11 new providers with corresponding model manager functions and OAuth handlers.
- Expanded models.json with thousands of new model entries across all new providers and replaced deprecated opencode provider with cloudflare-ai-gateway.
- Refactored model generation script to use unified fetchProviderModelsFromCatalog() and centralized API key resolution for all providers.
2026-02-18 17:47:59 +01:00
can1357 e88facfc80 feat(coding-agent): added AgentBusyError with auto-retry for concurrent operations
- Added AgentBusyError exception class for concurrent operation handling across agent packages.
- Added automatic retry logic with 30-second timeout for agent prompts when agent is busy.
- Changed concurrent operation errors from generic Error to AgentBusyError for better error handling.
- Fixed model discovery to use default refresh mode instead of explicit 'online' parameter.
2026-02-18 17:47:59 +01:00
can1357 eb13a5f956 refactor(coding-agent): migrated model priorities to external JSON configuration
- Extracted model priority configuration from TypeScript constants to external priority.json file.
- Updated agent prompts (reviewer, explore, plan) to reference new model tier aliases (pi/slow, pi/smol, pi/plan).
- Removed hardcoded SMOL_MODEL_PRIORITY and SLOW_MODEL_PRIORITY constants from model-resolver.ts.
- Improved prompt formatting with consistent newlines and whitespace in agent configuration files.
2026-02-18 17:47:58 +01:00
Can Bölük d3bbfd05fd Merge pull request #98 from masonc15/feat/autocomplete-max-visible-setting
feat(coding-agent): expose autocomplete max items setting
2026-02-18 16:08:08 +01:00
can1357 bad4db1365 fix(models): aligned synthetic/cerebras auth and discovery 2026-02-18 15:43:46 +01:00
Gary Trakhman 270bc44f76 Fix lints 2026-02-18 15:43:46 +01:00
Colin Mason b55e6901f3 fix(coding-agent): coerce autocomplete setting values in runtime handler 2026-02-18 09:40:19 -05:00
Colin Mason bf0bcf73e2 feat(coding-agent): expose autocomplete max items setting
Wire the existing TUI autocompleteMaxVisible plumbing into the
declarative settings system so it appears in /settings under the
Input tab. Users can pick from 3/5/7/10/15/20 items; the TUI editor
clamps to 3-20 regardless.

- Add autocompleteMaxVisible to SETTINGS_SCHEMA (number, default 5)
- Add OPTION_PROVIDERS entry for the submenu dropdown
- Handle runtime side-effect in selector-controller
- Set initial value from settings on editor construction
- Add tests for default, runtime, persistence, and config loading
2026-02-18 09:40:16 -05:00
can1357 40fa09a488 fix(coding-agent): removed native addon asset requirement in updater
Fixes #101
2026-02-18 15:14:42 +01:00