Skip to content

synch with main fork#4

Merged
MXZZ merged 2 commits into
MXZZ:mainfrom
davi0015:main
Jul 20, 2026
Merged

synch with main fork#4
MXZZ merged 2 commits into
MXZZ:mainfrom
davi0015:main

Conversation

@MXZZ

@MXZZ MXZZ commented Jul 20, 2026

Copy link
Copy Markdown
Owner

No description provided.

davi0015 added 2 commits July 16, 2026 17:06
* fix: register WebWorker for disposal in WebWorkerClient to prevent thread leak

WebWorkerClient stored its WebWorker reference but never registered it
for disposal, so worker.terminate() was never called when the client
was disposed. This leaked OS threads every time a short-lived worker
(e.g. CpuProfileAnalysisWorker from the renderer auto-profiler) was
created and disposed. Over a long chat session this accumulated 70+
idle DedicatedWorker threads.

* fix: move generateCodespanLink from render body to useEffect

generateCodespanLink was called during React render, causing:
- 'state update on unmounted component' warnings
- redundant IPC calls on every re-render during streaming
- re-render cascades that triggered 200ms+ long tasks

Moved to useEffect with cancellation guard. Cache is checked
synchronously first; generation only fires once per codespan.

* perf: defer layout effects to reduce scroll jank in sidebar

Three changes to reduce long tasks during fast scroll-up in long chat
threads (286ms → ~120ms):

1. Move streaming auto-scroll and ChatBubble truncation check from
   useLayoutEffect to useEffect — avoids forcing synchronous layout
   reflow on every stream token.

2. Split virtualization effect: scroll compensation stays in
   useLayoutEffect (must be before paint to avoid scroll jumps), but
   the fill-check moved to useEffect so its setMountStart doesn't
   force a synchronous re-render of new ChatBubble components.

3. Batch-expand by calculated deficit instead of 1 message at a time,
   eliminating the mount→measure→mount cascade.
* docs: add terminal interaction improvement plan to backlog

* feat: expand terminal tool descriptions to warn against interactive commands

Replace the narrow 'git diff | cat' hint with a broader pattern covering
pagers, editors, REPLs, and y/n confirmation prompts. Gives the agent
actionable alternatives (pipe to cat, run non-interactively) instead of
just 'don't get stuck in vim'.

* feat: accurate terminal status in volatile context using CommandDetection

Replace blanket 'running' for every open terminal with idle (shell at
prompt) / running: <command> (command executing) / exited (code N).
Uses CommandDetection capability data — accurate for Void terminals
which always have forceShellIntegration: true. Falls back to 'running'
when shell integration is unavailable.

* feat: enrich TerminalResolveReason to distinguish inactivity vs backstop timeout

Split { type: 'timeout' } into { type: 'timeout', reason: 'inactivity' }
(no output for Ns — likely interactive/stuck) vs { type: 'timeout',
reason: 'backstop' } (still producing output — long-running process).
The stringifier tells the agent which kind of timeout occurred so it
can react appropriately instead of guessing.

* fix: disable whitespace-insensitive fallback in edit_file matching

The fallback in findTextInCode strips all whitespace to match, then
replaces at the line level — which loses indentation. The chat panel
preview shows the LLM's exact original/updated text, but the applied
result differed when the fallback triggered. Setting
canFallbackToRemoveWhitespace to false ensures exact-match-only: if
original doesn't match the file exactly, the LLM gets a clear error
instead of a silent fallback that applies wrong indentation.

* feat: add read_terminal tool

New read-only tool that reads the scrollback buffer of any terminal
(Void or user-created). Returns terminal output, current status
(idle/running/exited), and command history with exit codes and
durations from CommandDetection. No approval required.

The agent uses this to check on persistent terminals after a timeout,
inspect dev server logs, or see output from user-created terminals.
Terminal names are already shown in the system info volatile context.

* feat: add last_n_commands filter to read_terminal tool

When last_n_commands is provided, returns only the output of the last N
commands from the terminal's command history, using CommandDetection's
getOutput() to read between executedMarker and endMarker. When omitted,
returns the full scrollback buffer and full command history as before.
@MXZZ
MXZZ merged commit bdbf4a1 into MXZZ:main Jul 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants