Commit Graph

5589 Commits

Author SHA1 Message Date
Theo Mathieu 416c9947bd fix(acp): finish prompt turn when extension/custom command is handled locally
Extension commands (e.g. /sonnet) and TypeScript custom commands that
consume the input without calling the LLM return early from
session.prompt() with no agent turn. In ACP mode this left the pending
prompt promise unresolved, hanging the client forever.

Change session.prompt() to return Promise<boolean>: true when the LLM
was invoked, false when the command was fully handled locally.
#runPromptOrCommand calls #finishPrompt immediately on a false return so
the ACP turn completes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
Theo Mathieu b0063a08f0 fix(acp): include builtin aliases in reserved-command filter for extensions
ACP_BUILTIN_SLASH_COMMANDS only carries primary names; the reserved set
passed to getRegisteredCommands was therefore missing aliases like
"models" (/model) and "force:" (/force). An extension registering one
of these aliases would appear in the palette but the builtin would win
at dispatch time (lookupBuiltinSlashCommand searches aliases too).

Export ACP_BUILTIN_RESERVED_NAMES from acp-builtins — the union of all
primary names and aliases for ACP-surfaced builtins — and use it as the
reserved set. Widen getRegisteredCommands parameter to ReadonlySet since
it only calls .has().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
Theo Mathieu d8db20cb0d fix(acp): advertise extension commands before custom TS commands
Dispatch in AgentSession runs #tryExecuteExtensionCommand before
#tryExecuteCustomCommand, so the palette must reflect the same order.
Moving the extension-runner block before session.customCommands ensures
that on a name collision the advertised command matches what will
actually execute.

Update the test to assert the extension description wins over the
colliding custom TS description.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
Theo Mathieu 0d67407773 fix(acp): address review comments on extension-commands PR
- Update ordering comment in #buildAvailableCommands to document the
  extension tier and explain why skills/custom TS commands intentionally
  shadow extension commands (unlike interactive mode)
- Add CHANGELOG entry under [Unreleased]
- Add regression test: verifies extension commands surface in
  available_commands_update and that a builtin-colliding extension
  command is excluded via the reserved-set, with no duplicates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
Theo Mathieu f6ff54bb75 fix(acp): emit extension-registered commands in available_commands_update
`#buildAvailableCommands` was omitting commands registered by extensions
via `extensionRunner.getRegisteredCommands()`. ACP clients (e.g. Zed)
never saw these in the `available_commands_update` notification, so they
couldn't forward the corresponding slash commands to the agent.

