Commit Graph

4212 Commits

Author SHA1 Message Date
Ogrodev 25aae9961b Merge remote-tracking branch 'upstream/main' into feat/profiles-and-alias
# Conflicts:
#	packages/coding-agent/src/cli/args.ts
#	packages/coding-agent/src/commands/launch.ts
2026-06-07 20:42:45 -03: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
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 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
roboomp 29730eb643 fix(tui): handle kitty osc 5522 dot-listing paste responses
Kitty implements OSC 5522 paste-event listings by sending one DATA
packet whose mime field decodes to the literal dot sentinel and whose
payload carries the available types as a whitespace-separated list. The
TUI previously only honored the ancillary per-type DATA-packet form, so
plain-text Kitty pastes were rejected as unsupported.

Decode the dot-listing payload during the listing phase and keep the
per-type packet path as a fallback. Also emit the follow-up OSC 5522 read
request using the Kitty protocol shape: the selected MIME list belongs in
the request payload, not in mime metadata. Sending it as metadata makes
Kitty parse an empty requested MIME list and returns no clipboard bytes,
which surfaces as an empty paste.

Add regression coverage for Kitty's text-only and multi-type listings,
and assert the payload-form read requests for default and primary
selection paste events.

Fixes #2051
2026-06-07 13:14:38 +00:00
Ogrodev cbec961010 Merge remote-tracking branch 'upstream/main' into feat/profiles-and-alias 2026-06-07 09:49:50 -03:00
roboomp 56240e527d fix(agent): retried generic upstream gateway failures
Classified generic upstream gateway failures as transient so configured session auto-retry starts when auth-gateway surfaces upstream_error: Upstream request failed. Added a focused AgentSession regression covering the retry event and recovery path.\n\nFixes #2056
2026-06-07 12:36:58 +00:00
roboomp 43477234e2 fix(tui): handle kitty osc 5522 dot-listing paste responses
Kitty implements the OSC 5522 "list available MIME types" reply by
sending one DATA packet whose `mime` field decodes to the literal `.`
and whose payload carries the available types as a whitespace-separated
list (see `fulfill_read_request` in kovidgoyal/kitty:kitty/clipboard.py
when the requested MIME is `TARGETS_MIME = '.'`). The 5522-mode
ancillary spec (rockorager.dev/misc/bracketed-paste-mime) instead
encodes each available type as its own DATA packet with an empty
payload.

The TUI's EnhancedPasteController only honored the ancillary form. When
Kitty delivered the dot-listing form for a plain-text paste, the parser
pushed `.` into the candidate list, `choosePasteMime(["."])` matched
nothing, and the editor surfaced "Clipboard paste has no supported text
or image data" instead of inserting the text.

Decode the payload as a UTF-8 whitespace-separated MIME list when the
DATA packet's mime is the dot sentinel, then fall through to the
existing per-type behavior. Add two regression tests covering the
single-type and multi-type Kitty payload shapes.

Fixes #2051
2026-06-07 12:10:52 +00:00
DarkPhilosophy be71d53842 fix(coding-agent): optimize orphaned tool-use stop guard 2026-06-07 15:08:47 +03:00
DarkPhilosophy 4e675f4c5f Merge remote-tracking branch 'can1357/main' into fix/empty-stop-guard-tooluse 2026-06-07 15:04:44 +03:00
roboomp f31b060e15 fix(tui): applied follow-up slash commands
Route follow-up shortcut submissions through the builtin slash-command dispatcher before queueing them as deferred prompts.

Added regression coverage for /goal set submitted through InputController.handleFollowUp while a stream is active.

Fixes #2038
2026-06-07 09:24:20 +00:00
roboomp df5abffe24 fix(coding-agent): guard ctrl+z handler against missing SIGTSTP
handleCtrlZ called process.kill(0, "SIGTSTP") unconditionally; on
Windows the runtime rejects the signal name with TypeError, which
propagated out of the TUI input dispatcher and crashed the agent
with an [Uncaught Exception]. Even on POSIX the call could fail
(sandboxes that block sending to pid=0, runtime-reserved signals),
and a thrown error after we already stopped the TUI and registered
a one-shot SIGCONT listener left the UI stranded with a leaked
handler that would fire on the next unrelated continue and try to
re-start() an already-running TUI.

