Commit Graph

850 Commits

Author SHA1 Message Date
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
fengjun 0d4936b98f fix: avoid base64 eval wrappers in bash snapshots 2026-04-24 18:44:17 +08:00
can1357 21d50d5703 feat(coding-agent): added mode-aware streaming preview for edit outputs
- Added mode-aware streaming mode resolution and strategy registration in tool execution flow.
- Changed edit rendering to propagate mode and file-scoped diff previews across edit/vim tool outputs.
- Added chunk-mode streaming helpers (`loadChunkSource`, `computeChunkDiff`, `dropIncompleteLastEdit`) with abort-aware error fallbacks.
- Added strategy-specific streaming preview support for replace, patch, hashline, apply_patch, and vim modes.
- Fixed streaming previews by dropping incomplete trailing edits and handling invalid chunk or aborted inputs.
- Expanded streaming and chunk-diff tests for partial JSON, open edits, empty paths, abort signals, and file loading checks.
2026-04-24 08:24:30 +02:00
Can Bölük 8a3b7ff1a5 Merge pull request #728 from azais-corentin/feat/726-opus-4.7-support
feat(ai): support Claude Opus 4.7
2026-04-24 07:35:17 +02:00
makoMakoGo 311608eff3 fix(coding-agent/codex-search): force web_search tool_choice and add citation fallback
When the Codex Responses API synthesizes an answer without emitting
url_citation annotations, previously-empty sources made cited results
look ungrounded. Add:

- tool_choice: { type: "web_search" } so Codex must call the tool
- markdown-link + bare-URL extraction from the answer as a fallback
  that only runs when no structured citations were returned

The model-resolution path is unchanged; getBundledModels already
returns a usable Codex catalog on main.

Closes #724
2026-04-24 07:34:15 +02:00
Corentin AZAIS cc33fe5366 test(ai): add Opus 4.7 catalog and alignment coverage
- Register claude-opus-4-7 model entry in models.json
- Cover adaptive thinking/sampling payload shape in anthropic-alignment test
- Assert Opus 4.7 surfaces in ModelRegistry available models
2026-04-24 07:29:48 +02:00
JunghwanNA 0d6968f7a6 Keep sqlite where filters inside the paginated helper
The SQLite read helper is documented as a structured selector path
with explicit pagination, while raw SQL already has a separate
q=SELECT escape hatch. This change rejects SQL control syntax outside
quoted strings so helper filters cannot override LIMIT/OFFSET, while
still allowing semicolons inside quoted literals such as LIKE '%;%'.

