Commit Graph

874 Commits

Author SHA1 Message Date
can1357 5ea1d55e56 feat: removed chunk-mode modules and read/edit entrypoints from pi-natives
- Removed `pi-natives` chunk language classifier modules and all core chunk subsystems (kind, state, render, edit, resolve).
- Removed chunk-mode CLI/read/edit entrypoints, including `read` command and chunk mode registration/prompt tooling.
- Removed chunk selectors from `read` and `grep` tools, switching behavior to raw/L-range handling.
- Fixed poll wait parsing to keep defaulting to `30s` when the provided value is empty.
2026-04-26 08:19:02 +02:00
can1357 5de4774f16 fix: session listing
- Session metadata now stores on-disk size bytes, populated from file stats when collecting sessions.
- The session selector metadata line now renders file size using formatBytes instead of message counts.
- Session test fixtures were updated with the new size property so they match the revised SessionInfo shape.
2026-04-26 06:59:47 +02:00
can1357 725cb89899 feat(coding-agent): added sed atom edits and LINE+ID hashline output
- Added `sed` atom editing with `g`, `i`, and `F` flags, path/anchor parsing, and conflict handling updates.
- Changed hashline and grep/read output to `LINE+ID|content` with `>` match prefixes and `:` context prefixes.
- Fixed atom anchor parsing for path-qualified locs, hyphenated single anchors, and content hints after `|` or `:`.
- Updated prompts, changelog, and tests to document and validate the new hashline and `sed` formats.
2026-04-26 06:44:27 +02:00
can1357 f80348bf34 fix(coding-agent): kept inspect_image tool non-strict and removed cwd from python schema test 2026-04-26 05:49:29 +02:00
can1357 8321996758 feat(tools): implemented op-based github tool replacing gh_* registrations
- Consolidated all former gh_* tools into a single GithubTool that routes execution by a required op field.
- Replaced gh_* tool registrations and render dispatch with `github`, including renderer key and header updates.
- Removed deprecated gh-* tool prompt files and added a unified github.md prompt covering per-op inputs and outputs.
- Updated settings-schema and ci-green prompt guidance to reference the unified github tool and `run_watch` operation.
- Updated tests and tool imports to use `GithubTool`/`githubToolRenderer` with op-based payloads and assertions.
2026-04-26 05:48:07 +02:00
can1357 0db51b1dbc fix(coding-agent): removed atom sub edits and excluded write from Anthropic strict allowlist
- Removed the atom tool's `sub` verb from its schema, parser, conflict checks, and edit application.
- Updated atom documentation, examples, and tests to reject `sub`-based replacements in favor of `set` replacements.
- Adjusted Anthropic strict-tool handling by dropping `write` from the allowlist and updating alignment expectations.
2026-04-26 05:28:23 +02:00
can1357 52da3674a4 feat(coding-agent): added auto-rebase for stale atom/hashline anchors
- Added auto-rebasing for stale atom and hashline anchors within ±2 lines, with warning diagnostics.
- Removed atom range-locator support and dropped `between` ops, updating docs/tests for `sub` over `set` nudges.
- Changed no-op handling to track unchanged hashline edits and emit contextual hints for unchanged ranges.
- Expanded Anthropic strict error handling to retry on schema-too-complex and compiled-grammar-too-large errors.
- Added anchor-retargeting warning checks and updated edit tests to expect locator and range-locator rejections.
- Updated python tool-call fixtures by adding `title` to executed-cell payloads and adjusting related test expectations.
2026-04-26 05:22:15 +02:00
can1357 652f49442f refactor(coding-agent/tools): wrapped todo_write parameters in an ops object
- Changed the todo-write parameter schema from a bare operations array to an object containing an `ops` array.
- Updated request parsing and renderer logic to consume `params.ops` and `args.ops` when processing todo operations.
- Updated session and unit tests to invoke todo_write with wrapped `{ ops: [...] }` payloads.
2026-04-26 05:11:59 +02:00
can1357 eb8c20955d test(hashline-tests): updated hashline tests for colon-prefixed anchors
- Adjusted hashline tests to expect colon-prefixed anchors in format, diff preview, and parse assertions.
- Updated ast-edit test regexes and split logic to parse colon-delimited hashline prefixes.
2026-04-26 05:01:53 +02:00
can1357 b670d67652 fix(grep-tool): patched grep-tool skip-limit message and test assertion
- Updated GrepTool result-limit messaging to include a concrete next skip hint.
- Updated grep tool test assertion to verify the new skip-hint limit message.
2026-04-26 05:01:52 +02:00
can1357 e3f7496deb feat(coding-agent): added ordered todo_write ops and sequential execution
- Changed `todo_write` to an ordered `op`-array model with `replace`, `start`, `done`, `rm`, `drop`, `append`.
- Removed legacy multi-field todo payloads and updated tests/fixtures to use ordered `{op, task?, phase?, items?}[]` args.
- Reworked todo operation execution to apply entries sequentially and validate missing or unknown task/phase IDs.
- Updated todo rendering to use `todo.content` only and changed bash artifact labels from `full result` to `raw output`.
2026-04-26 05:00:54 +02:00
can1357 b22837f898 feat(coding-agent): added unified path targets for grep family
- Consolidated grep, ast-grep, and ast-edit on required `path`, replacing `glob`/`lang`/`sel` with inline file, dir, glob, list, and URL targets.
- Changed ast-grep and grep schemas to require a single `pat` string and use `skip` pagination instead of array patterns or offsets.
- Updated argument validation to reject empty `path` and invalid `skip`, and routed grep context to session settings only.
- Updated tool prompts and tests to reflect new path globbing semantics and `first N` truncation output text.
2026-04-26 04:33:38 +02:00
can1357 d294b8021d fix(coding-agent/tools): aligned Python tool execution to session cwd and removed cwd option
- Disabled strict schema enforcement on AskTool to relax request validation.
- Removed the optional `cwd` field from Python tool parameters and used `session.cwd` for warmup and execution context.
- Updated atom edit test fixtures to pass `set` as arrays instead of scalar strings.
2026-04-26 04:01:33 +02:00
can1357 d0a3791ea6 fix(agent): changed intent tracing marker from _i to i
- Updated the agent loop intent marker constant to use `i` instead of `_i` for tracing fields.
- Updated intent tracing documentation to describe a generic string marker field and cleanup behavior.
- Adjusted related Anthropic and coding-agent tests to match the renamed intent field via shared `INTENT_FIELD` usage.
2026-04-26 03:58:56 +02:00
can1357 5cba717ff7 feat(coding-agent): added locator-based atom edits with loc selectors
- Added locator-based atom edits with required `loc`, including inline `file:line`, range, and `^`/`$` selectors.
- Added path resolution via top-level path, entry path, or `path:loc` selectors and flattened multi-target atom execution.
- Removed `del`; required `set/pre/post` to use line arrays and mapped `set: []` to deletion semantics.
- Changed `sub` payloads to required `[find, replace]` tuples and tightened parsing to accept null optional verbs and array-or-null lines.
2026-04-26 03:34:33 +02:00
can1357 c82df1367d fix(edit): collapsed unchanged diff context between distant edit blocks
- Updated generateDiffString to preserve bounded context at both edges of unchanged regions between adjacent changes by adding a middle skip and ellipsis.
- Added a test covering distant edit hunks to verify unchanged lines in the gap are collapsed while change lines remain visible.
2026-04-26 03:17:55 +02:00
can1357 985f2049ab fix(coding-agent/tools): disabled strict tool parameter validation across built-in tools
- Added an optional strict field to CustomTool definitions to support non-strict execution mode.
- Set strict to false across built-in AgentTool and custom tool registrations, including browser, calculator, GitHub, image generation, and related utilities.
- Updated inspect-image tests to reflect the relaxed strict setting on the tool.
2026-04-26 03:17:30 +02:00
can1357 4f85ebe472 fix(coding-agent): corrected gutter marker alignment in diff rendering
- Added `CodeFrameMarker` and `formatCodeFrameLine()` to centralize code-frame gutter formatting.
- Extended diff rendering to preserve `|` and `│` separators, aligning gutter markers and line numbers.
- Reworked AST, grep, hashline, Vim, and diff renderers to use shared line formatting with computed `lineNumberWidth`.
- Updated atom editing flow and tests, including `resolveAtomEntryPaths` migration and new loc-based/edge-case coverage.
- Adjusted benchmark runner early-stop configuration by passing `buildEarlyStop` through prompt collection.
2026-04-26 03:00:51 +02:00
can1357 f101cdd5e2 feat(coding-agent): added openai image-gen support
- Added `openai` and `openai-codex` as image providers and let `providers.image=auto` prefer GPT images.
- Updated settings, selector, and SDK wiring so OpenAI image providers pass through `setPreferredImageProvider`.
- Replaced Gemini-only image tooling with `image-gen` and added OpenAI/Codex hosted-image execution with SSE parsing.
- Added image-gen and handoff tests, including final-yield no-compaction regression and OpenAI payload/header assertions.
2026-04-26 02:46:46 +02:00
can1357 0e83d1a3c3 fix(coding-agent): corrected atom/hashline anchors for full line+suffix
- Changed hashline/atom parsing to require full `line+suffix` anchors and emit full-anchor guidance on failures.
- Updated atom/hashline prompt docs, `atom.test.ts`, and changelog entries to require exact full anchors like `160sr`.
- Added preformatted `displayContent` for read/grep/ast tools and switched renderers to prefer it in TUI output.
- Updated mismatch and grep/ast renderers to show context with `*` markers and gutter lines, removing legacy helpers.
2026-04-26 02:28:29 +02:00
can1357 cb45cba98e feat: implemented LINEID hashline parsing/output with pre/post atom ops
- Expanded hashline and chunk bigram tables to 647 entries and moved chunk checksums to a 40-item namespace.
- Changed hashline anchors from `LINE#ID`/`:` to concatenated `LINEID`\t forms across parsing and tool outputs.
- Removed line-number padding and routed diff/read/grep/renderer output through raw numbers, tabs, and `toDisplayLine` formatting.
- Renamed atom ops to `pre`/`post`, removed `ins`, and updated schemas, prompts, and tests for new insertion behavior.
2026-04-26 02:18:32 +02:00
can1357 e89b3cf7e8 feat(coding-agent/tools): added examples to coding-agent tools
- Added `examples` support to `StringEnum` schemas and propagated it to tool metadata.
- Added concise descriptions and example values across coding-agent tool schemas for clearer guidance.
- Documented the new StringEnum examples capability in `packages/ai/CHANGELOG.md`.
- Cast `real` to `HASHLINE_BIGRAMS` elements in `staleBigramFor` test setup.
2026-04-26 01:03:21 +02:00
can1357 778054c742 feat(coding-agent/edit): added tuple-based set syntax for block-body atom replacements
- Updated the atom edit schema and tool prompt docs to replace the standalone `between` form with a 2-tuple `set` form for exclusive block-body replacement.
- Adjusted `resolveAtomToolEdit` so `set` accepts either a single anchor or `[open, close]`, translates tuple input to an internal between-style op, and rejects tuple values that are not anchor strings.
- Expanded tests to verify tuple-based `set` resolution and to enforce validation errors for invalid `set` array inputs.
2026-04-26 00:46:02 +02:00
can1357 23a1277d83 feat(coding-agent): added between atom edits with anchor validation
- Added `between` atom edits with `after`/`before` anchors and logged them in changelog docs.
- Added `between` docs to prompt tooling, including two-anchor exception and anchor-order rules.
- Added `between` validation to reject stale anchors, invalid ranges, overlap, and nested interior edits.
- Reworked `applyAtomEdits` to apply `between` operations as bottom-up interior splices and adjacent-line inserts.
- Updated `file_path` schema description in review tool to "Path to the file".
- Added `AtomEdit` tests for `between` parsing and edge-case success/failure coverage.
2026-04-26 00:39:04 +02:00
can1357 ecd1554eba feat: renamed subagent handoff flow to use yield instead of submit_result
- Renamed subagent completion flow from `submit_result` to `yield` across SDK tools, prompts, and docs.
- Updated executor/task handling to require and parse `yield` calls, replacing legacy submit-result extraction and state flags.
- Added `subagent-yield-reminder` and updated system prompts to require `yield` with `result.data` or `result.error`.
- Renamed hidden-tool and registration plumbing to `yield`, including discovery helpers and renderer/test surface.
2026-04-26 00:29:52 +02:00
can1357 480d40f2a8 fix: corrected optional edit path fallback across chunk hashline modes
- Added raw read output propagation so read/archive commands bypass anchors, line numbers, and chunk formatting.
- Fixed atom/hashline editing by tightening hashline prefixes and applying grouped anchor edits in stable order.
- Hardened chunk parsing and path handling by using `bigram_end` checks and resolving edit paths via shared `args.path` fallback.
- Updated path-related behavior for chunk, replace, patch, and hashline previews to honor optional edit paths.
- Removed mode-level param validators and replaced them with runtime handling, then removed obsolete validation tests.
2026-04-26 00:29:18 +02:00
can1357 79bad40cfd feat(coding-agent): added atom mode to EditTool with path fallback
- Added `atom` edit mode to `EditTool` with single-point hashline-style dispatch and `executeAtomSingle`.
- Added `AtomToolEdit`/`AtomParams` schema and `atom` prompt docs to require one op per edit entry.
- Changed `EditTool` entry processing to inherit per-entry `path` from a top-level request `path` fallback.
- Added top-level `path` defaults to patch and replace schemas and now reject missing entry paths.
- Added an `atom` streaming strategy and registered it in `EDIT_MODE_STRATEGIES` for live mode support.
- Enabled hashline read anchors for `atom` mode via `file-display-mode.ts` path-display logic.
- Added `atom` unit tests covering schema checks, anchor conflicts, and hash mismatch diagnostics.
2026-04-26 00:29:17 +02:00
can1357 6d154a17f5 feat(coding-agent): added HASHLINE_BIGRAMS-based hashline/chunk handling
- Aligned hashline and chunk token handling to `HASHLINE_BIGRAMS` in `computeLineHash` and parsing regexes.
- Removed hashline file-level `move`/`delete` options from schemas and execution so edits are in-place updates only.
- Hardened hashline prefix parsing to reject non-bigram IDs, preventing false stripping of `#` comment lines.
- Updated `read()`/prompt wording so raw reads skip prefixes and examples now show anchors like `123#th`.
- Updated hashline chunk tests for new `HASHLINE_BIGRAMS` IDs and replaced stale hash constants.
2026-04-26 00:29:17 +02:00
Can Bölük 1f2a47e8f5 Merge pull request #780 from a-lavis/feat/provider-headers-config
Fix provider transport override durability across refresh and source handoff
2026-04-26 00:27:55 +02:00
Can Bölük 2fb2254658 Merge pull request #777 from JupiterFeng/fix/bash-snapshot-nonpty-timeout
Fix non-PTY bash timeout from large shell snapshots
2026-04-26 00:27:24 +02:00
can1357 ce17e4d1da fix(coding-agent): harden CPU info and PR push target
Fixes #779

Fixes #778
2026-04-25 18:56:47 +02:00
can1357 a815a25afe fix(coding-agent): reject empty write & align promotion tests to gpt-5.5
- Add explicit validation rejecting write:"" with the expected error message in normalizeChunkEditOperations.
- Update spark context-promotion tests (it_1, it_2, concurrent it_5) to expect promotion to gpt-5.5 (the new chain target on openai-codex), since spark variants now promote to gpt-5.5 rather than the base codex model.
2026-04-25 17:52:33 +02:00
Aidan 36f80f89cf test(coding-agent): remove redundant runtime overlay case 2026-04-24 18:28:17 -04:00
Aidan cb7febdc50 test(coding-agent): compact runtime provider refresh assertions 2026-04-24 18:24:44 -04:00
Aidan 89ad9926de fix(coding-agent): clear source handoff transport state eagerly 2026-04-24 17:56:17 -04:00
Aidan ff1549fd2c fix(coding-agent): preserve runtime provider transport override precedence 2026-04-24 17:45:06 -04:00
Aidan 1dbfa78dac Fix runtime provider override leakage across source handoff 2026-04-24 16:58:03 -04:00
can1357 bcf2e9e584 refactor(coding-agent/edit): removed chunk read:true operation from chunk editing
- Removed `read: true` from chunk edit schema and validation logic, including mixed read/write checks and read-only execution paths.
- Updated chunk edit normalization to treat chunk operations as mutating and removed unused read-result handling.
- Updated prompts and changelog guidance to require `open` for inspection and document that chunk edits use only `write`, `insert`, or `delete`.
2026-04-24 22:40:25 +02:00
can1357 d82377cda8 revert: "read-to-open"
This reverts commit c48d2e6080.
2026-04-24 22:36:44 +02:00
Aidan a5d4a0058e Keep models re-registration override state consistent 2026-04-24 15:48:27 -04:00
can1357 99a21b95ba feat(pi-natives-chunk): enabled row chunk support in pi-natives-chunk
- Added markdown `Row` chunk support by introducing `ChunkKind::Row`, mapping it to tag `"row"`, and emitting row chunks for table rows.
- Updated Go chunk parsing to support method signatures (`func (recv) Name`), prefer method parsing in signatures, and adjust root rules to classify package/import chunks correctly.
- Changed chunk-edit behavior to add read-only `read:true`, replace `write:null` deletes with explicit `delete`, and require one explicit action per entry.
- Added safer chunk-edit execution with region matching, replacement reindentation, table-row append handling, and stricter warnings/errors for boundary and invalid operations.
2026-04-24 21:26:56 +02:00
Aidan f6d067eec5 Simplify runtime provider override application 2026-04-24 15:25:54 -04:00
Aidan bb542022a7 Preserve runtime baseUrl on headers-only overrides 2026-04-24 15:17:28 -04:00
Aidan 5e89736bc9 Keep runtime provider overrides on overlay refresh 2026-04-24 15:13:26 -04:00
Aidan df81f26867 Test refreshProvider runtime override durability 2026-04-24 15:06:27 -04:00
Aidan d74f9a82d1 Persist runtime provider overrides across refresh 2026-04-24 14:59:26 -04:00
can1357 e3ca350f95 fix(coding-agent): added partial JSON path extraction for streamed edit calls
- Added helper utilities in the edit renderer to parse partial JSON fragments and extract the `path` field.
- Used the extracted path as a fallback when resolving the edit target file, enabling partial streamed edit calls to show the path.
- Built and stored the render context before call rendering, and added a test covering partial JSON edit path rendering.
2026-04-24 19:38:38 +02:00
can1357 c48d2e6080 feat(coding-agent): implemented read-to-open tool aliasing in runtime
- Canonicalized file and CLI defaults from `read` to `open` across tool registration and prompts.
- Added `resolveToolAlias()` and applied alias-normalized tool selection so legacy `read` maps to `open`.
- Updated runtime, UI, and export layers to treat `open` as first-class while preserving `read` compatibility.
- Renamed read prompt docs to `open.md`/`open-chunk.md` and refreshed system guidance to recommend `open`.
- Updated tool-related tests and expectations from `read` to `open` (including test fixtures and aliases).
2026-04-24 19:13:11 +02:00
can1357 501106a3c4 fix(coding-agent): fixed local plan URL path separator handling in chunk edits
- Updated `chunkReadPathSeparatorIndex` to detect URL schemes and split at the final selector colon only after the URL path.
- Added tests for `parseChunkEditPath` and `parseChunkReadPath` covering local plan URLs with selectors and scheme-only URLs.
2026-04-24 18:51:32 +02:00
Aidan d12d1577a8 Allow headers-only provider overrides 2026-04-24 11:24:49 -04:00