Commit Graph

5373 Commits

Author SHA1 Message Date
can1357 78b4bbb93b Rewrite hashline prompt examples to ASCII-only Mr/Mrs/Dr motif
The previous examples used " • " in the source file and inserted "·"
as the new content. Some agents were copying the middle-dot literally
into real edits as if it were format scaffolding, since the demo
inserts were near-twins of the existing string.

The new example uses TITLE = "Mr" → "Mrs" with "Dr" inserts:
ASCII-only, clearly distinct from any payload separator, and obviously
domain content rather than punctuation the model could confuse for
syntax. Every original op shape is preserved (single-line replace,
multiline replace, insert AFTER/BEFORE, append, delete, blank, both
anti-patterns). Pure prompt change; parser/schema/runtime untouched.
2026-05-15 04:20:30 +02:00
can1357 16542063c4 docs(tools): added guidance note for eval tool usage in docs
- Added an explicit notice in the eval tool docs cautioning against using one-off `-c`/`-e` shell executions.
- Documented that the eval tool should be used instead for persistent runtimes, structured outputs, and cancellation or timeout support.
2026-05-15 04:20:21 +02:00
can1357 864f056b45 fix(coding-agent/hashline): fixed hashline parser recovery for blank payload lines
- Updated `collectPayload` to treat blank lines inside a payload run as empty entries when subsequent payload text is present.
- Added lookahead-based end-of-run detection so blank lines before a non-payload operation remain section separators.
- Added tests verifying blank-line recovery inside payloads and non-consumption of trailing blanks between hashline sections.
2026-05-15 04:01:42 +02:00
Can Bölük d5c6b575a1 Merge pull request #1084 from can1357/farm/96c54e4b/fix-web-search-anthropic-fetch-has-no-ab
fix(web-search): thread AbortSignal to fetch() in anthropic, exa, jina, zai, gemini providers
2026-05-15 03:47:39 +02:00
can1357 db19fb565e style(pi-shell): formatted fixup shell cleanup code and tests for readability
- Converted several single-line guard-style `if let`/`let Some` exits in `fixup.rs` into multiline blocks for consistent style.
- Reformatted the safe-argument regex definition and normalized test case formatting in `fixup.rs` without altering assertions.
- Reordered `lib.rs` module exports by moving `fixup` ahead of `minimizer`.
2026-05-15 03:46:31 +02:00
roboomp 565a6cf971 fix(web-search): thread AbortSignal to fetch() in anthropic, exa, jina, zai, gemini providers
- anthropic: add signal to AnthropicSearchParams, callSearch(), and
  AnthropicProvider.search()
- exa: add signal to ExaSearchParams, callExaSearch(), and ExaProvider.search()
- jina: add signal to JinaSearchParams, callJinaSearch(), and JinaProvider.search()
- zai: add signal to ZaiSearchParams, callZaiTool(), and ZaiProvider.search()
- gemini: add signal to GeminiSearchParams, callGeminiSearch() and
  buildInit() so both fetchWithRetry calls (initial + auth-refresh retry)
  carry the signal

The five providers listed above never forwarded SearchParams.signal to the
underlying HTTP layer, so pressing Esc during a web_search call had no effect
and the session froze until the request resolved or Ctrl+C was pressed.

brave, kimi, perplexity, searxng, tavily, synthetic, codex, kagi, and parallel
already thread the signal correctly and are unchanged.

Fixes #1044
2026-05-15 01:19:48 +00:00
can1357 f0ff398607 fix(coding-agent/tools): stripped duplicate output notices from TUI tool renderers
- Added stripOutputNotice to output-meta to remove appended truncation notices when output metadata is available.
- Updated bash, eval, browser, read, and ssh renderers to strip the notice before display so the styled warning line is not duplicated.
- Left fallback behavior unchanged so outputs without a notice continue through unchanged.
2026-05-15 03:16:16 +02:00
can1357 2ea1bd96b8 feat(python/omp-rpc): added user and group options to RpcClient startup
- Added user, group, and extra_groups parameters to RpcClient initialization.
- Propagated those parameters through to subprocess startup calls.
- Added tests to verify the new kwargs are passed correctly, including None defaults and empty extra groups.
2026-05-15 02:23:43 +02:00
can1357 7754607561 fix(coding-agent/tools): wrapped bash fixup notice in system-warning tags
- Updated `formatBashFixupNotice` to wrap the stripped-pattern warning in a `<system-warning>` wrapper.
- Reworded the notice to clarify output is already truncated and stderr is merged into stdout.
- Extended the Bash interceptor test to verify the warning tag appears for head/tail stripping.
2026-05-15 02:23:35 +02:00
can1357 f9098cff39 config(coding-agent/lsp): disabled rust-analyzer check-on-save in LSP defaults
- Updated the Rust LSP default settings to set rust-analyzer.checkOnSave to false.
2026-05-15 02:18:28 +02:00
can1357 7cd05c374c feat(coding-agent/eval): enabled top-level await execution in Python runner cells
- Added a persistent asyncio event loop and coroutine-aware compiled-code execution for runner cells.
- Enabled compiling notebook cells with top-level await flags and awaiting coroutine results before rendering.
- Added an integration test confirming top-level await works across kernel cells with preserved state.
2026-05-15 02:12:34 +02:00
can1357 92c42f44f7 fix(coding-agent/tools): resolved bash fixup parsing for head/tail chunks
- Added top-level parsing and segment splitting to apply bash fixups only on safe command chunks.
- Replaced `stripTrailingHeadTail` usage with `applyBashFixups` and array-based notice formatting.
- Fixed terminal `| head`/`| tail` and redundant `2>&1` stripping while preserving command semantics.
- Updated fixup tests for cross-command cases and removed superseded head-tail-only test coverage.
2026-05-15 02:12:28 +02:00
can1357 f8ea641cdb fix(stats): ignored messages without IDs when parsing session entries
- Added message-ID checks in both assistant and user message parsers so entries without valid ids are ignored.
- This filtering prevents legacy, unlinked message records from being treated as parseable assistant or user messages.
2026-05-15 01:09:26 +02:00
can1357 05117a0258 test(python/omp-rpc): reworked host URI tests to capture uri_echo notifications
- Adjusted the test server in test_host_uris.py to re-emit host_uri_result frames as uri_echo notifications.
- Updated test client setup to attach an unknown-notification capture hook for uri_echo frames.
- Changed _await_echo to read captured uri_echo frames from that hook and fail fast if capture is missing.
2026-05-15 01:00:06 +02:00
can1357 3e9ca3e279 fix(python/omp-rpc): accepted string or array systemPrompt values in session state parsing
- Added `_optional_str_list` to normalize `systemPrompt` payloads into a tuple when absent, a bare string, or a string array, and to reject invalid shapes.
- Updated `SessionState` to hold `system_prompt` as a tuple and to parse daemon payloads with the new helper in `parse_session_state`.
- Extended protocol tests to verify array and legacy string parsing, default empty tuple behavior, and invalid `systemPrompt` values.
2026-05-15 00:55:52 +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 9bbc7465ba feat(coding-agent): strip trailing | head/tail from single-line bash commands
Drop trailing `| head [args]` / `| tail [args]` pipes that exist purely
to limit output — the harness already truncates bash output and exposes
the full result via the bash-original artifact, so these pipes only
hide content from the agent.