Constraint: Preserve the documented q=SELECT raw SQL path unchanged
Rejected: Replace where= with a new filter DSL | too broad for a regression fix
Confidence: high
Scope-risk: narrow
Directive: Keep table?where=... as a structured helper; if broader SQL is needed, route it through q=SELECT instead
Tested: bun --cwd=packages/natives run build; bun --cwd=packages/coding-agent run check; bun --cwd=packages/coding-agent test test/tools/sqlite.test.ts
Not-tested: Manual interactive omp read invocation against a live SQLite file
2026-04-24 07:25:09 +02:00
can1357 f5e69ea37f chore: reformat 2026-04-24 07:18:17 +02:00
Can Bölük daa3f6237d Merge pull request #715 from willzhqiang/fix/hashline-anchor-corruption
fix(coding-agent): handle truncation markers and nested anchors in hashline stripping
2026-04-24 07:11:39 +02:00
Vu Anh Nguyen 12c666f4c0 Fix mermaid markdown test expectations 2026-04-24 06:47:56 +02:00
Vu Anh Nguyen a7845b3b86 Fix mermaid assistant test settings init 2026-04-24 06:47:56 +02:00
Vu Anh Nguyen 81fd90ecc0 Fix Mermaid markdown rendering on non-image terminals 2026-04-24 06:47:56 +02:00
can1357 6cfca06d8e fix(edit): mark stale-hash rejections as 'Edit rejected' instead of an info-shaped message
The previous mismatch text ('1 line has changed since last read. Use
the updated LINE#ID references shown below.') reads like a successful
edit followed by an informational note. Providers whose tool-result
plumbing does not surface `isError: true` to the model (e.g. Qwen via
the OpenAI-completions shim, where mitmproxy traces show the model only
receives the content text) treat the response as a success and proceed
with stale state.

Reword the message to start with 'Edit rejected:' and explicitly state
'The edit was NOT applied' so the failure is unambiguous in plaintext.
The structural payload (>>> markers, updated LINE#IDs) is unchanged.

Fixes #742
2026-04-24 06:33:20 +02:00
can1357 7f81179b40 feat(config): add commands.enableOpencode{User,Project} settings
Mirror the existing `commands.enableClaudeUser`/`commands.enableClaudeProject`
schema entries so the OpenCode discovery provider exposes the same
user/project toggle surface as Claude. Default remains true to preserve
current behavior.

Fixes #661
2026-04-24 06:33:20 +02:00
can1357 cafa86a6cf fix(tools/sqlite): reject comments, terminators, and pagination keywords in where=
The structured SQLite helper interpolates `where=` directly into SQL.
A crafted clause like `where=1=1 LIMIT 1000000 --` could comment out
the helper's bound `LIMIT ? OFFSET ?`, returning the full table in
violation of the documented pagination contract.

Validate where= at the selector boundary and reject SQL comments,
statement terminators, and pagination/attach/pragma keywords. Raw SQL
remains available via ?q=SELECT... for callers that need it.

Fixes #735
2026-04-24 06:33:20 +02:00
Can Bölük 84f6dc30f1 Merge pull request #740 from kagura-agent/fix/tools-equals-syntax
fix(cli): support --flag=value equals syntax for all CLI flags
2026-04-24 06:11:50 +02:00
can1357 661449df09 test(coding-agent/core): removed stale chunk-tree test suite from core
- Removed stale test suite file `packages/coding-agent/test/core/chunk-tree.test.ts`.
2026-04-24 05:54:10 +02:00
can1357 cb134f6446 refactor(find): consolidate path relativization and drop gitignore fallback
Extracts a single `formatMatchPath` helper used by both the
fast-glob/native code paths and the streaming onMatch callback so
relative paths, trailing-slash handling, and directory markers are
produced consistently. Also drops the retry-without-gitignore fallback
when the gitignored pass returns zero matches, so a broad hidden-file
pattern that is fully ignored stays fully ignored instead of silently
flipping gitignore off on the second attempt.
2026-04-24 05:49:16 +02:00
can1357 c5666e153f feat(grep): route comma-separated explicit files to exact-file grep
resolveMultiSearchPath now reports `exactFilePaths` when every token
resolves to a plain file (no globs, no suffix glob) and accepts a
single resolvable token so partially-missing lists still search the
resolvable subset. grep iterates those exact files individually
instead of collapsing them into a brace-union glob, which preserves
the user's explicit file set even when siblings share a basename.

Also adds a small `[grep] match lines use ':'; context lines use '-'`
banner when context lines are rendered, and splits the per-file
rendering helpers so files with no remaining matches no longer emit
empty headers.
2026-04-24 05:49:10 +02:00
can1357 e51f0b5321 fix(ast-edit): detect stale previews on apply
Apply now recomputes per-file replacement counts from the actual apply
pass and compares them against the preview. If totals or per-file
counts drift (file changed between preview and apply, or apply matched
nothing), the tool returns an isError result explaining that the
preview is stale instead of silently claiming success with mismatched
numbers.
2026-04-24 05:49:02 +02:00
can1357 3add2b8a3a feat(bash): surface timeout-clamp notice in tool output
When a bash tool call requests a timeout outside the allowed 1-3600s
range, the effective clamped value and the originally requested value
are now emitted as a notice appended to the tool output and exposed on
BashToolDetails via requestedTimeoutSeconds. The renderer shows the
clamped+requested pair inline in the timeout badge.
2026-04-24 05:48:46 +02:00
can1357 6b976f6eeb fix(coding-agent/lsp): serialized LSP writes and retried references after project load
- Queued outbound JSON-RPC messages behind a per-client promise queue to serialize writes.
- Added a project-load gate for project-aware LSP operations before diagnostics and reference lookups.
- Retried declaration-only references with a short delay until project metadata is available, then proceeded with normal results.
2026-04-24 05:08:11 +02:00
can1357 1a3a3830b3 fix(coding-agent): validated bare-path chunk deletes in chunk mode
- Relaxed chunk-mode parameter validation to accept `{path}`-only edits as valid delete operations.
- Updated the invalid-parameters help text to document accepted chunk delete payloads.
- Added a test that verifies a bare `{path}` edit removes the targeted chunk when null values are stripped.
2026-04-24 04:35:59 +02:00
can1357 a9ca2daaed fix(coding-agent): fail structured subagents without submit_result
Fixes #729
2026-04-24 01:02:18 +02:00
can1357 6b8b46c410 fix(coding-agent/edit): fixed apply_patch streaming preview parsing behavior
- Added a streaming parser path for apply_patch envelopes that tolerates incomplete patch bodies.
- Updated apply patch preview expansion to return best-effort hunks when the renderer is in partial mode.
- Added a renderer test confirming streaming apply_patch input shows file paths without end-marker parse errors.
2026-04-24 00:48:03 +02:00