Commit Graph

5310 Commits

Author SHA1 Message Date
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
can1357 84573a0d1a chore: bump version to 15.10.1 2026-06-07 09:18:25 +02: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 f3257c3cf1 test(packages/coding-agent): added tests for read grouping task shimmer
- Added regression coverage for EventController to collapse single-read completions into one read group.
- Added assertions that visible reasoning breaks grouping and finalizes the prior read block.
- Added nested-live task rendering test for static task header while the task body shimmers.
- Added task-progress rendering tests for shimmered task-name rows and spinner-disabled fallback.
- Added a ToolExecutionComponent timing test validating bash spinnerFrame increments on 30fps cadence.
2026-06-07 08:42:51 +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 4a3984eb0a fix(coding-agent/tools): fixed Markdown cache contamination from mutable render arrays
- Marked Markdown cached lines as readonly snapshots and returned copied arrays from `render()`.
- Stored fresh snapshot arrays in both L1 and L2 caches so callers appending rows cannot mutate shared cached Markdown output.
- Added an AskTool test that renders calls and results twice to verify repeated renders remain stable and do not duplicate option labels.
2026-06-07 07:33:43 +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 5ff5d966ba test(coding-agent/session): added tests for SessionManager fork behavior and controller fixtures
- Added a new SessionManager.forkFrom test confirming terminal breadcrumb suppression while cloning source session history under a new parent session.
- Updated TanCommandController test fixtures with required assistant message API, provider, model, and completion metadata.
2026-06-07 06:56:09 +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 705c937c56 fix(tui): fixed visibleWidth parity and OSC66 width metadata behavior
- Fixed `visibleWidth` parity with native width using `Bun.stringWidth` ANSI stripping.
- Fixed tab and OSC66 width parsing with `s=`/`w=` metadata handling.
- Added ASCII and long-string fast paths in `visibleWidth` for faster width checks.
- Consolidated visible-width regression coverage by replacing removed IME/Arabic/Jamo tests with `visible-width.test.ts`.
2026-06-07 06:24:07 +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
can1357 136106ba4f fix(coding-agent): kept task context visible after first progress snapshot
- Rendered shared `# Goal`/`# Constraints` brief in result frame via buildContextSection helper.
- Undid per-field double-encoding so brief reads cleanly from raw result args.
- Removed header spinner since per-agent body lines already animate.
- Wrapped run summary in bracket glyphs to match bash tool footer.
2026-06-07 06:07:17 +02:00
can1357 6e554d8ab8 ux(coding-agent): refined tool-execution block framing and state background
- Adjusted tool-execution rendering to apply state-based background tinting and spacing for non-framed outputs.
- Detected framed block children and skipped extra padding and tinting so those custom renderers stay flush.
- Wrapped framed output with markFramedBlockComponent so self-framed blocks are recognized by the renderer.
2026-06-07 05:53:00 +02:00
can1357 741558a6d4 feat(coding-agent): removed background mode command and runtime plumbing
- Removed the built-in `background` (`bg`) slash command and its `handleBackgroundCommand` path from the interactive flow.
- Deleted background event subscription and shutdown handling by removing `handleBackgroundEvent` from the event, input, and interactive controllers.
- Simplified `InteractiveModeContext` by dropping background-only fields and helpers such as `isBackgrounded`, background UI context creation, and background event callbacks.
2026-06-07 05:43:59 +02:00
can1357 52f7defeab fix(coding-agent-tools): fixed OSC8 links to use resolved file paths from session context
- Fixed edit/read/search/ast-edit/ast-grep outputs to resolve OSC8 links from session cwd.
- Fixed grouped-file output classification to honor headerBase and fileScope for parent path resolution.
- Fixed read and write renderers to use resolved source/resolved paths as hyperlink targets.
2026-06-07 05:37:10 +02:00
can1357 c8f920e744 Merge remote-tracking branch 'origin/farm/3af0cd45/fix-dlv-launch-directory-mode' 2026-06-07 05:14:22 +02:00
can1357 8c62c77e00 refactor(packages/coding-agent): restructured tool and execution rendering
- Unified edit, ask, ast-edit, todo, write, and inspect outputs using framedBlock.
- Wrapped failure and warning cases in framed blocks with clearer status states.
- Standardized frame body rendering by trimming blank lines and clipping content width.
- Simplified tool execution layout by removing dynamic padding and background helpers.
2026-06-07 05:13:58 +02:00
can1357 eedf9bc6a8 feat(search-tooling): added search-tool icon lists with framed output
- Added `icon.search` to theme symbol maps and used it for Search, Find, AST Grep, and BM25 success headers.
- Reworked `searchToolBm25Renderer` results into framed bullet lists with expand-item hints.
- Updated renderer tests to match the new search-tool output contract.
2026-06-07 05:13:58 +02:00
can1357 28c3e2a986 feat(task-rendering): added unified call/result task rendering
- Enabled call/result merging by setting mergeCallAndResult on TaskTool.
- Reworked task item lines into bullet lists and removed tree-style prefixes.
- Rendered task calls as framed blocks with isolated headers and pending status metadata.
- Changed result previews to hide task titles and `Tasks` headings when a result is present.
2026-06-07 05:13:58 +02:00
can1357 1ebe2c7484 feat(packages/tui-and-shared-tooling-primitives): added TUI terminal support
- Made `Component.invalidate` optional in `packages/tui/src/tui.ts` and callsites.
- Added `iconOverride` support to status-line rendering in `status-line.ts`.
- Added `borderColor` and `framedBlock()` primitives in `output-block.ts` for framed output styling.
- Adjusted `renderOutputBlock()` to draw a continuous border when no header text is present.
- Added terminal checkpoint-reconciliation tests in `submit-checkpoint-reconcile.test.ts` for pinned-tail behavior.
2026-06-07 05:13:58 +02:00
can1357 d18cc3c717 test(tests): extended auth-retry and read-link tests for updated checks
- Added a read-link probe test that renders text and image paths with active hyperlinks.
- Updated ai auth retry tests for revised static-key validation and rotation behavior.
2026-06-07 05:13:58 +02:00
roboomp d710b91d96 test(debug): hoist dap module import to top of test file
The repo bans inline imports. Replace per-test `await import("../../src/dap")`
calls with a single top-level `import * as dapModule from "../../src/dap"`
and reuse the namespace for every spy in this file.

