Commit Graph

1882 Commits

Author SHA1 Message Date
Can Bölük af32512564 Merge branch 'main' into feat/otel-otlp-export 2026-06-04 06:39:07 +03:00
Can Bölük a6997b1b7f Merge branch 'main' into fix/session-accent-light-contrast 2026-06-04 06:28:21 +03:00
can1357 1379772628 refactor(utils): consolidate color utilities into pi-utils
Move the color math added for the session-accent fix into the shared
@oh-my-pi/pi-utils color module instead of a coding-agent-local file:

- colorLuma, relativeLuminance, and hslToHex now live in
  packages/utils/src/color.ts (hslToHex lifted out of session-color.ts).
- Drop the duplicate hex parser: toRgb reuses the existing hexToRgb and
  paletteToRgb returns the shared RGB type, so hex parsing lives once.
- Delete packages/coding-agent/src/utils/color.ts; theme.ts and
  session-color.ts import from @oh-my-pi/pi-utils.
- Move the color unit test into the utils package; repoint session-color
  test imports.

No behavior change to accent luminance capping.
2026-06-04 05:27:11 +02:00
can1357 db0f396601 feat(tui): added terminal cursor mode synced to hardware cursor pref
- Added Input setUseTerminalCursor to render terminal or software cursor.
- Synced focused component cursor mode on focus and preference changes.
- Fixed wrapTextWithAnsi infinite loop on BEL-terminated string escapes.
2026-06-04 05:21:35 +02:00
Can Bölük 35b86492d0 Merge pull request #1685 from daandden/fix-web-search-tui-providers
Fix web search provider TUI options
2026-06-04 06:12:58 +03:00
Can Bölük 1ca92c929f Merge pull request #1754 from daandden/fix-opus-priority
Fix slow agent Opus priority
2026-06-04 06:09:19 +03:00
Can Bölük b4b11f8f92 Merge pull request #1783 from VoidChecksum/fix/stdio-async-epipe-request
fix(coding-agent/mcp): handle async broken-pipe rejections in stdio transport
2026-06-04 06:09:09 +03:00
Can Bölük 8d6771490a Merge pull request #1803 from fabkho/fix/agent-skills-spec-compat
fix: recognize disable-model-invocation from Agent Skills spec
2026-06-04 06:07:43 +03:00
Can Bölük 8596f08af0 Merge pull request #1808 from GratefulDave/fix/search-optional-paths
fix(search): default paths to workspace root instead of hard-failing
2026-06-04 06:07:03 +03:00
can1357 3f22f939a2 feat(coding-agent/plan-mode): shared approved plan context with spawned subagents
- Added `loadOverallPlanReference` to resolve a session plan reference from local storage and skip empty or missing files.
- Updated task execution to read the active plan reference (except in plan mode) and pass it into each spawned subagent.
- Extended the subagent system prompt and session SDK/tools plumbing so subagents receive and render the approved plan path and contents.
2026-06-04 04:10:53 +02:00
can1357 b0cf24ca0d feat(coding-agent): froze offscreen transcript blocks on ED3-risk terms
- Added TranscriptContainer that snapshots non-live blocks to avoid stale scrollback duplicates.
- Thawed snapshots at prompt-submit checkpoints for reconciliation.
- Repainted eager streaming tail on overflowing shrink to unfreeze UI (issue #1682).
2026-06-04 03:48:12 +02:00
can1357 7f271f9b9d feat(coding-agent): added native selection markers to ask dialogs
- Added `selectionMarker`, `checkedIndices`, and `markableCount` options to render radio/checkbox glyphs per row.
- Moved checkbox rendering from inline label prefixes into the selector component.
- Kept trailing control rows like "Other"/"Done" on the plain cursor.
2026-06-04 03:43:17 +02:00
can1357 bc5eeef398 feat(coding-agent): tagged read-only agents in task tool description
- Added `isReadOnlyAgent` and `READ_ONLY_TOOL_NAMES` to classify agents.
- Marked read-only agents and forbade edits, commands, and reasoning offload.
- Added tests for capability classification and description rendering.
2026-06-04 03:24:41 +02:00
David Andrews (LexGenius.ai) 89a60a6613 fix(search): default paths to workspace root instead of hard-failing
The `search` tool required `paths` via a strict `union([string,
array.min(1)])`, so any call that omitted `paths` (or passed an empty
array) was rejected at schema validation with `paths: Invalid input`
and never ran — turning a recoverable "no scope given" into a fatal
tool-call failure.

Make `paths` optional and default an omitted/empty value to the
workspace root (`.`), matching the documented prompt contract. Behavior
is unchanged when paths are supplied. Adds regression coverage for the
omitted and empty-array cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 20:59:43 -04:00
can1357 dc4aeb7b88 refactor(coding-agent): renamed todo_write tool to todo
- Renamed `TodoWriteTool` to `TodoTool` and its source/prompt files.
- Updated tool registration, schema, renderers, and gating to `todo`.
- Adjusted cursor provider native tool names and tests to match.
- Renamed strike-animation constants and `todo-error-reminder` type.
2026-06-04 02:45:30 +02:00
can1357 b9c204c69e feat(session): added indexed async session backends and removed synchronous read APIs
- Added `IndexedSessionStorage` with `SessionStorageBackend` for index-based storage reads.
- Removed `readTextSync` from the public `SessionStorage` API and sync backends.
- Changed Redis and SQL backends to warm `{size, mtimeMs}` metadata and read via `readTextSlices`.
- Added per-path write queues and `drain()` to serialize operations and surface first failures.
2026-06-04 02:27:06 +02:00
can1357 5e17edf1ec refactor(coding-agent): restructured session text slicing to use unified head/tail reads
- Replaced SessionStorage readTextPrefix/readTextSuffix with readTextSlices.
- Added peekFileEnds utility to read bounded file head/tail in one handle.
- Updated session-manager list/recent reads to consume unified head/tail slices.
- Expanded storage tests for head/tail and UTF-8-boundary slice extraction.
2026-06-04 02:07:34 +02:00
can1357 e6716d086d feat(coding-agent): added lifecycle status to session picker
- Classified each session's final message as done, interrupted, aborted, error, or pending from a 32 KiB tail read.
- Rendered the status as a colored segment on the session metadata line.
- Added `peekFileTail` and `readTextSuffix` across storage backends to read file tails in one pass.
- Simplified `MemorySessionStorage` to a string array mirror with a sidecar mtime map.
2026-06-04 01:58:25 +02:00
can1357 b1b4b0c0ed feat(coding-agent/tools): allowed .. aliases for line range selectors
- Extended line selector parsing in path-utils to accept `..` as a forgiving alias for `-`, with `..` normalized during chunk parsing.
- Updated selector-matching regexes for file selectors and internal URL selectors to recognize alias-style ranges in single chunks and comma-separated lists.
- Added tests covering `N..M`, `N..`, mixed separators, inverted-range errors, and path-splitting behavior with `:N..M` selectors and `foo:../bar.ts` paths.
2026-06-04 01:35:39 +02:00
can1357 53aaced81f feat: enabled text-sizing and fixed OSC66 and DECCARA rendering behavior
- Added `textSizing` terminal capability and `tui.textSizing` setting for Kitty OSC66 scaling.
- Updated OSC66 range and visible-width handling to preserve grapheme slice behavior.
- Updated markdown rendering to apply heading text sizing only when enabled.
- Fixed DECCARA trailing-background fill tracking and DECRPM status 3/4 recognition.
2026-06-04 01:33:48 +02:00
can1357 ea105b4211 refactor(packages/coding-agent): reorganized notification flow and tests
- Updated completion and ask notifications to pass structured payloads.
- Updated completion and ask notifications to include explicit message metadata fields.
- Adjusted abort-guard and retry-capability tests for the new notification/options behavior.
2026-06-04 00:59:59 +02:00
can1357 48017b5f67 feat(packages/coding-agent): added terminal protocol debug diagnostics
- Added debug menu options for terminal state and protocol checks with new handlers.
- Added terminal diagnostics models and collectors to report geometry, protocol flags, and multiplexer data.
- Added protocol-probe utilities to encode RGB PNGs, generate sample content, and render test panels.
- Added support components for verbatim line rendering and OSC66-scaled text rows.
- Added tests validating image encoding, OSC66 output, and terminal state formatting.
2026-06-04 00:50:46 +02:00
can1357 ead9e72602 feat(ai): classified account rate limits as quota exhaustion
- Added account rate-limit pattern matching for QUOTA_EXHAUSTED.
- Treated account rate limits as credential-rotatable usage limits.
2026-06-03 23:08:58 +02:00
can1357 8647ab6883 fix(fetch): repaired collapsed URL scheme from path normalization
- Restored `https:/` → `https://` before URL parsing and detection.
- Prevented path-normalized URLs from falling through to filesystem lookup.
2026-06-03 23:03:44 +02:00
can1357 13d116bf15 fix(hashline): treated empty replace hunks as deletes
- Updated the grammar to parse replace hunks with zero body lines.
- Changed empty replace execution to emit delete edits across the target range.
- Updated tests to verify empty replace syntax deletes lines while empty inserts still throw errors.
2026-06-03 22:53:19 +02:00
fabkho 6e49d33b71 fix: recognize disable-model-invocation from Agent Skills spec
The Agent Skills standard (agentskills.io/specification) uses
`disable-model-invocation: true` to hide skills from auto-discovery.
OMP only recognized `hide: true`. This patch treats both as equivalent,
improving compatibility with skills authored for Pi, Claude Code, and
other harnesses following the standard.

Changes:
- Check `disableModelInvocation` (camelCase after frontmatter parsing)
  in all 3 skill-loading paths
- Add `disableModelInvocation` to SkillFrontmatter type with JSDoc
- Add regression test for disable-model-invocation frontmatter
- Add changelog entry

Ref: https://agentskills.io/specification#frontmatter-required
2026-06-03 22:23:53 +02:00
can1357 9a544b6ee0 feat(coding-agent): added radio markers for single-choice ask options
- Rendered single-choice questions with circular radio glyphs instead of checkboxes.
- Kept rectangular checkboxes for multi-select questions.
- Added radio.selected/unselected symbols to unicode, nerd-font, and ASCII presets.
2026-06-03 22:21:06 +02:00
can1357 a1a9176c19 fix(coding-agent/modes): collapsed hook option descriptions in compact overflow mode
- Updated hook option rendering to support description modes for full text, bounded rows, or hidden detail output.
- Adjusted compact-mode row budgeting so list height is based on labels, preventing a single description from consuming the visible budget.
- Added pre-wrapping with ellipsis truncation for selected option descriptions and updated overflow tests to validate the collapsed label-first behavior.
2026-06-03 21:34:07 +02:00
Chris Greeno d6a0d05fc0 feat(coding-agent): env-driven OTLP trace export for headless hosts
When OTEL_EXPORTER_OTLP_ENDPOINT (or _TRACES_ENDPOINT) is set, register a
global OTLP/proto TracerProvider and switch on the agent loop's telemetry
so its invoke_agent / chat / execute_tool spans reach a collector instead
of a no-op tracer. Honors the standard OTEL_* env contract
(OTEL_SERVICE_NAME, OTEL_SDK_DISABLED, OTEL_TRACES_EXPORTER=none) and the
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT capture toggle; no-op
when no endpoint is configured.

Uses the exporter-trace-otlp-proto 2.x line, which exports cleanly under
Bun (the 1.x line deadlocks). Adds a flushTelemetryExport() helper and a
periodic + signal-driven flush so long-lived processes surface spans.

This makes the existing telemetry usable from hosts that spawn omp as a
child process (e.g. an ACP harness), where an in-process provider
registered by the parent can't reach the child process.
2026-06-03 20:15:29 +01:00
can1357 2e14db49ca fix(coding-agent/utils): fixed jj workspace detection for non-default .jj/repo indirection
- Detection now recognized `.jj/repo` as workspace metadata whether it is a directory or a file.
- Repository resolution followed `.jj/repo` file indirection so non-default `jj workspace add` workspaces resolved their shared store path.
- Tests were added to confirm `jj.repo.is` and `jj.repo.resolve` handle file-backed `.jj/repo` workspaces correctly.
2026-06-03 16:37:03 +02:00
Paweł J. Wal 6ce9188028 Merge branch 'main' into fix/session-accent-light-contrast 2026-06-03 16:19:13 +02:00
can1357 e1b2809154 feat(coding-agent): added plan read matching and compaction protection behavior
- Added shared `getReadToolPath` API to extract paired read `path` values for protection matchers.
- Added `createPlanReadMatcher` and session wiring so compaction prune/shake keeps active plan reads intact.
- Updated `todo-write` instructions to initialize every user-supplied plan item as an individual task.
- Added compaction tests validating plan reads are protected from prune and shake while regular reads are still removable.
2026-06-03 16:14:15 +02:00
VoidChecksum bab53df38a fix(coding-agent/mcp): handle async broken-pipe rejections in stdio transport
On Windows, Bun's FileSink surfaces a broken pipe as a *rejected Promise*
(the EPIPE arrives via a processTicksAndRejections tick), not a synchronous
throw. The sync-only `writeFrame()` from #1711 returns `true` for such a
write and lets the rejected promise float; `request()` likewise wrote stdin
without awaiting. Either path escapes as an unhandled rejection, which the
postmortem handler turns into a fatal process.exit(1) when an MCP server
exits mid-handshake.

- writeFrame: also neutralize a rejected Promise returned by write()/flush()
  (covers the notify + #sendResponse paths).
- request(): await write()/flush() so the rejection lands in the existing
  try/catch and rejects the request instead of floating.
- tests: cover the async-rejection path for writeFrame.

Follow-up to #1710 / #1711, which addressed only the synchronous throw. The
existing notify mid-handshake test fails on Windows without this change
because the real FileSink rejects asynchronously.
2026-06-03 10:51:42 +02:00
can1357 ed5db7bf3a test(coding-agent): fixed hanging tests by using non-empty assistant content
- Empty `content: []` triggered the empty-stop guard, short-circuiting the agent_end handler before compaction checks ran.
- Replaced with a minimal text turn so auto-compaction queue resume tests complete under fake timers.
2026-06-03 10:48:48 +02:00
can1357 17b6de2fc7 test(ai): replaced curl-based LM Studio detection with model discovery
- Added async `discoverLmStudioModel()` to query the OpenAI and native LM Studio APIs, resolving the actual model id, name, and context window.
- Replaced hardcoded `execSync curl` availability check with API-driven discovery controlled by `PI_LOCAL_LLM` env var.
- Simplified compaction test spy to match on provider only, removing fragile context-marker filtering.
2026-06-03 10:17:43 +02:00
can1357 eda1a1056b feat(coding-agent): added matcherDigest hook for TTSR wire-format normalization
- Added optional `AgentTool.matcherDigest(args)` hook so tools can expose plain source text instead of wire-encoded arguments to TTSR rule matchers.
- Implemented `matcherDigest` on edit (all modes: hashline, patch, apply_patch, replace) and write tools, stripping patch prefixes and JSON escaping.
- Added `TtsrManager.checkSnapshot()` to replace the scoped buffer with a tool digest rather than appending raw deltas.
- Fixed TTSR conditions never matching streamed edit/write calls whose wire format obscured real content.
2026-06-03 10:05:24 +02:00
Paweł J. Wal 9d9119a8c6 Merge branch 'main' into fix/session-accent-light-contrast 2026-06-03 07:17:57 +02:00
Vu Anh Nguyen da6b325b90 fix(coding-agent): prefer newer Opus slow aliases 2026-06-03 11:12:45 +07:00
can1357 6baa985672 feat(coding-agent): added ts-no-deprecated-leftovers builtin rule
- Warns against leaving `@deprecated` compatibility shims instead of finishing a refactor.
- Registered in the builtin rule index and covered by the defaults test.
2026-06-03 00:13:24 +02:00
can1357 bce01ce0db refactor(jj): restructured exports into namespaced repo and diff objects
- Grouped `isRepository`, `workspaceRoot`, and `clearWorkspaceRootCache` under a `repo` namespace (`repo.is`, `repo.root`, `repo.clearRootCache`).
- Promoted `diff` to a named export with a `changedFiles` sub-method via `Object.assign`.
- Added `ensureAvailable` check and `nameOnly` support to `diff`.
- Updated callers and tests to use the new API surface.
2026-06-03 00:13:05 +02:00
can1357 9b4a951919 refactor(jj): replaced subprocess-based workspace detection with fs walk
- Replaced `jj workspace root` subprocess call with a local `.jj/repo/store` directory traversal, eliminating process spawning overhead.
- Added LRU cache for resolved workspace roots to avoid redundant filesystem walks.
- Renamed internal `runCommand` helpers to `git`/`jj` for clarity.
- Replaced git subprocess setup in review test with mocked `git.status` and `git.diff` calls.
2026-06-03 00:10:23 +02:00
Can Bölük f936122e60 Merge branch 'main' into jj-support-in-review 2026-06-03 00:59:35 +03:00
Can Bölük 486090d72e Merge branch 'main' into fix/empty-stop-guard 2026-06-03 00:45:49 +03:00
Can Bölük c96d5111a1 Merge pull request #1724 from Kukkerem/feat/discoverable-builtin-names
feat(coding-agent): name discoverable built-in tools in search_tool_bm25 description
2026-06-03 00:43:25 +03:00
can1357 cd9fc55572 fix: aborted internal background jobs during shell cancellation
- Added Job::abort_internal_tasks to abort internal async tasks and drop their join handles.
- Updated shell cancellation paths to call this abort logic and handle mutable shell job lists before signaling remaining process groups.
- Added Rust and TypeScript tests that verify cancellation prevents background shell jobs from completing after abort.
2026-06-02 19:30:40 +02:00
zolszabo f878eb97c6 Merge remote-tracking branch 'origin/main' into feat/discoverable-builtin-names 2026-06-02 18:18:23 +02:00
can1357 2debe7c924 Merge branch 'farm/1089210f/bug-unhandled-epipe-rejection-in-stdiotr' 2026-06-02 18:14:09 +02:00
can1357 46bbf70d49 Merge remote-tracking branch 'origin/farm/316bc3ee/fix-tui-image-paste' 2026-06-02 18:14:04 +02:00
zolszabo 55f0d97f0b feat(coding-agent): name discoverable built-in tools in search_tool_bm25 description
Surface the hidden discoverable built-in tool names (write, find, search, lsp, task, ...) in the search_tool_bm25 description when tools.discoveryMode is "all", so a model can form a targeted BM25 query by name instead of guessing or falling back to shell. mcp-only mode is unchanged (no built-ins advertised) and the total-tools count still includes them.
2026-06-02 17:55:28 +02:00
roboomp d28bee5db0 fix(providers): loaded special provider model cache
Loaded cached startup models for special built-in providers alongside standard provider descriptors so boot-time model resolution can see cached Google Antigravity, Gemini CLI, and OpenAI Codex discoveries before refresh.\n\nFixes #1721
2026-06-02 15:55:01 +00:00