Commit Graph

1010 Commits

Author SHA1 Message Date
can1357 bfae4d46c3 fix(coding-agent): tracked acp tool args by session for replay
- Tracked ACP tool-call inputs per session and replayed them via `toolArgsById`/`getToolArgs` plumbing.
- Merged ACP tool execution end content from start and result events so command output replay preserves original args.
- Scoped ACP async-job draining by session `ownerId` and `agentId` with in-flight tracking and permission-gated deferred turns.
- Refactored compaction telemetry and async tests with per-test telemetry setup and asynchronous teardown resets.
2026-05-17 13:15:07 +02:00
Can Bölük 6331953dc8 Merge branch 'main' into acp-todo-plan-sync 2026-05-17 13:12:36 +02:00
Can Bölük 34ce96e42f Merge pull request #1138 from jiwangyihao/acp-autonomous-continuation
fix(coding-agent): keep ACP async continuations owned
2026-05-17 13:12:15 +02:00
Can Bölük b39c8c8460 Merge pull request #1134 from jiwangyihao/fix/acp-zed-permission-gate
fix(coding-agent): repair ACP permission flow for file edits
2026-05-17 13:12:07 +02:00
Can Bölük 1e66bf8bf3 Merge pull request #1132 from jiwangyihao/acp-tool-call-details-pr-d
ACP: keep command details stable across updates and replay
2026-05-17 13:11:59 +02:00
Can Bölük 3038318ed9 Merge pull request #1125 from jiwangyihao/acp-initialize-startup
fix(coding-agent): defer ACP session startup
2026-05-17 11:26:27 +02:00
jiwangyihao 05e1e702dd fix(coding-agent): keep ACP async continuations owned 2026-05-17 15:30:09 +08:00
roboomp 9ede82deba fix(tui): compressed deep session tree gutters
Capped the session tree selector gutter width so deeply branched histories preserve space for the selected entry text.

Added regression coverage for heavily branched trees at wide and narrow viewport widths.

