Commit Graph

5407 Commits

Author SHA1 Message Date
shoucandanghehe 8b4b73e3c4 fix(ai): replay Kimi reasoning placeholder 2026-05-15 02:46:44 +08:00
shoucandanghehe 0bf280d079 fix(ai): disable Kimi thinking for forced tools 2026-05-15 02:29:14 +08:00
ephraimduncan bea95b056d fix(ai): recover stalled lazy provider streams 2026-05-14 15:28:59 +00:00
David Marshall d47f55c7fd fix(coding-agent/acp): narrow CreateElicitationRequest variant before reading sessionId in live-getter test
`CreateElicitationRequest` is a discriminated union — even after
narrowing on `mode === "form"`, both `ElicitationRequestScope` (no
`sessionId`) and `ElicitationSessionScope` (with `sessionId`)
remain in the union. The new live-getter regression test was reading
`calls[N]!.sessionId` directly, which CI tsgo rejected with TS2339.

Per-element `if (!call || call.mode !== "form" || !("sessionId"
in call))` narrows to the session-scoped variant. Spelled three times
because loop-style narrows don't propagate to the assertions below.
Matches the discriminator pattern used in the older 'translates select'
test at line ~927.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-14 10:24:21 -05:00
David Marshall d7e8a7358b style(coding-agent/acp): wrap long createAcpExtensionUiContext test call-sites
`biome check` enforces print-width on the two test-only call-sites that
`ast_edit` collapsed onto a single line during the sessionId-getter
rewrite. Auto-formatter wrap, no behavior change.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-14 10:16:26 -05: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
zolszabo 6ac5e4e1ce fix: exclude OpenCode providers from synthetic reasoning_content injection for Kimi models
OpenCode-Go and OpenCode-Zen handle reasoning content internally
and reject client-supplied reasoning_content in message history.
When retry fallback forwards conversation history to
opencode-go/kimi-k2.6, the compat layer was injecting synthetic
reasoning_content: '.' on assistant tool-call turns, causing
HTTP 400: 'Extra inputs are not permitted'.

Gate isKimiModel in requiresReasoningContentForToolCalls on
!isOpenCodeProvider so the injection path is skipped for
OpenCode providers while preserving existing behavior for
native Kimi API, DeepSeek, and OpenRouter.
2026-05-14 16:27:37 +02:00
jiwangyihao 07ca844936 fix(coding-agent): reject overlapping ACP prompts before queueing 2026-05-14 22:25:47 +08:00
jiwangyihao 03d7acb804 fix(coding-agent): serialize ACP idle cleanup prompts 2026-05-14 21:41:38 +08:00
jiwangyihao b15eb064f0 fix(coding-agent): wait for ACP prompt idle cleanup 2026-05-14 20:55:53 +08:00
David Marshall cf623e5748 feat(coding-agent/acp): bridged ExtensionUIContext to ACP unstable_createElicitation
Promotes the stub acpExtensionUiContext to a createAcpExtensionUiContext
factory invoked per session inside #configureExtensions. select / confirm
/ input each map to a single-property `value` schema and round-trip
through a shared elicitFromAcpClient helper that mirrors
RpcExtensionUIContext.#createDialogPromise:

  - capability gating on clientCapabilities.elicitation.form
  - runtime typeof narrowing on accept payloads (wrong-type / missing
    key / no content all fall back to the stub return values)
  - dialogOptions.signal: pre-aborted short-circuits before any SDK
    call; mid-flight abort races the in-flight elicitation. Symmetric
    removeEventListener on both onAbort and finish paths.
  - dialogOptions.timeout: setTimeout(.unref()) settles the promise via
    onTimeout + stub fallback. A throwing onTimeout is caught and
    logged so the elicitation promise still settles.
  - late SDK rejections after abort/timeout are dropped silently;
    transport failures log via logger.warn with { sessionId, method,
    error }.

Empty/whitespace-only placeholders on `input` and empty/whitespace-only
messages on `confirm` are treated as absent (trim-aware), matching the
behavior documented in the CHANGELOG bullet.

