Commit Graph

21 Commits

Author SHA1 Message Date
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
David Andrews dff7f8271a fix(coding-agent): stringify preview env values
(cherry picked from commit 2d852c0632116f227b772dbbb646169971bd9398)
2026-08-05 03:07:27 -04:00
can1357 a4c9ffb434 fix: preserve bash timeout and abort semantics 2026-07-17 05:18:39 +02:00
can1357 87a64b2f6a feat(coding-agent): improved background job lifecycle and display
- Stop propagating real-time updates for backgrounded Bash jobs to avoid UI flickering once a job enters the background.
- Refine background task tracking in `EventController` to distinguish between persistent background tasks and transient backgrounded Bash commands.
- Update UI rendering to display cleaner background job metadata in the footer instead of inline text notices.
2026-07-13 00:54:51 +02:00
can1357 8fd5171768 ux(coding-agent): capped collapsed bash, ssh, and eval previews to a viewport tail window
- Replaced the fixed `CALL_PREVIEW_MAX_LINES` cap in `render-utils.ts` with a dynamic `previewWindowRows()` (terminal rows minus a chrome reserve); `capPreviewLines` now returns lines untouched when expanded and windows them otherwise.
- Applied the cap in every render state for bash and ssh command previews — streaming and final render identically instead of snapping fully open on completion — and included the preview window in bash's render cache key so terminal resizes invalidate it.
- Capped eval cell code previews via the same window; previously cell code was never capped at all, with `ctrl+o` remaining the only way to uncap.
- Added stream-vs-final parity coverage in `bash-sixel-render.test.ts`, `ssh-render.test.ts`, and the new `eval-code-preview.test.ts`, and a changelog entry.
2026-06-12 02:33:49 +02:00
roboomp f17733570e perf(coding-agent): cached bash result renderer to stop per-keystroke restyle
Follow-up to the loop guard + artifact cap that addressed the root cause
of issue #2081's runaway captures. The reporter then noted Ctrl+X/Ctrl+C
remaining unresponsive — confirming the secondary symptom: per-keystroke
TUI repaints walked every visible bash row and re-ran `split` /
`replaceTabs` / `truncateToVisualLines` over the stored output. With a
1,000+ message transcript and a 50KB-tail per row, that string work was
what pinned the main thread, not the loop itself.

The eval renderer already caches its computed lines keyed by `(width,
previewLines)` — see `eval-render.ts:709-752`. Mirrored that pattern in
the bash result renderer with a slightly wider key (`width`,
`previewLines`, `expanded`, `rawOutput`, `isPartial`) so the cache is
busted whenever any input that affects the produced lines actually
changes. `invalidate()` continues to clear `CachedOutputBlock` and now
also clears the lines cache, so callers that already drive invalidation
keep working unchanged.

A render() with cache-equivalent inputs is now an array-reference
return; the `CachedOutputBlock` round trip is skipped entirely. New
test in `test/tools/bash-sixel-render.test.ts` pins the contract:
identical inputs → same array reference; width change → cache miss;
invalidate() → fresh array.

Refs #2081
2026-06-10 08:26:00 +02:00
can1357 fe5d27c4a3 feat(coding-agent): removed animated shimmer border on exec blocks
- Removed sweeping bottom-edge segment from pending bash, eval, and ssh blocks; pending now shows a static accent border.
- Dropped border shimmer geometry, animate options, and related tests.
- Repurposed pending-tool 30fps redraws solely for the running task row shimmer.
2026-06-08 04:31:58 +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 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 ebb9276393 feat(coding-agent): added animated pending border for bash/eval blocks
- Added clockwise sweeping dark segment animation to output block borders while bash/eval tool calls are pending/running.
- Changed bash renderCall to immediately render a full bordered block instead of a one-liner status preview, so silent commands show the framed block for their entire runtime.
- Added shimmerEnabled() helper and wired animate flag through OutputBlockOptions, CodeCellOptions, and shell/eval renderers.
2026-05-31 01:43:00 +02:00
can1357 98de6510f0 fix(coding-agent/tools): renamed exit status label from "Status: exit N" to "Exit: N"
- Updated shell renderer footer label for non-zero exits to use the shorter `Exit: N` format.
- Updated changelog and tests to match the new label.
2026-05-30 16:35:34 +02:00
can1357 4356298182 fix(coding-agent/tools): handled non-zero bash exits as error results
- Tagged non-zero bash command completions as error results, capturing `exitCode` and keeping exit notices in returned text.
- Updated the shell renderer to hide duplicate exit notices from output while surfacing failed command status in the footer.
- Added tests for non-zero versus zero-exit bash results and footer rendering of failed commands.
2026-05-30 16:31:48 +02:00
can1357 3e5b0b2340 feat(coding-agent/tools): added bash wall-time tracking to results and renderer
- Measured bash wall-clock duration for direct, terminal-bridge, and interactive execution paths.
- Recorded wall time in result notices and details, then stripped the duplicated literal notice during shell rendering.
- Updated the renderer to include wall time in the status label and added tests for the new wall-time behavior.
2026-05-27 01:53:34 +02:00
can1357 39f34ada70 feat: added pure-JS sanitizeText
- Migrated sanitizeText from pi-natives to pi-utils as a pure-JS implementation, removing the native dependency across all call sites.
2026-05-16 20:12:26 +02:00
can1357 453071d34d fix(coding-agent): restored coordinate-mapping dimension note and made bash SGR test color-mode agnostic
- Restored formatDimensionNote bracket form '[Image: original WxH, displayed at WxH. Multiply coordinates by S to map to original image.]' that tests assert. The Bun 1.3.14 refactor regressed it to a less informative 'Image resized from …' line.
- Broadened bash-sixel-render multi-line styling assertion to accept both truecolor (38;2;) and 256-color (38;5;) SGR runs so CI runners with TERM=dumb don't fail. The contract being tested — every line carries its own SGR — is independent of color depth.
2026-05-13 20:43:03 +02:00
can1357 7fd2a7b309 fix(coding-agent/tools): highlighted multi-line bash commands in result rendering
- Added a new formatBashCommandLines helper that syntax-highlighted each command line and applied the dim prefix only to the first line.
- Updated the shell renderer to emit command output as line-based entries instead of a single dimmed string.
- Extended the bash renderer test to verify multi-line commands keep ANSI styling on every rendered line.
2026-05-13 18:15:57 +02: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
can1357 939501f624 feat(coding-agent-async-tooling): added poll tool and async prompts
- Replaced deprecated `await` tool wiring with `poll` in tool exports and built-in tool registry.
- Updated bash and task prompts plus start-result messaging to direct users to the `poll` tool.
- Added effective timeout metadata to Bash tool results and rendered output to show that effective timeout.
- Implemented bounded auto-background wait logic that backgrounds jobs when the timeout window is exhausted.
2026-04-13 13:04:12 +02:00
can1357 26d7783370 fix(chunk): corrected chunk boundary calculations to prevent out-of-range violations
- Added bounds clamping to prologue and epilogue byte calculations to prevent out-of-range boundary violations.
- Extended chunk boundaries for indent-based languages when epilogue exceeds calculated range with trailing newline.
- Added comprehensive test coverage for Python chunk editing operations including body/head replacement and indentation preservation.
- Extracted working directory formatting logic into reusable utility function and applied tab sanitization to bash command previews.
2026-04-08 11:50:42 +02:00
can1357 19feec9592 feat(bash): added env parameter to bash tool for safe variable passing
- Added `env` parameter to bash tool for safe environment variable passing without shell re-parsing.
- Added support for rendering partial environment variable assignments in command preview during streaming.
- Updated bash tool prompt to recommend `env` parameter for multiline, quote-heavy, and untrusted values.
- Refactored tool execution component to conditionally merge partial JSON arguments during streaming.
- Added helper functions for environment variable normalization, escaping, and formatting.
2026-03-08 15:53:33 +01:00
HvC 28d9de74ce Implement Windows Sixel support and terminal capability checks (#241)
* windows sixel imp

* windows sixel imp, terminal capability check, pessimistic sixel selection

* fix codex suggestions

---------

Co-authored-by: Brit <lol@no.com>
2026-03-01 22:23:05 +01:00