Commit Graph

4148 Commits

Author SHA1 Message Date
Can Bölük d62e7f4698 chore: update installation command in update-cli.ts 2026-05-17 11:23:02 +02:00
Bonobo 8a7f7d75c5 fix(coding-agent): correct install.sh fallback URL in omp update warning
The fallback reinstall hint printed when omp update can't verify the new
binary pointed at https://raw.githubusercontent.com/can1357/oh-my-pi/main/install.sh,
which returns 404. The installer actually lives at scripts/install.sh
(consistent with the README install instructions).
2026-05-17 05:54:08 +02:00
can1357 407f9319d5 chore: bump version to 15.1.3 2026-05-17 05:45:51 +02:00
can1357 9155df2bf0 fix(coding-agent): scoped report_tool_issue enum to active built-in tools
- Built a dynamic enum from constructed built-in/hidden tools so MCP and extension tools are excluded from QA reports.
- Added allowlist guard to silently drop reports targeting non-built-in tools at runtime.
- Stripped `proxy_` prefix before allowlist check so passthrough-wrapped tools resolve correctly.
2026-05-17 05:45:25 +02:00
can1357 7b20915e20 refactor(coding-agent): replaced console.warn with logger.warn calls
- Migrated warning output from raw console.warn+chalk to the shared logger utility.
- Removed unused chalk import as a result.
2026-05-17 05:31:58 +02:00
can1357 f4b1cc084b fix: guarded terminal control sequences behind isTTY checks
- Skipped thinking-line writes and clears when stdout is not a TTY.
- Prevented terminal title (set/push/pop) from emitting OSC/xterm escape sequences to piped or non-interactive output.
- Suppressed all ProcessTerminal control writes when stdout isn't a TTY.
2026-05-17 05:29:56 +02:00
can1357 f945e5e382 refactor(coding-agent/modes): reorganized account section width sharing
- Refactored account header rendering to separate label truncation from reset suffixes and align suffix spacing.
- Introduced a shared section width calculation so provider groups reuse the same account column and bar width.
- Updated aggregate usage text to show free-percentage formatting and shortened account count labels.
2026-05-17 05:16:03 +02:00
can1357 a951925814 fix(ai): corrected stream auth to refresh once and retry pre-start 401
- Updated auth refresh to return generation booleans and return false for missing, non-oauth, or null-rotation creds.
- Added stream auth retry logic by wrapping streamSimple and retrying once with a fresh key for pre-start 401 only.
- Added changelog note on streaming auth retries and coding-agent onAuthError flow to refresh stale credentials.
- Added snapshot and stream auth tests for headers/no-store, 304 transitions, long-poll wakes, and retry limits.
2026-05-17 05:02:16 +02:00
can1357 6db7d6af92 feat(ai): added auth-broker snapshot contract with generation checks
- Added generation-aware snapshot contracts with generation, serverNowMs, refresher, and rotatesInMs fields.
- Reworked /v1/snapshot serving and client fetching for If-None-Match long-poll with 304/200 status handling.
- Added status checks in remote-store and SDK/CLI snapshot paths, applying updates only when fetch returns 200.
- Added StreamOptions.onAuthError and stream one-shot 401 retry dispatch using refreshed credentials.
2026-05-17 04:54:30 +02:00
can1357 c8f1e4a0b6 refactor(coding-agent): replaced bracket-wrapped bars with smooth sub-cell rendering
- Switched usage bar fill to floor+partial-block characters (▓, ▒) for finer granularity.
- Removed surrounding `[` / `]` bracket characters from bar output and adjusted column width arithmetic accordingly.
- Replaced dot-filled unknown-state bar brackets with a plain dot run.
2026-05-17 04:35:56 +02:00
can1357 75f34d1815 feat(utils): added configurable logger transport switching for headless services
- Added a new `setTransports` logger API to swap console and file winston transports at runtime.
- Refactored logger transport creation to lazily build rotating file logs via a shared directory helper.
- Updated auth-broker serve startup/shutdown to use structured logger output and switch to console-only logs for its headless runtime.
2026-05-17 04:19:38 +02:00
can1357 90b134ca4c test: replaced real timers and sleeps with deterministic test hooks
- Added `providerRetryWait` and `retryWait` hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced `Bun.sleep`/`setTimeout` polling loops with `AbortSignal` event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared `test/helpers` module, eliminating duplicated `checkGatewayAvailable` implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
2026-05-17 04:02:09 +02:00
can1357 6d7c4008e5 feat(emoji): added emoticon expansion and inline replace
- Added a hand-maintained EMOTICONS table mapping western text emoticons (`:)`, `:-D`, `
2026-05-17 03:57:20 +02:00
can1357 2155b8e020 perf: replaced WeakMap caches with symbol-keyed properties
- Migrated per-object caches (chat/tool starts, model fingerprints, validation contexts, provider indexes, render IDs) from WeakMap to Symbol-keyed properties on the objects themselves.
- Rewrote SSE debug tee as a single-pass inline parser, eliminating the body.tee() + readSseEvents re-parse pipeline.
- Refactored MockModel from a factory function + external WeakMap state into a self-contained class.
- Added FIFO memoization caches for heuristic candidate expansion and namespace suffix lookups.
2026-05-17 03:47:45 +02:00
can1357 5523582735 test(coding-agent): minor fixes 2026-05-17 03:12:36 +02:00
can1357 cb05764eac feat(ai): added pi-native auth-gateway transport
- Added POST /v1/pi/stream endpoint that accepts canonical Context directly, skipping wire-format translation layers.
- Added client-side streamPiNative dispatch activated via Model.transport = "pi-native".
- Propagated transport field through model registry, provider overrides, and models.yml schema.
- Refactored deriveSessionId to accept explicit arguments instead of ParsedFormatRequest.
2026-05-17 03:05:57 +02:00
can1357 dc3d39df9e perf: optimized SSE debug cloning and model alias resolution
- Eliminated double clone of `raw` per SSE event by removing `toRawSseEvent` and relying on the single clone in `notifyRawSseEvent`.
- Extracted regex patterns as module-level constants to avoid recompilation on each call.
- Replaced sort-based model alias selection with a single-pass linear scan, reducing allocations.
2026-05-17 02:45:12 +02:00
can1357 42d86254df feat(coding-agent): added emoji shortcode autocomplete and inline replace
- Added bucketed emoji dataset with prefix-indexed lookup for O(log n) suggestions.
- Implemented `:name:` inline replace that fires on closing colon without popup.
- Wired emoji suggestions and completions into PromptActionAutocompleteProvider.
- Extended AutocompleteProvider interface with trySyncInlineReplace hook.
2026-05-17 02:32:12 +02:00
can1357 69aeb94621 fix(grievances): replaced hostname with platform/arch 2026-05-17 02:16:23 +02:00
can1357 c049613cab docs: added auth-broker, schema-normalize, install-id, and eval docs
- Added auth-broker-gateway.md covering remote OAuth vault, gateway forward-proxy, usage cache layering, and env surface.
- Added ai-schema-normalize.md documenting the unified tool-schema normalization pipeline and strict-mode edge cases.
- Added install-id.md describing the per-install UUID persistence and consumer contract.
- Rewrote eval.md to reflect structured JSON cells schema, removing the legacy `*** Cell` parser and Lark grammar.
- Updated environment-variables.md, models.md, sdk.md, secrets.md, lsp.md, session-tree-plan.md, ttsr-injection-lifecycle.md, and natives docs to match code changes.
2026-05-17 02:15:55 +02:00
can1357 0bb385f8ab feat(grievances): added consent gate & push
- Added `dev.autoqa.consent` setting and single-flight popup handler wired through `InteractiveMode`.
- Added `flushGrievances` to batch-POST unpushed rows to `dev.autoqaPush.endpoint` with cooldown and single-flight deduplication.
- Added `omp grievances push` subcommand with TTY progress bar for manual draining.
- Migrated shared DB logic to `openAutoQaDb` (with `pushed` column migration) exported from `report-tool-issue`.
2026-05-17 01:47:24 +02:00
can1357 6120adbde2 perf(coding-agent): added PI_TIMING flag to log prompt durations
- Wrapped initial and subsequent print-mode prompts with `logger.time` for timing instrumentation.
- Printed collected timings after session run when `PI_TIMING` env var is set.
2026-05-17 01:33:16 +02:00
can1357 66259615de perf(coding-agent): added preconnect and conditional LSP warmup
- Added fire-and-forget `preconnectModelHost` to prime DNS/TCP/TLS/H2 before the first API call, saving 100–300ms on transcontinental connections.
- Skipped LSP warmup for non-UI (print/script) sessions to avoid CPU contention with LLM stream consumers.
2026-05-17 01:31:53 +02:00
can1357 484fca9c01 feat: added auth-gateway usage cache with single-flight 15s ttl fallback
- Added AbortSignal propagation and timeout-race handling for broker health, usage, refresh, and snapshot calls.
- Added single-flight usage-report caching with 15s TTL, per-caller abort races, and null-on-fail fallback.
- Expanded provider schemas and parse/build logic for cache metadata, headers, stop controls, and image/file content.
- Hardened auth flows by rejecting refresh sentinels and using timing-safe bearer-token comparisons.
2026-05-17 01:10:25 +02:00
can1357 df1c1a6ba8 feat(auth): added auth-gateway forward-proxy and broker usage/migrate endpoints
- Added `omp auth-gateway serve/token/status` — a forward-proxy injecting broker credentials for OpenAI Chat, Anthropic Messages, and OpenAI Responses wire formats.
- Added `GET /v1/usage` to auth-broker and auth-gateway; usage cache switched to 5-min per-credential TTL with jitter and last-good fallback on failure.
- Added `AuthStorage.setConfigApiKey/removeConfigApiKey/clearConfigApiKeys` so `models.yml` `apiKey` beats OAuth tokens without overriding `--api-key`.
- Added `omp auth-broker migrate --from-local` for idempotent upload of local SQLite/env credentials to the broker.
2026-05-16 23:25:10 +02:00
can1357 4f6e70f779 fix(coding-agent): auto-name approved plan sessions 2026-05-16 20:53:11 +02:00
can1357 c3f5a60c22 feat(auth): added auth-broker for remote credential vault
- Added `AuthBrokerClient`, `RemoteAuthCredentialStore`, `AuthBrokerRefresher`, and `startAuthBroker` server in `packages/ai/src/auth-broker`.
- Renamed `AuthCredentialStore` class to `SqliteAuthCredentialStore`; extracted `AuthCredentialStore` as a persistence interface.
- Added `exportSnapshot`, `forceRefreshCredentialById`, `disableCredentialById`, and `upsertCredential` to `AuthStorage` for broker wire protocol.
- Added `omp auth-broker` CLI subcommand (serve, token, login, logout, import, status) and `discoverAuthStorage` broker-mode path keyed on `OMP_AUTH_BROKER_URL`.
2026-05-16 20:44:07 +02:00
can1357 7901cecf80 feat(coding-agent): added module cache busting for local imports in JS runtime
- Appended a unique nonce query param to local file imports so Bun treats each reload as a fresh module record.
- Restricted cache busting to relative/absolute path specifiers; bare packages and built-ins are left unchanged.
2026-05-16 20:27:45 +02:00
can1357 54a60a7702 fix(ai/schema): hoisted description to anyOf wrapper in strict-mode unions
- Extracted `description` from type-array and nullable branches so it lives on the wrapper, not duplicated onto each variant.
- Replaced inline enum-type inference with `inferStrictPrimitiveTypeFromEnumOrConst`, covering both `enum` and `const` in sanitize and enforce paths.
- Mixed-primitive enums and non-primitive consts now fall back to non-strict instead of producing a typeless schema that OpenAI rejects on the wire.
2026-05-16 20:22:39 +02:00
can1357 7ea9e16408 feat(coding-agent): changed TTSR non-interrupt tool matches to fold into toolResult
- Non-interrupting tool-source TTSR matches now prepend a system-reminder to the matched tool's `toolResult` content instead of queuing a loop-wide deferred follow-up turn.
- Text/thinking source matches retain the previous deferred-injection behavior.
- Added deduplication so one rule attaches to exactly one sibling tool call per batch.
- Stale per-tool injections are cleared on abort/error before tools produce results.
2026-05-16 20:15:53 +02:00
can1357 39f34ada70 feat: added pure-JS sanitizeText
- Migrated sanitizeText from pi-natives to pi-utils as a pure-JS implementation, removing the native dependency across all call sites.
2026-05-16 20:12:26 +02:00
can1357 5c931ac135 refactor(ai/schema): merged strict-mode into normalize, removed strict-mode.ts
- Moved sanitizeSchemaForStrictMode, enforceStrictSchema, and tryEnforceStrictSchema into normalize.ts.
- Moved sanitizeSchemaForOpenAIResponses/rewriteOneOfToAnyOf into normalize.ts alongside other normalizers.
- Removed strict-mode.ts and its public re-export; adapt.ts now only exposes NO_STRICT and adaptSchemaForStrict.
- Dropped StringEnum helper from strict-mode.ts (already removed from public API).
2026-05-16 19:41:18 +02:00
can1357 84ec8fba49 feat(coding-agent/eval): implemented JSON cell-based eval tool inputs
- Removed the legacy `parseEvalInput` parser module and `eval.lark`, eliminating `*** Cell` stream parsing.
- Replaced eval tool arguments from single `input` strings to ordered `cells` arrays in tool calls and schema.
- Updated execution to resolve language explicitly, map `py` to `python`, and apply timeout/reset defaults.
- Removed backend sniffing and `ABORT_WARNING` suffix handling, then updated docs and tests to the new JSON cells format.
2026-05-16 19:33:44 +02:00
can1357 64fcdc308f refactor(coding-agent)!: removed StringEnum helper and shortened tool schema descriptions
- Replaced all StringEnum(...) usages with z.enum([...]) across tools, examples, and tests.
- Removed StringEnum re-export from @oh-my-pi/pi-coding-agent public API.
- Condensed verbose tool parameter descriptions to minimal lowercase phrases.
- Renamed AuthCredentialStore to SqliteAuthCredentialStore at usage sites.
2026-05-16 19:26:32 +02:00
can1357 e7200c2e4a feat(ai): added unified normalize flow for Google/CCA schema handling
- Implemented a unified normalization flow by switching Google/CCA handling to normalizeSchemaForGoogle/CCA.
- Added normalize.ts with recursive node normalization, nullable-union checks, and combiner collapsing.
- Removed sanitize-google.ts and normalize-cca.ts, replacing them with normalize exports in schema indexes.
- Added spill-to-description utilities with spill/paren modes and `$defs` exclusion for unsupported fields.
- Updated MCP bridge and schema tests to use normalizeSchemaFor* APIs with expanded compatibility checks.
- Documented normalization behavior changes and breaking rename in constraints and package changelog files.
2026-05-16 19:04:09 +02:00
can1357 959cd42798 refactor(internal-urls): renamed embedded docs protocol from pi:// to omp://
- Renamed the internal URL protocol handler from `pi` to `omp` and updated the router export/import wiring to use `OmpProtocolHandler` with the `omp://` scheme.
- Updated embedded documentation link rendering and related validation/error messages in the protocol handler to reference `omp://` URLs.
- Adjusted tests and prompt/docs references so `read` examples and harness documentation guidance now use the renamed `omp://` scheme.
2026-05-16 18:52:04 +02:00
Can Bölük 2d96feb6c6 Merge pull request #1100 from h8hawk/fix/read-search-pipe-separator-prompt
fix(coding-agent): clarified pipe separator in read/search tool prompts
2026-05-16 18:22:00 +02:00
Can Bölük cb968ed5f7 Merge pull request #1114 from jiwangyihao/acp-cancel-cleanup-boundary
fix(coding-agent): bound ACP cancel cleanup
2026-05-16 18:18:57 +02:00
can1357 a40c5b1bee refactor(coding-agent): restructured ACP cancel cleanup slot management
- Replaced `finishCleanup` callback with `isPromptTurnInFlight` predicate to unify settled+cleanup gating.
- Extracted `#beginCancelCleanup` (idempotent) and `#runCancelCleanup` to clarify ownership of slot eviction.
- Fork, queue, and close paths now all gate on the combined settled+cleanup window.
2026-05-16 18:18:46 +02:00
Can Bölük 58505b8423 Merge pull request #1109 from itzrnvr/fix/windows-pty-hang-root-cause
fix: PTY hangs on Windows — ConPTY deadlocks waiting for cursor position
2026-05-16 18:09:28 +02:00
can1357 32453aaff0 feat(agent): added AgentTelemetry across compaction and branch-summary
- Added optional AgentTelemetry to summary, handoff, branch-summary, and compact option types.
- Replaced one-shot `completeSimple` usage with `instrumentedCompleteSimple` across compaction, summary, and branch-summary calls and passed `oneshotKind`.
- Added `PiGenAIAttr.OneshotKind`, `InstrumentedChatSpanOptions`, and response-header forwarding in telemetry span lifecycle.
- Added `resolveTelemetry` propagation in coding-agent session and inspect-image paths to pass request-scoped telemetry.
- Added compaction telemetry test harness and span assertions for success, no-telemetry, and error cases.
2026-05-16 18:03:07 +02:00
Can Bölük 3e073e9175 Merge pull request #1115 from kidonng/patch-1
fix(tools): remove mention of Claude in `web_search` tool prompt
2026-05-16 17:56:16 +02:00
Can Bölük 7dd2bb8ff5 Merge pull request #1117 from can1357/farm/f6994a71/agents-provider-dedupe-home-walkup
fix(discovery): stop agents provider from scanning ~/.agent[s]/ as project
2026-05-16 17:56:04 +02:00
can1357 e3a238c876 fix(coding-agent): collapse refine plan into editor return 2026-05-16 17:29:23 +02:00
roboomp d895f2223a fix(discovery): stop agents provider from scanning ~/.agent[s]/ as project
`getProjectPathCandidates` walks up from cwd to repoRoot (or home as a
fallback). When cwd is anywhere under $HOME and no closer .git boundary
exists, that walk-up reaches the home directory and enumerates
`~/.agent/<segments>` and `~/.agents/<segments>` as project paths.
`getUserPathCandidates` then enumerates the very same directories as
user paths, so every skill/rule/prompt/command/AGENTS.md found there
loaded twice. The capability deduper marks the second copy as shadowed,
but the Extension Dashboard renders shadowed entries — so users see one
active + one greyed-out duplicate of every home-level skill.

Skip the home directory inside the walk-up while still terminating the
loop on it; ancestors above home are still visited if the cwd happens
to live above (e.g. monorepo `home: tempDir` test fixtures).

Tests:
- Drop the duplicated copy of `getProjectPathCandidates` from the
  monorepo-skills test; import the real one so behavior stays in sync.
- Replace the old "walk-up stops at home when no repo root" assertion
  (which encoded the buggy behavior) with one that pins the new
  contract: home-level `.agent[s]/skills` are NOT enumerated as
  project paths.
- Add an explicit regression assertion that project ∩ user candidate
  sets are empty when cwd is under home.

Fixes #1116
2026-05-16 15:04:42 +00:00
jiwangyihao aaddf0631c fix(coding-agent): gate ACP close during cancel cleanup 2026-05-16 21:46:13 +08:00
Kid 49215eead6 fix(tools): remove mention of Claude in web_search tool prompt 2026-05-16 18:38:53 +08:00
jiwangyihao 66bf82123e fix(coding-agent): reject stale ACP cancel prompts 2026-05-16 13:27:48 +08:00
Sanskar Singh 158b00266b fix: pass configured shell to PTY instead of hardcoding sh
The PTY runner hardcoded CommandBuilder::new("sh"), but on Windows the
user's shell might be a Git Bash absolute path that isn't on PATH. The
non-PTY path already uses the resolved shell from getShellConfig(). Now
the PTY path does the same, passing it through PtyStartOptions.shell.
2026-05-16 10:10:59 +05:30
jiwangyihao 917535da2b fix(coding-agent): bound ACP cancel cleanup 2026-05-16 12:38:55 +08:00