Conservative gates (any failing leaves the command verbatim):

  - single-line only; multi-line scripts may legitimately end pipelines
    with head/tail to bound a generator or loop body
  - whitelisted limit-only args (-nN, -n N, -cN, -N, -q, -v, --lines[=N],
    --bytes[=N], --quiet, --verbose); rejects -f/-F/+N/filenames so
    `tail -f`, `tail -n +2` etc. stay intact
  - regex anchored at end of command; any downstream operator (`&&`,
    `||`, `;`, `&`, `>`, `|`, `` ` ``, `$(…)`, `)`) blocks the match, so
    `just build 2>&1 | tail -3 && just up && …` is untouched
  - refuses to reduce the command to an empty string
  - pipe boundary uses `[ \t]*`, not `\s*`, so a `|` on a continuation
    line cannot be swallowed

Consolidates the existing `timeoutClampNotice` and the new strip notice
into a single `pendingNotices: string[]` array threaded through every
execute branch (async, auto-background, ACP terminal, local exec).

New setting `bash.stripTrailingHeadTail` (default `true`).
2026-05-15 00:50:00 +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
can1357 a8477be7a7 fix: corrected legacy pi-* aliases and restored pi-tui key mapping
- Fixed legacy `pi-*` scope alias remapping to canonical packages, including `pi-ai/oauth` rewrites.
- Fixed restoration of `Key` on `@oh-my-pi/pi-tui` with canonical key strings and typed modifier helpers.
- Updated both package changelogs with unreleased notes for compatibility and `Key` restoration.
- Added `pi-scope-aliases.test.ts` coverage for alias remaps using fixture plugins and `loadExtensions`.
2026-05-15 00:03:57 +02:00
can1357 fba055d8c9 ux(coding-agent/tools): added multiline job label display in tool output
- Updated job label rendering to split labels on newlines and cap visible lines by collapsed or expanded view state.
- Truncated each visible label line to the existing max width and appended an ellipsis when extra lines were hidden.
- Printed additional visible label lines as indented follow-on lines beneath the job header.
2026-05-14 23:44:25 +02:00
can1357 0462da9c69 refactor(natives): reorganized native loading with loadNative in index
- Extracted and centralized addon loading in `native/index.js`, replacing inline helper logic with `loadNative()`.
- Added `loader-state` context initialization, cache-path resolution, and variant detection for native candidate loading.
- Added `loadNative()` signature to `loader-state.d.ts` returning `Record<string, unknown>`.
- Reworked enum generation to replace JS between markers in `native/index.js` and removed `native-index.template.js` usage.
2026-05-14 23:39:06 +02:00
can1357 dac28f66e4 feat: added windows native staging candidates before runtime paths
- Added Windows node_modules staging checks so non-compiled addons are copied into versioned native directories.
- Updated loader candidate resolution to prefer embedded/staged/versioned candidates before default runtime paths when staging is enabled.
- Added runtime version-sentinel export __piNativesV15_0_1 and load-time validation to avoid stale binary drift.
- Added typing and release-flow updates to expose staging options and keep per-release sentinel IDs aligned.
2026-05-14 23:24:14 +02:00
can1357 f24afe13f4 fix(read): added truncation tally markers and elision recovery footers
- Updated shell minimizer line truncation to append `...[+N]` with the count of dropped Unicode scalars when truncation occurs.
- Updated read summary rendering to track `elidedLines`, include them in tool details, and append a recovery footer for `:raw` or line-range access whenever elided spans are present.
- Updated read-tool prompts/docs/tests to cover the new elision-footers and recovery guidance.

Fixes #1046
2026-05-14 23:22:27 +02:00
can1357 3009e41e20 chore: update docs 2026-05-14 21:32:31 +02:00
Can Bölük 7070259538 Merge pull request #1078 from shoucandanghehe/fix/moonshot-kimi-forced-tool-thinking
fix(ai): disable Kimi thinking for forced tools
2026-05-14 21:32:20 +02:00
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
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