Fixes #1144
2026-05-17 06:55:59 +00:00
jiwangyihao 1e5276e2d6 Merge remote-tracking branch 'origin/main' into acp-initialize-startup
# Conflicts:
#	packages/coding-agent/src/main.ts
2026-05-17 11:53:04 +08:00
jiwangyihao ec76a04d8f Merge remote-tracking branch 'origin/main' into acp-tool-call-details-pr-d 2026-05-17 11:47:54 +08:00
jiwangyihao 0aca488267 Merge remote-tracking branch 'origin/main' into acp-todo-plan-sync 2026-05-17 11:47:14 +08:00
jiwangyihao cb7d30a437 Merge remote-tracking branch 'origin/main' into fix/acp-zed-permission-gate 2026-05-17 11:44:41 +08: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 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 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
jiwangyihao ef2d536b96 fix(coding-agent): 修复 ACP 文件编辑权限请求 2026-05-17 09:40:50 +08: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 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
jiwangyihao 3057cbc00d fix(coding-agent): defer ACP session startup 2026-05-17 07:37:25 +08: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 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
jiwangyihao 204f10ae08 fix(acp): 保留回放与更新中的工具详情 2026-05-17 05:13:50 +08:00
jiwangyihao bb81873f13 fix(acp): 嵌入命令工具终端详情 2026-05-17 05:13:50 +08:00
jiwangyihao 359a7ab448 fix(acp): 复用工具调用回放详情 2026-05-17 05:13:49 +08:00
jiwangyihao b53fc964ce fix(acp): 显示命令工具调用详情 2026-05-17 05:13:49 +08:00
can1357 4f6e70f779 fix(coding-agent): auto-name approved plan sessions 2026-05-16 20:53:11 +02:00
jiwangyihao 32a8f109d1 fix(coding-agent): sync ACP todo plans 2026-05-17 02:52:06 +08: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 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
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
can1357 e3a238c876 fix(coding-agent): collapse refine plan into editor return 2026-05-16 17:29:23 +02:00
jiwangyihao aaddf0631c fix(coding-agent): gate ACP close during cancel cleanup 2026-05-16 21:46:13 +08:00
jiwangyihao 66bf82123e fix(coding-agent): reject stale ACP cancel prompts 2026-05-16 13:27:48 +08:00
jiwangyihao 917535da2b fix(coding-agent): bound ACP cancel cleanup 2026-05-16 12:38:55 +08:00
Can Bölük 8f66bc5ece Merge branch 'main' into ssh-refresh 2026-05-16 00:25:07 +02:00
Gerben Meijer 694f5e9a54 Refresh SSH hosts without restart 2026-05-16 00:20:00 +02:00
can1357 5c7c5eccb8 fix(ai): corrected AI schema normalization to draft-2020-12 prefixItems
- Adopted draft-2020-12 tuple validation with `prefixItems`, rejecting array-valued `items`.
- Expanded strict-mode handling to recurse `prefixItems` entries and infer `array` when tuple prefixes exist.
- Normalized Anthropic schemas through `prefixItems`, keeping supported tuple constraints and dropping unsupported fields.
- Updated coding-agent schema metadata and tests to draft-2020-12 `$schema` targets, including MCP/theme fixtures.
- Added `trimTrailingWhitespace()` to strip trailing spaces/tabs and keep the original line when none exist.
2026-05-15 23:46:23 +02:00
can1357 8b1364d4c2 feat(coding-agent): implemented one-shot generateHandoff in coding-agent
- Replaced event-driven handoff with one-shot `generateHandoff(...)` via `completeSimple`.
- Added cancellable `/handoff` command handling with a loader and Escape-to-abort flow.
- Removed legacy `compaction/handoff.ts` exports and added `generateHandoff(messages, model, apiKey, options)`.
- Fixed pre-cancelled handoff behavior to return `Handoff cancelled` and propagate abort signals.
- Updated handoff tests/mocks to assert `generateHandoff` invocation details and `AgentSession.handoff()` options.
2026-05-15 18:49:53 +02:00
can1357 e1aaf78874 refactor(compaction): moved compaction APIs to @oh-my-pi/pi-agent-core
- Relocated compaction, branch-summarization, pruning, and utils from coding-agent to packages/agent/src/compaction.
- Moved OpenAI remote compaction helpers from packages/ai to the new compaction module.
- Added handoff.ts with extractHandoffDocument, createHandoffContext, and renderHandoffPrompt helpers.
- Exposed new entries.ts with standalone SessionEntry types so coding-agent no longer owns them.
2026-05-15 18:31:12 +02:00
can1357 b489200933 fix(coding-agent/modes): gated scratch folder icon on stripWorkPrefix
The status-line path segment was selecting theme.icon.scratchFolder for scratch directories regardless of opts.stripWorkPrefix, while the CHANGELOG promised both behaviors honor the option. Icon selection now uses the same opts.stripWorkPrefix !== false gate as the scratch path stripping, so disabling stripWorkPrefix keeps the regular folder icon even when the project directory is inside a scratch root.
2026-05-15 17:49:14 +02:00
can1357 2867e1f4e3 feat(deps): added pi.zod exports and removed TypeBox package exports
- Added canonical `pi.zod` schema API exports and removed TypeBox package exports/imports.
- Migrated Tool schema typing from TypeBox to shared `TSchema`/Zod flow with legacy TypeBox compatibility.
- Updated AI provider adapters and MCP/agent builders to convert tool params through `toolWireSchema()`.
- Reworked schema validation from AJV to Zod-safe parsing with `fromTypeBox`, `toolWireSchema`, and meta schema checks.
2026-05-15 14:46:54 +02:00
can1357 005c3cd81a feat(coding-agent/task): added subagent runtime timeout and context-window progress reporting
- Added a task.maxRuntimeMs setting with a default disabled state for per-subagent runtime limits.
- Updated subprocess execution to enforce the configured wall-clock timeout, mark timeouts as aborts, and include timeout-specific abort messaging.
- Tracked per-turn context size and context window through task progress/results and updated UI renderers to display current context against window with cumulative tokens rendered separately.
2026-05-15 14:46:54 +02:00
can1357 e56e091b8a fix(extensibility): added centralized session slash command discovery for extensions
- Added a shared session command helper that aggregates extension, prompt, and skill slash commands.
- Updated ACP, extension UI, runtime-init, and task executor extension contexts to return session command data instead of empty arrays.
2026-05-15 10:21:12 +02:00
Can Bölük e7cd859d9b Merge pull request #1070 from jiwangyihao/acp-prompt-idle-cleanup-fresh
fix(coding-agent): wait for ACP prompt idle cleanup
2026-05-15 05:11:33 +02:00
Can Bölük c0183daa7e Merge pull request #1065 from dmarsh-gusto/feat/acp-elicitation
feat(coding-agent/acp): bridge ExtensionUIContext to ACP unstable_createElicitation
2026-05-15 05:11:10 +02:00
can1357 bddf9989b5 feat: added host-uri frame and rpc bridge for read/write/cancel routing
- Added `set_host_uri_schemes` and host-uri frame/type definitions; documented read/write/cancel behavior.
- Added `RpcHostUriBridge` in rpc mode to register schemes, dispatch read/write/cancel ops, and clear pending requests.
- Added internal URL write support with lowercased scheme matching, handler routing, and hashline-prefixed success output.
- Added Python host-uri APIs/exports, cancellable client request handling, and host-uri read/write test coverage.
2026-05-15 00:54:09 +02:00
can1357 ba2928da6b feat(coding-agent): added scratch-directory handling to status-line path segment
- Updated the status-line path segment to detect project directories under OS scratch roots and strip the scratch root when rendering.
- Switched scratch-root paths to use the new icon.scratchFolder glyph and registered that symbol across theme variants.
- Added tests covering scratch-root trimming, nested scratch subpaths, and non-scratch fallback icon behavior.
2026-05-15 00:47:05 +02:00
David Marshall 6b63903cf2 refactor(coding-agent/acp): read sessionId lazily on every elicitation
`AgentSession.sessionId` is a getter that reads through to
`sessionManager.getSessionId()` and mutates when an extension command
calls `ctx.newSession` or `ctx.switchSession` (both exposed in the
same #configureExtensions block). Snapshotting the id once at factory
time routed later elicitations to the pre-switch id — diverging from
every other sessionUpdate call in this file, which already reads
record.session.sessionId live.

createAcpExtensionUiContext now takes `getSessionId: () => string` and
calls it per elicitation. Caller passes `() => record.session.sessionId`
so each select / confirm / input picks up the current id.

Also simplifies elicitFromAcpClient: `onAbort` and `finish` had
identical settlement bodies differing only by the resolve value, with a
hand-rolled `removeEventListener` symmetry comment to keep them in
sync. Collapsed to a single settle path — `onAbort = () =>
finish(undefined)` — so future changes to settlement apply to both
paths automatically. Doc-comment tightened to call out that late SDK
`accept` responses (not just rejections) after abort/timeout are also
dropped silently.

New regression test asserts that mutating the captured sessionId
between elicitations is reflected in the next request.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-14 09:59:43 -05:00