15 new tests cover request shape, decline/cancel, missing capability,
transport failure, pre-abort, mid-flight abort, wrong-typed accept,
missing `value` key, no content, timeout, whitespace placeholder,
empty-message join, and throwing onTimeout.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-14 00:36:43 -05:00
can1357 09e4b58672 chore: bump version to 15.0.1 2026-05-14 07:28:49 +02:00
can1357 fb76055c28 docs(system-prompts): condensed skill to house style and tool authoring guide
- Removed empirical benchmark claims and verbose technique reference sections.
- Replaced with actionable rules: RFC 2119 aliases, density targets, positioning order.
- Added tool prompt authoring section covering surface vs. machinery and example contracts.
2026-05-14 07:18:48 +02:00
can1357 1a77322a4d fix(hashline): adjusted hashline anchor rejection messaging and guidance
- Updated the hashline mismatch error to describe anchor mismatches against the current file.
- Rewrote hashline tool instructions to clarify insert payload rules, anchor usage, and avoidance of fabricated hashes.
- Expanded stale-edit detection and tests to recognize the revised anchor-mismatch rejection wording.
2026-05-14 07:06:42 +02:00
can1357 b9b2c381f0 fix(coding-agent/goals): skipped goal accounting operations when accounting state was absent
- Added an internal accounting-state guard and used it to skip goal usage flushing when accounting was inactive.
- Updated goal abort handling to return early unless accounting or pause logic was required, then paused only a cloned active goal state before committing.
- Aligned related tests/types by tightening OpenAI helper typing and using Tool typings for the goal tool registry.
2026-05-14 06:53:21 +02:00
can1357 a086d0b98d docs(coding-agent): added bash tool restrictions for coreutils and I/O redirection
- Discouraged coreutils in favor of dedicated read/search/find/edit/write tools.
- Prohibited pipe truncation via head/tail since artifacts handle full output.
- Prohibited stderr redirection since stdout and stderr are already merged.
2026-05-14 06:53:21 +02:00
can1357 12115e4cdf fix(utils): excluded ASCII replacements inside HTML comments
- Added an HTML comment state tracker to prompt formatting.
- Updated ASCII symbol replacement to skip substitutions inside `<!-- ... -->` comment blocks across lines.
- Added tests that preserved comment text while converting symbols outside comments.
2026-05-14 06:40:50 +02:00
can1357 933058a241 feat(goals): added per-session goal mode with token budget tracking
- Added GoalRuntime with wall-clock and token accounting, budget steering, and lifecycle operations (create, pause, resume, drop, complete).
- Exposed goal tool as a hidden agent tool, activated only when goal mode is enabled.
- Integrated goal continuation loop in InteractiveMode with auto-submit between turns.
- Added status line segment and theme icons for goal mode state.
2026-05-14 06:40:41 +02:00
can1357 88e486be29 fix(coding-agent/modes): hardened context breakdown against absent session fields
- Hardened context usage accounting to tolerate missing session fields by defaulting skills and tools to empty arrays.
- Guarded message and system-prompt token counting with presence checks to avoid access errors on partial session objects.
2026-05-14 06:37:25 +02:00
can1357 6d00cc1f08 test(ai): added reasoning model helper for OpenAI response history tests
- Added getOpenAIReasoningModel to wrap the bundled gpt-5-mini model with a non-gpt-5 name in tests.
- Replaced all OpenAI responses test model constructions using gpt-5-mini with the new helper to bypass reasoning-model branching during payload assertions.
2026-05-14 06:23:55 +02:00
can1357 ad2e5c0578 refactor(coding-agent/exa): renamed tool detail field from response to raw
- Updated the Exa tool factory to emit details using a raw field rather than response.
- Updated the MCP wrapped Exa tool to emit details using a raw field rather than response.
2026-05-14 06:16:31 +02:00
can1357 71f3997afa fix(session): resolved session persistence flow to use sync write/read APIs
- Added sync truncation helpers to recursively prepare session entries and externalize image data.
- Reworked session persistence to use synchronous preparation plus `writeSync` with close-state checks.
- Added synchronous session-storage APIs and rerouted write paths to `writeLineSync`/`readTextSync`.
- Added `BlobStore.putSync`, migrated hashing to `Bun.SHA256`, and updated hash tests accordingly.
2026-05-14 06:12:41 +02:00
can1357 cf627d5577 docs(coding-agent/prompts): updated hashline prompt to clarify delta-only payloads
- Expanded the hashline tool rules to state that patch payloads should only contain newly added lines and must not duplicate existing content.
- Clarified that insertion and replacement operations affect only their specified targets, with adjacent lines remaining unchanged.
- Reinforced widening edits to self-contained syntactic units before selecting the smallest patch operation.
2026-05-14 05:58:25 +02:00
can1357 8fc5b78f30 feat(read): added comma-separated scatter gather line selector support
- Extended selector regex and parser to accept ranges like `:5-16,960-973`.
- Ranges are sorted and merged automatically before reading.
- Out-of-bounds ranges surface as inline notices instead of errors.
- Added `#readLocalFileMultiRange` and `#buildInMemoryMultiRangeResult` for file, archive, notebook, and internal URL targets.
2026-05-14 05:58:25 +02:00
can1357 cf4173a100 feat(exa): replaced raw JSON responses with human-readable formatting
- Added formatGenericResponse to handle objects, arrays, MCP content blocks, and primitives.
- Applied formatted output to MCPWrappedTool, createExaTool, and propose-changelog tool.
- Replaced raw response in details field with structured response object.
2026-05-14 05:58:25 +02:00
can1357 fe7b3d7005 refactor(coding-agent): removed intent property from WriteTool 2026-05-14 05:58:25 +02:00
can1357 3592865fe1 fix: plan mode types 2026-05-14 05:38:09 +02:00
can1357 786c25e6c7 fix(coding-agent): resolved coding-agent cli --help startup init cycle
- Fixed root `cli --help` startup by preventing the config/model-registry initialization cycle.
- Extracted config validation, migration, and loading logic from config.ts into config/config-file.ts.
- Added ConfigFile helpers for migration, validated JSON/JSONC/YAML loading, status caching, and reset.
- Added a regression test that runs `cli.ts --help` with temp HOME/XDG env paths and expects exit code 0.
2026-05-14 05:35:16 +02:00
can1357 ef5cbef51f feat(coding-agent): added resolve-based plan approval flow in coding-agent
- Removed ExitPlanModeTool and deleted exit-plan-mode docs/tests, dropping the old approval contract outputs.
- Replaced plan-mode approval flow from exit_plan_mode to resolve across session, SDK, controllers, and discovery.
- Added standing resolve handler accessors and updated resolve routing for queued or standing approval handlers.
- Added PlanApprovalDetails and enforced normalized, validated approval titles with readable plan-file requirements.
- Extended resolve schema and invocation signatures with optional extra metadata and reason trimming behavior updates.
- Updated plan and resolve prompts and changelog guidance to require resolve action, reason, and extra.title for apply/discard.
2026-05-14 05:33:30 +02:00
can1357 0b62f2971b fix(ci): restore @napi-rs/cli dep and align tests with current types
The earlier exports/cleanup refactor removed @napi-rs/cli from
packages/natives devDeps, breaking every native job. It also left two
test files calling private symbols and a stale KeyId literal:

- packages/natives: re-add @napi-rs/cli (catalog) so node_modules/.bin/napi
  exists for build-native.ts.
- test/acp-agent.test.ts: import ACP_BOOTSTRAP_RACE_GUARD_MS from
  modes/acp/acp-agent (previously implicit via mass-export refactor).
- test/silent-abort-overlay-render.test.ts: lowercase 'Ctrl+S' -> 'ctrl+s'
  to match the KeyId union.
2026-05-14 05:12:07 +02:00
can1357 1fb59df0bb fix(edit): stripped all leading @ prefixes from hashline input headers
- Updated parseHashlineInputPreviewHeader to strip all leading "@" markers before resolving the preview path, matching existing parser behavior.
- Added a regression test in edit renderer tests confirming both canonical "@@" and longer "@" runs render as clean file paths without extra "@" characters in titles.
2026-05-14 05:06:00 +02:00
can1357 ba47b0e32f fix(tools): recovered malformed conflict:// paths during write conflict resolution
- Updated conflict URI parsing to accept `path:conflict://N` and record the removed prefix in `recoveredPrefix`.
- Updated write conflict handling to resolve single or wildcard IDs through shared helpers and append a recovery note when a malformed prefix was stripped.
- Added regression tests for recovered prefixes and end-to-end write-path recovery and documented the change in the changelog.
2026-05-14 05:03:04 +02:00
Can Bölük 4de99a481b Merge pull request #1063 from chuaaron/fix/edit-format-reminder
fix(edit): add format reminder to hashline prompt
2026-05-14 05:02:52 +02:00
can1357 d62480dc65 fix(edit): slim format-reminder and use configured separator
- Drop duplicated op listing from the reminder; <ops> already defines
  the four shapes one block above.