Mirrors the interactive-mode pattern: pass ACP builtin names as the
reserved set so extensions cannot shadow core commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
can1357 4824c58132 fix(coding-agent/edit): hid the preview label on expanded streaming diffs
The streaming-spinner relocation in 61a57c1d2 re-added the trailing
"(preview)" label to expanded approval previews whenever a spinner frame
was active, breaking the #1992 contract. Expanded previews now drop the
label but keep the animated glyph so the volatile tail stays live.
2026-06-10 08:04:48 +02:00
can1357 d616fbf991 chore: bump version to 15.10.11 2026-06-10 07:50:54 +02:00
can1357 661587e110 feat(coding-agent): raised retry limits to ten with capped exponential backoff
- Raised Anthropic provider retries to 10 attempts and used a shared jittered exponential backoff for each retry.
- Updated coding-agent retry defaults and session delay calculation to a 500ms base with an 8,000ms jittered cap.
- Added tests that verify capped ten-step backoff sequences and recovery after repeated 502 errors.
2026-06-10 07:49:12 +02:00
can1357 15fc5af5e1 chore: update changelogs 2026-06-10 07:28:05 +02:00
can1357 529706c368 Merge remote-tracking branch 'origin/farm/d501d509/modelroles-comma-fallback' 2026-06-10 07:26:15 +02:00
can1357 61a57c1d21 fix(coding-agent): stabilized streaming TUI rendering with readonly rows and memoized reuse
- Changed render methods to return component-owned `readonly string[]` rows.
- Added `RenderStablePrefix` row reuse to avoid repainting unchanged streaming content.
- Stabilized streaming gutters and spinner placement to reduce preview jitter and flicker.
- Finalized commit-safe transcript behavior for tool-call previews and added streaming edge-case tests.
2026-06-10 07:26:02 +02:00
can1357 53b8950072 fix(coding-agent/edit): stopped stacking adjacent diff gap markers
- Separated non-contiguous diff regions with a single blank gap row, normalized after block-context insertion.
- Rendered gap rows as one dim ellipsis in the TUI and HTML export.
- Applied the same blank-separator dedupe and edge-trimming to hashline's compact diff preview.
2026-06-10 07:23:29 +02:00
can1357 b0fec42218 feat(coding-agent): surfaced lazy LSP servers as available in welcome screen
- Added "available" status so recognized servers show under lazy mode without warmup.
- Rendered full welcome box as pre-TUI splash with fixed slot heights to avoid layout shift.
- Reported lazy servers as available in /status instead of omitting the section.
2026-06-10 07:22:22 +02:00
can1357 a25d521cab refactor(catalog): baked thinking metadata into buildModel pipeline
- Replaced minLevel/maxLevel range with explicit efforts array plus baked effortMap/supportsDisplay wire facts.
- Removed runtime enrichment layer and modelOmitsReasoningEffort; providers now read baked fields.
- Fixed dotted Opus 4.7/4.8 ids missing adaptive display via classifier-based predicates (#1373).
- Bumped model cache schema to v4 to invalidate pre-efforts rows.
2026-06-10 07:22:11 +02:00
can1357 8c04c5576a feat(coding-agent): added lazy LSP startup setting and defaulted warmup behavior
- Added an `lsp.lazy` boolean setting with default `true` so LSP servers start on first use.
- Updated session startup logic to run LSP warmup only when `enableLsp`, UI is enabled, and lazy startup is disabled.
- Documented the new lazy LSP initialization behavior and defaults in SDK and LSP tool docs.
2026-06-10 06:44:58 +02:00
roboomp 3110304040 fix(models): split direct model role fallback chains
Route direct model role resolution through the configured pattern normalizer so comma-separated fallbacks are parsed before thinking selectors. Add resolver coverage for preserving :off and trying later entries.\n\nFixes #2228
2026-06-10 04:44:50 +00:00
can1357 1dc95e72fc fix(coding-agent/tools): normalized ask tool call args to prevent TUI render crashes
- Normalized untrusted `questions` arguments by parsing double-encoded JSON strings and skipping invalid question entries before rendering.
- Added option normalization that dropped malformed option items while preserving valid entries in multi-choice rendering.
- Expanded ask tool renderer tests to verify malformed or unparsable questions no longer crash and now fall back safely.
2026-06-10 06:33:35 +02:00
can1357 abba626704 refactor(coding-agent/scripts): renamed dev-launch scripts and preload shim to omp paths
- Renamed `packages/coding-agent/scripts/dev-launch` to `packages/coding-agent/scripts/omp` and updated the preload script reference in that launcher.
- Renamed `packages/coding-agent/scripts/dev-launch-preload.ts` to `packages/coding-agent/scripts/omp.ts` and adjusted its header comment.
- Updated the `install:dev` script in `package.json` to symlink the global `omp` command from the renamed launcher path.
2026-06-10 06:28:22 +02:00
can1357 ae415199dc feat: added build-time compatibility in ModelSpec/buildModel pipeline
- Centralized catalog and registry handling on `ModelSpec` and `buildModel`, resolving compatibility at model build time.
- Removed runtime compatibility detectors and switched provider request flows to direct `model.compat` reads.
- Added compat fields (`supportsReasoningParams`, `alwaysSendMaxTokens`, `strictResponsesPairing`, `whenThinking`).
- Persisted explicit compatibility overrides through `compatConfig` in discovery and cache merge paths.
2026-06-10 06:20:51 +02:00
can1357 fe61625ca8 build(coding-agent): pointed on-repo bin at TS source for source installs
- Switched `bin.omp` to `src/cli.ts` so `bun link`/`install.sh --source` work without a build.
- Added `publishBin` override so release rewrites `bin` to the prepack bundle `dist/cli.js`.
- Exported `applyPublishBin` and packed the agent with its published bin in the install smoke.
2026-06-10 05:36:57 +02:00
can1357 7b71a6016d fix(coding-agent): routed Windows batch stdio launches through cmd.exe
- Added Windows batch-command detection and COMSPEC-based cmd.exe resolution for MCP stdio spawns.
- Escaped and quoted batch command arguments, then routed .cmd and .bat commands through cmd /d /s /c.
- Updated the stdio transport tests to assert wrapped cmd.exe command arrays and escaping behavior.
2026-06-10 04:40:08 +02:00
can1357 1610882151 ux(coding-agent/cli): updated usage CLI to report per-window quota capacity remaining
- Updated usage-window reporting to track remaining account quota instead of required-account counts.
- Replaced the computed "needed" metric with a non-negative remaining-quota value derived from each window's total minus used fraction.
- Changed usage output lines from "need" to "capacity" and now show used/total accounts with remaining quota multiplier.
2026-06-10 04:39:57 +02:00
can1357 e14a63da6d feat(cross-cutting): centralized model compatibility handling with catalog resolvers
- Added catalog-level host/model predicates and compat resolvers.
- Extended compatibility types and model schema with timeout and replay flags.
- Replaced provider-specific heuristics with shared resolver-based checks.
- Updated host/identity and resolver tests to validate the new behavior.
2026-06-10 04:39:42 +02:00
can1357 7572e4f04c Merge remote-tracking branch 'origin/farm/48d8eb10/windows-mcp-command' 2026-06-10 04:28:06 +02:00
can1357 037aa6b345 fix(coding-agent): routed non-bracketed paste payloads to hook components
- Added a `pasteText` handler to `HookEditorComponent` to forward non-bracketed OSC 5522 paste text into its inner editor.
- Added a `pasteText` handler to `HookInputComponent` that forwards text to the input and resets the interaction timeout.
- Extended hook editor and timeout tests to cover enhanced-paste payload absorption and behavior retention.
2026-06-10 04:25:08 +02:00
can1357 a707e2daf9 feat(tui-components): added searchable filtering and focus retention for settings lists
- Added type-to-search filtering across setting labels, IDs, values, and descriptions.
- Preserved selected item focus by ID when replacing settings during an active filter.
- Displayed search status, empty-filter hints, and no-match messaging while searching.
- Updated Escape handling to clear an active query before cancelling the list.
- Applied selection and navigation to filtered items to keep behavior consistent under search.
2026-06-10 04:24:54 +02:00
roboomp 376675253f fix(mcp): preserved windows cmd argv launch
Resolved the Windows stdio MCP regression by keeping resolved .cmd shims on the direct argv spawn path instead of rewriting them through cmd.exe /c. Added regression coverage for explicit and PATHEXT-resolved codegraph.cmd commands.\n\nFixes #2220
2026-06-10 02:18:35 +00:00
can1357 b22694e406 Merge remote-tracking branch 'origin/farm/81cee2f1/project-tagged-mental-model-seeds' 2026-06-10 04:07:07 +02:00
can1357 1b9d9d0851 refactor(catalog)!: split model catalog from pi-ai
Move bundled models, model cache/manager, thinking metadata, effort helpers,
provider descriptors/discovery, wire constants, and model identity utilities
into the new @oh-my-pi/pi-catalog package.

Update pi-ai to keep provider runtime/auth concerns, move catalog provider
metadata into CATALOG_PROVIDERS, and migrate coding-agent, agent, stats, docs,
and tests to import catalog values from pi-catalog.

Split coding-agent model registry helpers into discovery, roles, and models
config modules while preserving registry orchestration.

BREAKING CHANGE: @oh-my-pi/pi-ai no longer exports catalog subpaths such as
/models, /model-cache, /model-manager, /model-thinking, /effort,
/provider-models*, discovery helpers, and provider wire constants; use the
matching @oh-my-pi/pi-catalog subpaths instead.
2026-06-10 04:06:57 +02:00
can1357 b3166b3dd2 feat(coding-agent/slash-commands): added /stats slash command to launch local dashboard
- Added a `/stats` builtin slash command that parses `--port` arguments and reports usage errors.
- Added a stats dashboard helper that syncs sessions, reuses a running server, and opens the local dashboard URL.
- Updated the changelog to document the new `/stats` command behavior for active sessions.
2026-06-10 04:02:33 +02:00
can1357 e3828b0bd1 fix(coding-agent): fixed usage-limit retry delay to use earliest sibling unblock
- Added auth-storage regression coverage in `packages/ai` for `markUsageLimitReached` returning the earliest sibling unblock time when all credentials are momentarily blocked.
- Added an agent-session retry-cap test ensuring usage-limit 429 retries wait for sibling unblock and succeed within `retry.maxDelayMs` instead of giving up.
- Updated retry-policy docs and both package changelogs to document the sibling-unblock fallback behavior.
2026-06-10 03:59:13 +02:00
can1357 8583421362 perf(coding-agent): deferred heavy imports until first feature use
- Added lazy async module loaders for @babel/parser, linkedom, puppeteer/browsers, @mozilla/readability, @xterm/headless, and mnemopi to avoid loading them during cold startup.
- Added an interactive startup splash before session construction and skipped it for resume/fork/continue, quiet mode, timing mode, or non-TTY runs.
- Updated JS import-rewrite and memory tests to match async parser loading and preloaded mnemopi modules for sync state helpers.
2026-06-10 03:57:32 +02:00
can1357 dc5c93462f feat: rerouted worker subprocesses through the bundled CLI host entrypoint
- Rerouted sync, tab, js-eval, and tiny workers to re-enter CLI modes via `__omp_*` selectors.
- Adjusted `cli.ts` startup to dispatch worker entrypoints before parsing and exit 1 on uncaught errors.
- Bundled CLI as `dist/cli.js` in prepack, switching `omp` binary and published files.
- Removed explicit Bun `--compile` worker entrypoints from build/release scripts in favor of host-entry dispatch.
- Added `declareWorkerHostEntry()` and `workerHostEntry()` environment helpers and `PI_COMPILED` binary detection.
2026-06-10 03:57:31 +02:00
roboomp a30eafdf24 fix(hindsight): scoped project mental model seeds
Project-tagged Hindsight mental-model seeds now use project-qualified ids and legacy bare ids only satisfy the matching project tag. The injected mental-model block also filters tagged models to the active project while retaining untagged models.\n\nFixes #2218
2026-06-10 01:25:02 +00:00
can1357 f638a5b3e0 refactor(coding-agent): added lazy loading for heavy dependencies
- Introduced memoized dynamic import loaders for Babel parser, mnemopi modules, puppeteer, and HTML-related packages.
- Refactored eval import-rewrite helpers and runtime call sites to use asynchronous wrapping and parsing flows.
- Shifted fetch and web-scraper linkedom usage to on-demand imports so heavy modules load only when needed.
2026-06-10 03:09:09 +02:00
can1357 1c821972a4 Merge remote-tracking branch 'origin/farm/98dbd737/readfile-uri-docs' 2026-06-10 02:45:05 +02:00
can1357 7124c74067 fix(ai): waited for sibling unblock over provider retry window
- Returned earliest sibling block expiry from markUsageLimitReached.
- Capped usage-limit retry to whichever frees up first, avoiding multi-hour waits.
- Added 1s buffer so retry lands after the block actually lapses.
2026-06-10 02:44:40 +02:00
can1357 35474d98be refactor(config): moved lastChangelogVersion to marker file
- Stored last-seen version in ~/.omp/agent/last-changelog-version so version bumps no longer dirty user configs.
- Migrated the legacy config.yml key into the marker, never clobbering a newer existing marker.
- Added read/write helpers and migration tests.
2026-06-10 02:22:33 +02:00
roboomp 16a2c03852 fix(coding-agent): documented read uri targets
Updated the read tool's provider-visible path schema, prompt docs, CLI help, and internal URL docs so URL and internal URI targets are advertised consistently. Added schema coverage for the read path description.\n\nFixes #2215
2026-06-10 00:21:12 +00:00
can1357 f2137becb8 fix: fixed prompt parsing, startup tracing, and help-command behavior
- Fixed help rendering so `--help` no longer triggers unrelated command loaders.
- Fixed startup span logging to emit markers only with PI_DEBUG_STARTUP set.
- Fixed logger startup trace behavior for `:start`, `:done`, and `:fail` phases.
- Fixed prompt template processing with cached raw-template compilation and safer formatting.
- Optimized symbol and tag parsing in prompt templates via manual parsers.
2026-06-10 02:17:35 +02:00
can1357 cdd54a2154 docs(prompts): standardized RFC keywords across prompt surface
- Rewrote prescriptive prose to MUST/NEVER/SHOULD/MAY phrasing.
- Pruned internal mechanism the agent can't act on from tool prompts.
- Fixed garbled grammar and a stale plan-title placeholder.
- Made ssh tool description synchronous via cached host info.
2026-06-10 02:07:30 +02:00
can1357 56f82e2f49 docs(prompts): deduped and tightened system and tool prompts
- Removed restated warnings, dead `rsed` references, and an internal file pointer.
- Dropped blocked `sed -i`/heredoc commands from the replace bash-alternatives table.
- Factored the shared repo-default clause across `gh` search ops.
- Switched gh job-success icon to the status.success symbol.
2026-06-10 01:52:18 +02:00
can1357 cb37a552f5 docs(changelog): documented the review-fix batch across packages
covers the 16-territory review fixes plus the triage follow-up round in coding-agent, ai, tui, and natives; also rewords the live-region IRC entries with fuller mechanism descriptions.
2026-06-10 01:28:24 +02:00
can1357 3b3672a357 fix(coding-agent): made live-region rewrite floor travel across append-shaped insertions
append-only insertions above the floor no longer arm a permanent promotion freeze; floor index travels with the insertion; documented the floor semantics in the renderer internals doc.
2026-06-10 01:28:24 +02:00
can1357 f94b055264 perf(coding-agent): cached grapheme counts and skipped LRU churn in streaming reveal
per-block grapheme counts cached (blocks only grow) and in-flight partials bypass the markdown render LRU, removing repeated full Intl.Segmenter walks per 33ms tick and retained stale partial snapshots on long replies.
2026-06-10 01:28:05 +02:00
can1357 39c08f5434 fix(coding-agent): stopped web-search query mangling and API-key log leakage
removed the rewrite replacing every 202x with the current year (corrupted CVE ids); MCP request logs redact key/token/secret/auth query params; fetch honors declared charsets, surfaces transport causes, retries 429 once abort-aware, flags mid-stream truncation, stops double-downloading binaries; browser tab reopen/registry/single-flight races fixed, queued opens honor abort, init failures release the temp hold; MCP calls get a default timeout and per-line SSE parse guards.
2026-06-10 01:28:04 +02:00
can1357 c902f0a7d9 fix(coding-agent): fixed github cache invalidation and run-watch polling
pr_push invalidates PR+diff rows; current-branch merge/close invalidates without a positional; run_watch polls adaptively, survives rate limits, gives up on zero runs, and evicts completed-run job caches when a rerun is observed; multi-PR checkout uses allSettled; pagination compares raw page length; date qualifiers drop ms precision; leading-dash identifiers cannot become flags; auth key memoized against hosts.yml mtime; diff stored once per row.
2026-06-10 01:28:04 +02:00
can1357 54d4a1f3ae fix(coding-agent): fixed LSP client lifecycle and DAP session robustness
clients publish only after initialize; dead readers tear down for respawn instead of permanent 30s timeouts; framing resyncs past junk headers; numeric code-action selectors pick strictly by index; file URIs percent-encode and raw fragment/query chars route to the lax parser; equal-position inserts keep spec order; workspace edits validate before writing; shutdown covers mid-init clients; reload sends notification; writethrough init deadline-bounded with negative caching; DAP pause/breakpoint races fixed, mutations serialized and abort-aware, output buffering O(n) with correct tail retention.
2026-06-10 01:28:04 +02:00
can1357 d7eae06830 fix(coding-agent): fixed eval artifact double-writes and kernel I/O capture
single OutputSink owner per cell artifact; JS parallel() honors its documented barrier (allSettled) instead of orphaning in-flight thunks; Python subprocesses no longer inherit the NDJSON frame pipe (stdout captured and forwarded); JS timeouts annotate the VM reset; console bridge implements dir/time/group/assert/trace; python availability probe cached; runner frames coalesce per write.
2026-06-10 01:27:41 +02:00
can1357 cd8409154d fix(coding-agent): serialized isolated-task merges and fixed async batch accounting
stash/cherry-pick merge sequence runs under the repo lock (lost-uncommitted-changes race); stash-pop failure no longer mislabels merged branches; async batches cannot stick at running forever; queued tasks stop counting against the global job cap; aborted session startup disposes the late session; fail-fast propagates the worker signal; command expansion treats user input dollar-patterns literally; progress snapshots stop structured-cloning tool payloads.
2026-06-10 01:27:40 +02:00