Fixes #2020
2026-06-07 03:05:20 +00:00
roboomp 8c25f7d4aa fix(debug): prefer dlv for go directory launches
Prefer directory-capable adapters when selecting a launch adapter for a
resolved directory program. This keeps Go package directories on dlv in
mixed projects that also expose native-debugger root markers such as a
Makefile, instead of selecting gdb/lldb-dap first and rejecting the
directory during validation.

Added a regression test covering a Go module with both go.mod and
Makefile plus local dlv/gdb adapter shims.

Fixes #2020
2026-06-07 03:03:57 +00:00
roboomp 1745529368 fix(debug): accept directory programs for dlv and auto-select dlv mode
The debug tool ran validateLaunchProgram before adapter selection and
rejected any directory program with `launch program resolves to a
directory`, while dlv's default `mode=debug` requires a Go package
path (a directory or .go source file). Every Go-module launch failed:
passing the module dir was rejected outright, and passing the compiled
binary failed at dlv with `not a valid go module`.

- Add `acceptsDirectoryProgram` to DapAdapterConfig/DapResolvedAdapter
  and flag dlv in dap/defaults.json.
- In DebugTool.execute(launch), resolve the adapter first, then call
  validateLaunchProgram with the resolved adapter — the directory
  rejection only fires when the adapter does not advertise the flag.
- Add resolveLaunchOverrides in dap/config.ts: for dlv, derive `mode`
  from the program shape (directory or .go file → debug; other file
  → exec). Plumbed through DapLaunchSessionOptions.extraLaunchArguments
  and spread between adapter.launchDefaults and the hard-coded launch
  fields in session.ts.
- Refresh tests: cover the no-dir-support adapter rejection, dlv on a
  package directory keeping mode=debug, and dlv on a binary switching
  to mode=exec.

Fixes #2020
2026-06-07 02:59:02 +00:00
can1357 9a8bf1c81c feat(coding-agent): added mouse interactions and preserved deleted headings in plan reviews
- Added SGR mouse input handling for wheel and click actions, mapped to option, ToC, and body targets.
- Added deleted-heading state to undo snapshots so removed titles persist and restore correctly.
- Updated the plan-mode active prompt to require decision-complete, implementation-ready plans.
- Enabled mouse tracking for fullscreen overlays and asserted mouse-on/off sequences in tests.
2026-06-07 04:53:59 +02:00
can1357 c10eb5e50e feat(coding-agent): added resolver-based auth retries to image and search tools
- Routed image-gen, inspect-image, and web search providers through `withAuth`.
- Used `reuseInitialApiKey`/`createAuthStorageResolver` for force-refresh and rotate retries.
- Attached HTTP status to thrown errors so the retry classifier detects retryable failures.
2026-06-07 04:49:19 +02:00
can1357 fceff5e6b6 feat(coding-agent): overhauled plan-review overlay with TOC sidebar
- Added section-based plan parsing with per-section delete, undo, and annotate.
- Added Tab/Shift+Tab focus regions and per-line scroll navigation.
- Added Refine feedback loop emitting annotations back to the model.
- Added `OverlayOptions.fullscreen` borrowing the terminal's alt screen buffer.
2026-06-07 04:32:52 +02:00
can1357 cba6641299 feat: enabled resolver-based API key retries with refresh and rotation
- Added `ApiKeyResolver`/`ApiKey` types and exported auth-retry helpers.
- Changed stream and gateway auth retry handling to use resolver steps.
- Added initial-key, force-refresh, and rotate credential retries for auth failures.
- Updated agent and coding-agent integrations to use context-aware API-key resolvers.
2026-06-07 04:20:48 +02:00
can1357 003f89b7c4 fix: fixed UTF-8 command slicing in shell fixups
- Converted brush-parser source positions to byte offsets before slicing commands in `try_strip_head_tail` and `try_strip_2to1`, preventing multibyte UTF-8 from misplacing fixup deletions.
- Added regression tests covering trailing `head`/`tail` and `2>&1` strips with Unicode content, and verified rewritten commands re-parse successfully.
2026-06-07 03:49:15 +02:00
can1357 f1e2e51a4b feat(coding-agent): added /fresh to reset provider state while keeping session files
- Added `AgentSession.freshSession()` to rotate provider-facing IDs and prune provider stream state.
- Added `/fresh` command handling in the builtin registry and mode command flow.
- Kept persisted session metadata intact during `/fresh` and cleared transient IDs on session switches.
- Invalidated `appendOnlyContext` and provider caches when refreshing provider state.
2026-06-07 03:37:48 +02:00
can1357 99e91138a4 feat(coding-agent): enabled component-based chat rendering with managed block lifecycles
- Added ChatBlock and ChatBlockHost with mount, finish, and dispose lifecycle callbacks.
- Added InteractiveModeContext.present and resetTranscript APIs and used them to mount/repaint blocks.
- Reworked controller rendering paths to emit command, event, extension, and selector outputs via ctx.present.
- Implemented component and container dispose hooks in tui so loaders and child blocks cleanup timers/effects.
2026-06-07 03:33:53 +02:00
can1357 cd2eb7ed28 fix(coding-agent): handled discard no-op resolution and dynamic expand hints
- Updated tool expand-hint rendering to use `expandKeyHint()`, which pulls the `app.tools.expand` binding and formats collapsed previews as `<key>: Expand`.
- Updated related tests in render utils and TUI regressions to assert the new hint string for default and remapped bindings.
- Added a resolve-tool regression test and changelog note covering `action: "discard"` with no pending action as a successful cancellation.
2026-06-07 03:21:25 +02:00
can1357 8df5718a66 fix(coding-agent/tools): handled discard action when no pending resolve action exists
- Handled discard requests by returning a no-op success response when no action is pending.
- Kept apply requests on the same path to throw ToolError when nothing is pending.
2026-06-07 03:09:28 +02:00
can1357 4c5279b04b ux(modes): unified transcript spacing and block grouping for cleaner rendering
- Centralized transcript spacing by stripping blank edges and inserting separators.
- Removed per-component leading spacers and empty placeholders that added extra gaps.
- Introduced TranscriptBlock grouping so related outputs render as single transcript children.
- Updated transcript-related tests to validate one-row block separators and blank-line trimming.
2026-06-07 02:58:38 +02:00
can1357 8089b7dd77 feat(modes): reworked plan review flow to use an interactive overlay
- Replaced the plan review flow to open PlanReviewOverlay for approvals.
- Added scrollable markdown plan rendering with prompt, options, and footer in the overlay UI.
- Added disabled-option handling so cursor movement and confirmation skip unavailable rows.
- Added setPlanContent updates to refresh overlay text and reset scroll position on edits.
2026-06-07 02:58:09 +02:00