- Replace hardcoded `~` with the {{hsep}} helper so the reminder
  tracks PI_HL_SEP / HL_EDIT_SEP overrides, matching the rest of
  hashline.md and addressing Codex review on #1063.
- Shrink the WRONG/RIGHT example (smaller anchor, no padding runs)
  since the reminder's only job is contrasting on-line vs next-line
  payload placement.
2026-05-14 05:01:55 +02:00
Can Bölük fba9c6fb90 Merge pull request #1043 from OutlineDriven/fix/skill-chip-and-silent-abort
fix(coding-agent/tui): rendered queued /skill: as compact chip; silenced plan-compact abort
2026-05-14 04:51:49 +02:00
Can Bölük 8f1d98fa38 Merge branch 'main' into fix/skill-chip-and-silent-abort 2026-05-14 04:51:41 +02:00
Can Bölük 57ce77fa79 Merge pull request #1042 from tsagi2045/fix/status-line-context-pct
fix(coding-agent): align status-line context% with /context command output
2026-05-14 04:49:11 +02:00
Can Bölük 2b644148dc Merge pull request #1048 from rburketaylor/fix/context-window-fallback
fix(coding-agent): preserve bundled contextWindow/maxTokens when discovery returns sentinel fallbacks
2026-05-14 04:48:24 +02:00
Can Bölük ed88f0f90d Merge branch 'main' into fix/context-window-fallback 2026-05-14 04:48:16 +02:00
Can Bölük 26931fe8ce Merge pull request #1055 from jiwangyihao/fix/browser-worker-startup-errors
fix(browser): surface tab worker startup errors
2026-05-14 04:47:31 +02:00
can1357 46f2c96762 config(config): configured changelog merge behavior in .gitattributes
- Updated .gitattributes to merge package changelog files using a union strategy for append-only updates.
2026-05-14 04:46:58 +02:00
Can Bölük a4c55f2bd0 Merge pull request #1056 from jiwangyihao/fix/browser-stealth-target-setup
fix(browser): bound stealth target setup during tab open
2026-05-14 04:46:38 +02:00
Can Bölük 3d2bbe5e8f Merge branch 'main' into fix/browser-stealth-target-setup 2026-05-14 04:46:30 +02:00
Can Bölük 01c611fa9d Merge pull request #1058 from apoc/fix/token-display-exclude-cache-read
[For Discussion] fix(coding-agent): exclude cacheRead from token display, add per-subagent cost
2026-05-14 04:45:23 +02:00
Can Bölük 7a50b9ed58 Merge branch 'main' into fix/token-display-exclude-cache-read 2026-05-14 04:45:05 +02:00
Can Bölük 9e28dd7252 Merge pull request #1060 from dmarsh-gusto/dmarsh/acp-thinking-level-push
fix(coding-agent/acp): push config_option_update on every thinking-level change
2026-05-14 04:44:29 +02:00
Can Bölük 3ad9255b18 Merge branch 'main' into dmarsh/acp-thinking-level-push 2026-05-14 04:43:55 +02:00
Can Bölük 9530f94a36 Merge pull request #1061 from ldx/fix/mcp-oauth-persist-dynamic-client
fix(coding-agent): persist dynamically registered MCP OAuth client_id
2026-05-14 04:43:08 +02:00
Can Bölük 38255a4e6e Merge pull request #1062 from enieuwy/fix/copy-handoff-context
Fix /copy fallback for handoff context
2026-05-14 04:42:53 +02:00
can1357 1ea87b26bc feat(coding-agent): added hidden skill flag for system prompt filtering
- Added optional `hide` metadata to skill capabilities so `SKILL.md` frontmatter intent is preserved when skills are loaded.
- Filtered system prompt skill rendering to exclude `hide: true` skills from the `<skills>` listing while keeping them loadable.
2026-05-14 04:38:14 +02:00