Commit Graph

5372 Commits

Author SHA1 Message Date
can1357 3909e83137 test(coding-agent): mocked settings init for ascii bar tests
- Stubbed `isSettingsInitialized` to false so crest timing stays deterministic.
- Replaced magic timestamp with named `CLASSIC_CREST_VISIBLE_MS` constant.
2026-06-08 02:55:44 +02:00
can1357 d574968da4 fix(coding-agent/config): hardened settings hooks against callback exceptions
- Replaced manual settings callback sets with a shared `SettingSignal` that snapshots listeners and skips over individual callback failures.
- Updated `provider.appendOnlyContext`, `statusLine.sessionAccent`, and `hindsight` hook dispatch to use the new signal and added a Settings test confirming a throwing append-only listener does not stop other listeners.
- Adjusted the duplicate-tool-results regression test to handle `tool_calls` being absent before mapping IDs.
2026-06-08 02:38:18 +02:00
can1357 00e6e14cb4 feat: added reconstructed raw SSE capture for stream provider SDKs
- Added reconstructed SSE event emission for OpenAI, Azure, and Anthropic streams.
- Added raw SSE text to debug report bundles, including raw-sse.txt output.
- Included dropped-record metadata in raw SSE text when events were trimmed.
- Updated raw SSE and sse-debug tests for observer-based capture and safety checks.
2026-06-08 02:35:14 +02:00
can1357 71624ee47b fix(coding-agent): fixed stale settings and session-accent cache handling
- Cached setting path segments and memoized `Settings.get()` results, clearing caches on updates.
- Triggered session-name and session-accent callbacks only when effective values changed, with error-safe dispatch.
- Memoized status-line and interactive accent resolution with cache invalidation on settings/theme/session changes.
- Added regression tests for keybinding precedence, status-line, settings, and accent cache behavior.
2026-06-08 02:30:44 +02:00
can1357 a3efb62998 feat(coding-agent/modes): added canonical key matching behavior and exported alias utilities
- Built canonical and alias key maps for action/custom handlers and rebuilt them on changes.
- Preserved the first handler when custom key alias collisions occurred during rebuilds.
- Exported canonicalKeyId and addKeyAliases from keybindings for external use.
2026-06-08 02:29:30 +02:00
can1357 5e34d446e7 fix(coding-agent/modes): fixed shimmer sweep timing to use fixed-cell velocity
- Updated classic shimmer to compute band position from elapsed time at 30 cells per second instead of a fixed sweep duration.
- Updated KITT shimmer to use fixed-speed ping-pong motion over the same 2xrange cycle so round-trip timing scales with message length.
2026-06-08 02:27:24 +02:00
can1357 243a806415 fix(coding-agent): fixed reference retries and raw/placeholder handling
- Adjusted `LspTool` to retry only zero/decl-only references with two 250ms waits for project-aware servers.
- Removed raw-mode GitHub repo README API fallback in `read`, so `:raw` now renders the page directly.
- Replaced regex heuristics in `isImagePlaceholderAnswer` with a fixed normalized placeholder set.
2026-06-08 02:07:18 +02:00
can1357 584ea7536d docs(docs): documented eval, read, search, and browser behavior fixes
- Documented `eval` `llm()` default system fallback when none is supplied (#1492).
- Documented Python `read()` positional arguments and `eval` reset-cell coalescing for overlapping cells.
- Documented `read` path handling for `local://`, absolute paths, and `realpath` snapshot-key canonicalization.
- Documented `search`, `find`, `ast_grep`, and `ast_edit` path parsing for bracket paths, URLs, `skip`, and large files.
- Documented `web_search` placeholder filtering for image-like answers and `task` schema-overridden finalize path.
- Documented `browser` `tab.open` viewport reuse, credential redaction, and `lsp` timeout/routing updates.
2026-06-08 02:04:59 +02:00
can1357 68c454c0fc feat(edit/read): enabled canonical snapshot keys across read/write paths
- Canonicalized snapshot key resolution with realpath, parent fallback, and raw fallback.
- Updated snapshot, hashline, read, and write flows to use canonical snapshot keys consistently.
- Fixed converted-content line-range reads to apply selectors via in-memory range/text builders.
- Updated read tool docs to clarify one-line and multi-range selector context bounds.
2026-06-08 02:04:59 +02:00
can1357 088fb7fb75 fix(eval): resolved JS/Python resets by awaiting in-flight operations
- Coalesced concurrent JS and Python reset requests by awaiting in-flight promises instead of throwing.
- Aligned non-reset execution calls to wait for in-progress resets before running on a recreated session.
2026-06-08 02:04:59 +02:00
can1357 49aa6e5839 fix(eval): corrected eval LLM calls and spawn-aware tool descriptions
- Ensured eval LLM calls always include a non-empty system prompt to avoid 400s.
- Aligned eval tool docs with session spawn policy by omitting agent() when spawns are disallowed.
- Added regression coverage for default system prompts and spawn-aware agent() description behavior.
2026-06-08 02:04:59 +02:00
can1357 f73942eb28 fix(eval/py): corrected read() positional offset/limit support and tests
- Updated `packages/coding-agent/src/eval/py/prelude.py` to accept positional `offset` and `limit` in `read()`.
- Added regression coverage in `packages/coding-agent/src/eval/py/__tests__/prelude.test.ts` for positional read signatures.
2026-06-08 02:04:59 +02:00
can1357 8173b7ea8c feat(tools/browser): enabled shared browser tab reuse and extract safety
- Applied `opts.viewport` on reusable tabs in `tab-supervisor.acquireTab` before conditional `tab.goto`.
- Skipped `runInTabWithSnapshot` on tab reuse when no viewport or URL change was requested.
- Changed `tab.extract` to return `Promise<string>` and throw on missing or empty Readability content.
- Redacted `user:pass@` from tab URLs returned in observations to avoid leaking credentials.
- Documented `tab.extract(format)` to return markdown/text and throw when no readable content exists.
2026-06-08 02:04:59 +02:00
can1357 81a7af448e fix(lsp): addressed lsp flakiness via timeout handling and retry behavior
- Updated sendRequest timeout handling to use explicit timeoutMs, then AbortSignal deadlines, else 30s fallback.
- Normalized getServersForFile matching to accept both `.ts` and `ts` for extension routing.
- Expanded references retry logic to handle thin results with progressive backoff before giving up.
- Filtered rename_file fanout to servers matching source/destination extensions only.
- Updated status output to separate configured servers from started clients with readiness labels.
- Added regression tests for timeout ownership, extension filtering, and status readiness reporting.
2026-06-08 02:04:59 +02:00
can1357 ccf49e6c37 feat(tools/fetch): added :raw repo-root README decode with fallback
- Added `:raw` repo-root resolution via GitHub API `/readme` for decoded markdown.
- Preserved fallback to default raw HTML rendering when the README payload was unusable.
- Added regression coverage for successful README decoding and fallback behavior.
2026-06-08 02:04:59 +02:00
can1357 b3af7c29b4 feat(tools/github): added cache purges for mutating gh bash commands
- Added pre-run cache invalidation for mutating gh issue/pr bash commands.
- Implemented bash command token parsing for mutating issue/pr calls and extraction.
- Added cache purging by issue/PR number with optional cross-repo scope.
- Added tests covering mutating, chained, and no-op bash command cache scenarios.
2026-06-08 02:04:59 +02:00
can1357 ee4df538f0 fix(tools): resolved search-path parsing and local sandbox checks
- Set `FindTool` to disable recursive glob traversal so `dir/*` stays shallow.
- Added `parseSearchPathPreferringLiteral` to prefer literal paths like `apps/[id]/page.tsx` when they exist.
- Updated `resolveToolSearchScope` to reject external URLs with a clear `read` usage error.
- Expanded plan-mode sandbox checks to allow absolute paths inside the local artifact root.
2026-06-08 02:04:59 +02:00
can1357 de8851b0c8 fix(tools/search): patched search for skip and oversized archive warnings
- Accepted nullable `skip` in `searchSchema` and treated it as 0 in `SearchTool` pagination logic.
- Added oversized-file detection for explicit search targets to warn when native grep's 4MB cap may hide matches.
- Clarified archive-member error guidance to read `<archive>:<member>` content directly before re-grepping.
2026-06-08 02:04:59 +02:00
can1357 c9b3c23600 feat(task): enabled schema override flow to keep task payloads with warnings
- Propagated `schemaOverridden` from `YieldTool` into executor `YieldItem` metadata.
- Bypassed schema validation on override or schema-builder errors and kept payload output with success exit.
- Emitted `SUBAGENT_WARNING_SCHEMA_OVERRIDDEN` so accepted override results no longer surface as `schema_violation`.
2026-06-08 02:04:59 +02:00
can1357 e44bf8261b fix(web): resolved placeholder-only codex responses by returning citations
- Expanded Codex placeholder detection to match common image-reference phrases and punctuation.
- Raised `codex` provider failure when final and streamed text are placeholders and no sources exist.
- Dropped placeholder prose from returned answers while preserving citation sources.
2026-06-08 02:04:59 +02:00
can1357 16f9c199da ux(coding-agent/task): adjusted running task progress output to animate descriptions
- Reworked running-task rendering so shimmer animation is applied to descriptions instead of IDs.
- Added accent coloring for the separator and description text to keep the status line formatting consistent.
2026-06-08 01:46:03 +02:00
can1357 caa9c69309 feat(coding-agent): added provider-priority model selection and refined fallback ordering
- Added first-party-first provider priority defaults for model ranking.
- Consolidated model resolution to use getModelMatchPreferences from session settings.
- Prioritized providerPriorityRank ahead of usage rank when picking preferred models.
- Added second-pass fallback to default-model or API-key-valid matching order.
2026-06-08 01:32:39 +02:00
can1357 e1840cde00 feat(coding-agent/modes): displayed auto-selected role defaults as [ROLE auto] badges
- Tracked each role assignment with an `autoSelected` flag to distinguish inferred defaults from configured models.
- Resolved unconfigured known roles from `pi/{role}` candidates in `#loadRoleModels` and marked them as auto-selected defaults.
- Added a selector test verifying unconfigured models render `[SMOL auto]` and `[SLOW auto]` badges.
2026-06-08 01:22:36 +02:00
can1357 d930f4c82d feat(packages/ai): added credential origin to provider auth
- Added `getCredentialOrigin` and `getEnvApiKeyName` to classify auth source.
- Surfaced provenance tags in the `/login` and `/logout` provider picker.
- Made the picker search filter match credential origin and env var name.
- Added coverage for credential-origin precedence and env naming.
2026-06-08 01:16:37 +02:00
can1357 403ce587df fix(packages/coding-agent): resolved missing source cwd for local resumes
- Handled local resumes with missing source CWD by prompting to move and reopening sessions.
- Shared missing-CWD relocation logic between local and global resumes for consistency.
- Added regression test for local explicit-session-dir resumes and session-header cwd updates.
2026-06-08 01:09:47 +02:00
can1357 41aa4de9b2 fix(packages/coding-agent): resolved OSC5522 BEL and metadata behavior
- Tracked kitty-dot payload listings to emit BEL-terminated OSC5522 responses.
- Updated non-kitty-dot writes to include mime in metadata and drop ST terminator.
- Adjusted enhanced-paste tests to assert BEL terminator and metadata formatting.
2026-06-08 01:09:47 +02:00
can1357 d3476c6664 chore: fix changelogs 2026-06-08 00:58:40 +02:00
can1357 5be2600b92 fix(coding-agent): normalized relative --cwd flag before downstream use
- Updated startup handling so `applyStartupCwd` now re-syncs `parsed.cwd` to the resolved absolute project directory after `setProjectDir` runs.
- Adjusted the CLI cwd tests to verify a relative `--cwd` argument is normalized to an absolute path and does not double-resolve against the new process cwd.
2026-06-08 00:58:22 +02:00
Can Bölük 77c19d43cf Merge branch 'main' into fix/1492-hashline-bare-body-prefix 2026-06-08 00:58:09 +02:00
can1357 181419b65b fix(coding-agent/modes): fixed Esc interrupt acknowledgement to update loader immediately
- Added an interrupt state in EventController to switch the working label to `Interrupting...` and suspend intent-driven updates until the turn resets.
- Called `notifyInterrupting()` from streaming-interrupt paths in InputController and exposed it on InteractiveModeContext so Esc acknowledgement shows immediately while tools tear down.
- Added tests to verify loader acknowledgement, freeze of late intent updates during interruption, and label updates resuming on the next agent start.
2026-06-08 00:54:54 +02:00
Can Bölük cab7eb920c Merge branch 'main' into fix/parse-cwd-flag 2026-06-08 00:54:38 +02:00
Can Bölük bf4f675298 Merge branch 'main' into fix/session-resume-after-worktree-move 2026-06-08 00:48:29 +02:00
can1357 ba4abb7e2f fix(coding-agent): excluded cwd-less legacy sessions from relocation guard
- Guard now skips sessions with empty cwd, not just undefined.
- Prevents path.resolve("") collision from hijacking a moved session.
2026-06-08 00:47:39 +02:00
can1357 bad1e2acd6 fix: restricted GitHub Copilot auth to COPILOT_GITHUB_TOKEN
- Changed the `github-copilot` service provider to resolve credentials only from `COPILOT_GITHUB_TOKEN`.
- Updated CLI extra help text to document `COPILOT_GITHUB_TOKEN` as the GitHub Copilot environment variable.
- Reworded environment variable docs to reflect the revised Copilot/GitHub token usage and order.
2026-06-08 00:42:23 +02:00
bling cfa9a2d53e fix(coding-agent): resume sessions after a worktree move/rename
When a session's working directory is moved or renamed (e.g. `git worktree
move`), the session file stays under the old cwd-encoded bucket while the new
directory is empty. Resuming was lossy:

- `--continue` rejected the terminal breadcrumb purely on cwd mismatch and then
  found nothing in the new bucket, silently starting a fresh empty session.
- cross-project `--resume <id>` only offered to *fork* (duplicate) the session
  into the new directory, forcing manual id selection and leaving a stale copy.

Detect relocation via the strong, low-false-positive signal "recorded cwd no
longer exists on disk" and re-root in place with the existing `moveTo()`:

- `continueRecent` re-roots the terminal's last session into the current
  directory when its recorded cwd is gone and the new location has no sessions
  of its own (otherwise behavior is unchanged). `readTerminalBreadcrumb` is
  refactored into `readTerminalBreadcrumbEntry` returning the raw cwd +
  session file so callers can interpret a cwd mismatch.
- cross-project `--resume <id>` offers "Move (re-root)" instead of fork when the
  source directory is gone; a still-existing different project still forks.

Tests: continue-relocation (re-root on move, no-hijack on plain cd, prefer
local recent) and cross-project move-vs-fork routing.
2026-06-07 18:34:51 -04:00
can1357 72be2a54e7 Merge remote-tracking branch 'origin/farm/1f3e0007/fix-ctrl-z-suspend' 2026-06-08 00:30:27 +02:00
can1357 4a0eba8092 Merge remote-tracking branch 'origin/farm/8b6c0673/fix-follow-up-goal-command' 2026-06-08 00:29:53 +02:00
can1357 248f14cc3b Merge remote-tracking branch 'origin/farm/e318626d/retry-generic-upstream-error' 2026-06-08 00:29:12 +02:00
can1357 ae420d49f0 Merge remote-tracking branch 'origin/farm/915457a5/fix-kitty-osc-5522-mime-listing' 2026-06-08 00:28:41 +02:00
Can Bölük 84ddda3c1b Merge pull request #2060 from Null3rror/fix/mcp-tool-approval-tier
fix(mcp): declare approval tier for MCP tools to prevent hangs in non-yolo mode
2026-06-08 00:26:25 +02:00
Can Bölük 0aa22b7120 Merge pull request #1947 from DarkPhilosophy/fix/empty-stop-guard-tooluse
fix(coding-agent): retry orphaned toolUse stops to prevent history corruption
2026-06-08 00:20:54 +02:00
Can Bölük e9e2d02223 Merge pull request #1982 from AsafMah/fix/js-eval-worker-init-flake
fix(eval): floor JS worker init timeout to stop terminate-mid-init CI flake
2026-06-08 00:19:33 +02:00
roboomp 0f243f4505 style: bun run fix 2026-06-07 21:07:48 +00:00
roboomp dd8b50649a fix(coding-agent): suppressed reviewer findings injection when schema rejects it
`finalizeSubprocessOutput` always spliced collected `report_finding`
entries onto a top-level `findings` array regardless of the active output
schema. A caller-supplied schema with `additionalProperties: false` and
no `findings` property would accept the raw payload in-tool (via the
`yield` validator, which only sees the pre-injection data) but then fail
post-mortem validation — emitting `schema_violation: findings: must not
be present` and propagating as a fatal `RuntimeError` through
`agent-bridge.ts` and the eval Python/JS preludes, collapsing the entire
workflow cell along with any prior successful subagent work.

`normalizeCompleteData` now takes the resolved validator and only
performs the injection when the augmented candidate validates. When the
schema rejects it, the raw payload is returned instead — which the in-
tool yield validator already accepted, so the lockstep guarantee
documented at the top of `output-schema-validator.ts` is honored.
Findings remain visible via the agent progress stream and JSONL
artifact, so no information is dropped when injection is suppressed.

Both finalize call paths (yield-success and no-yield fallback) now share
the single validator build instead of constructing it twice, and the
yield-path schema_violation branch is now reached only via the
explicit malformed-schema check, never via spurious findings rejection.

Fixes #2070
2026-06-07 21:07:43 +00:00
DarkPhilosophy 60dde9d33f fix(coding-agent): isolate startup cwd helper 2026-06-07 21:12:41 +03:00
DarkPhilosophy 5f7db97560 fix(coding-agent): apply cwd before startup discovery 2026-06-07 21:06:02 +03:00
DarkPhilosophy a58f0bcbeb fix(coding-agent): parse launch cwd flag 2026-06-07 20:57:14 +03:00
Guts 72e11ca5e9 fix(sdk): bind dynamic approval callbacks to original tool instance 2026-06-07 16:58:25 +02:00
Guts e796a7db4d test(approval): add regression tests for MCP tool approval tier 2026-06-07 16:42:19 +02:00
Guts 83c8105be6 fix(mcp): declare approval tier for MCP tools to prevent hangs in non-yolo mode
MCPTool and DeferredMCPTool now declare approval = 'write' instead of
implicitly defaulting to 'exec'. Without this, the approval system
requires user confirmation for every MCP tool call in non-yolo modes,
but the confirmation prompt never renders in the TUI while streaming,
causing the agent to hang indefinitely.

Also propagate the approval property through customToolToDefinition()
in sdk.ts, which was silently dropping it during CustomTool ->
ToolDefinition conversion.
2026-06-07 16:22:33 +02:00