Branch on process.platform first so Windows shows a status notice
and never calls process.kill, and wrap the POSIX kill in try/catch
that removes the SIGCONT listener and re-starts the TUI on failure.

Fixes #2036
2026-06-07 09:13:37 +00:00
can1357 5c60772f38 ux(coding-agent/tools): folded raw output artifact notices into the bash status footer
- Added a `showHeader` option to shell rendering and suppressed the bash frame title bar by default.
- Parsed trailing raw-output artifact notices and folded their IDs into status footer metadata instead of command output.
2026-06-07 09:12:12 +02:00
can1357 3c1a31062c ux(coding-agent): refined tool renderers with padded status headers
- Updated read-group rendering to use the enabled success mark and omitted duplicate success marks on child files in grouped reads.
- Adjusted find and search renderers to apply tool-title coloring, search icons, and padded layout via createCachedComponent.
- Added tests covering read-group success marking and padded find/search renderer output.
2026-06-07 09:03:09 +02:00
can1357 b65851d504 feat(coding-agent): enabled smooth streaming reveal mode with 30 FPS and new setting
- Added `display.smoothStreaming` to settings schema.
- Updated streaming-reveal behavior to produce smooth 30 FPS reveals.
- Updated event-controller flow to support smooth streaming reveal mode.
- Expanded streaming-reveal tests for the new smooth streaming behavior.
2026-06-07 08:53:20 +02:00
can1357 1b2373425b feat(packages/coding-agent): set 30fps stream and stabilized read groups
- Reduced shimmer-driven UI animations and borders to a 30fps cadence.
- Collapsed consecutive read tool calls into one finalized transcript block.
- Tracked visible assistant content to finalize and reset read groups correctly.
- Updated running task rows to static bullet markers with shimmer-only subagent labels.
2026-06-07 08:42:51 +02:00
can1357 20487d8cb6 chore: fix stale tests 2026-06-07 08:11:38 +02:00
can1357 0914379f49 fix(coding-agent): rendered shared task context as markdown and froze async block borders
- Updated task call and result rendering to process shared context with the Markdown renderer, so context sections are now displayed with proper Markdown formatting.
- Stopped shimmer animation on pending bash/eval/task blocks once async state is `running`, preventing the committed frame from freezing a transient dark border segment.
- Adjusted rule path display to fall back to a root-relative path when cwd-relative resolution is unavailable.
2026-06-07 08:01:52 +02:00
can1357 76af35dcd6 fix(tui): preserved TUI initial scrollback unless clear was requested
- Updated the initial render intent to carry a `clearScrollback` flag.
- Adjusted first-frame rendering logic to preserve existing scrollback by default and clear only when requested.
- Added `resolver` stubs to coding-agent and web-search test registries for interface compatibility.
2026-06-07 07:54:50 +02:00
can1357 becc44ccef fix(tui): fixed startup scrollback clearing and ED3 streaming replay duplication
- Added a clear-initial-terminal-history flag to interactive mode initialization and passed it from cold-launch startup.
- Extended TUI.start to accept clearScrollback and clear native scrollback on initial full paint for non-multiplexer sessions.
- Preserved ED3 streaming scrollback accounting during capped streaming frames and added tests to prevent committed prefix duplication across terminal history rewrites.
2026-06-07 07:42:51 +02:00
can1357 13ca95382d fix(coding-agent): recolored search tool icons to accent
- Switched find, search, ast_grep, and bm25 magnifier glyphs from success green to accent so the icon matches the tool title color.
2026-06-07 07:23:50 +02:00
can1357 1a9d898b8a feat(coding-agent): added immediate steering flush on empty streaming submit
- Updated InputController streaming submit handling to interrupt and resume when queued steering exists, refreshing the pending-message UI and render.
- Added AgentSession.interruptAndFlushQueuedMessages to abort active work and continue processing queued messages immediately.
- Added tests for queued steering interruption in both agent-session concurrency and input-controller keybinding flows.
2026-06-07 07:18:02 +02:00
can1357 0f043d4c29 fix(coding-agent): preserved approved plan paths during plan apply resolution
- Replaced approved-plan renaming with `resolveApprovedPlan` resolution and state/slug lookup.
- Updated ACP and interactive apply flows to propagate canonical `planFilePath` instead of renamed paths.
- Added local plan fallback lookup by mtime for unresolved slugs after plan approval.
- Restricted plan-mode writes to `local://` plan artifacts and simplified path handling.
2026-06-07 07:17:23 +02:00
can1357 ddd8c86209 ux(coding-agent): added separator support for unlabeled output sections
- Extended `OutputBlock` section metadata with an optional `separator` flag and included it in cache hashing.
- Updated output block rendering to emit an unlabeled section divider when the separator flag is enabled.
- Marked task and result render paths to request separators for non-context content sections to improve output clarity.
2026-06-07 07:08:06 +02:00
can1357 9d245eea60 fix(coding-agent): adjusted edit output padding to remove inherited left gutter space
- Added a configurable `contentPaddingLeft` option to `renderOutputBlock` with normalized defaults.
- Updated edit renderer output blocks to disable inherited left padding and align inner-width wrapping.
- Added coverage for completed edit gutter rendering to confirm no leading space and correct frame width.
2026-06-07 06:59:01 +02:00
can1357 793251fa2e fix(coding-agent): labeled TTSR-aborted tool placeholders with matched rule names
- Passed a formatted TTSR match message into the agent abort call when streaming is interrupted by TTSR rules.
- Added a `#formatTtsrAbortReason` helper to include matched rule names in the abort reason.
- Added a concurrent-session test confirming aborted tool results mention the matched TTSR rule instead of `Request was aborted`.
2026-06-07 06:56:16 +02:00
can1357 cbd7c20105 feat(coding-agent/tools): added binary routing for notebook, sqlite, and archive payloads
- Added archive format sniffing to identify ZIP, TAR, and TAR.GZ from file bytes.
- Added MIME/extension and header-based routing for notebook, sqlite, and archive payloads.
- Added archive entry rendering with slash-terminated dirs and size suffixes.
- Added tests for archive, sqlite, notebook, and fallback binary dispatch scenarios.
2026-06-07 06:55:52 +02:00
can1357 9bd9e3127e feat(coding-agent): added /tan background forking with prompt cache inheritance
- Added `/tan` slash command registration and interactive handling.
- Added TanCommandController validation and async task scheduling for `/tan` dispatch.
- Added session cloning that suppresses breadcrumbs, copies artifacts, and handles abort cleanup.
- Added `promptCacheKey` support in Agent and inherited `providerPromptCacheKey` in session creation.
2026-06-07 06:52:15 +02:00
can1357 a01d9c3655 feat(coding-agent/tools): collapsed untouched todo phases to one-line summaries
- Collapsed non-touched phases to one-line summaries in multi-phase todo renders while retaining full output for active, touched, or expanded views.
- Computed touched phases from in-progress tasks, completion transitions, and tool operations, with init operations now marking all phases.
- Added renderer tests covering collapsed rendering, argument-less fallback behavior, expanded mode, and separator-free phase output.
2026-06-07 06:44:11 +02:00
can1357 6adf98fd10 feat(coding-agent): added OSC5522 enhanced paste support for local image and text inserts
- Added OSC5522 parsing and a payload controller that prefers image MIME and reassembles chunks.
- Added bracketed image-path detection and `onPasteImagePath` callback wiring in the editor.
- Added local image-path paste insertion with fallback to text paste on image-size errors.
- Added `Editor.pasteText()` and OSC5522 disable sequencing on terminal cleanup.
2026-06-07 06:43:52 +02:00
can1357 f88cf724f3 refactor(coding-agent/tools): restructured todo task list rendering via shared tree helper
- Replaced the inline todo-phase preview loop in todoToolRenderer with renderTreeList.
- Kept task output generation delegated through formatTodoLine while passing expanded state and preview limits to the shared helper.
2026-06-07 06:29:41 +02:00
can1357 a78f4c6766 feat(coding-agent): enabled abort reasons to propagate and surface through streaming messages
- Added optional `reason` parameters to `Agent.abort` and `AgentSession.abort` APIs.
- Passed abort reasons through interrupt flows into underlying agent cancellation.
- Replaced hard-coded abort text with `resolveAbortLabel` for streaming and replayed messages.
- Fell back to generic `Request was aborted` text when no abort reason was provided.
2026-06-07 06:19:55 +02:00