fix(desktop): keep long tool sessions responsive (rebased #68503) - #69275
Closed
iwillwill-ALLWILL wants to merge 4 commits into
Closed
fix(desktop): keep long tool sessions responsive (rebased #68503)#69275iwillwill-ALLWILL wants to merge 4 commits into
iwillwill-ALLWILL wants to merge 4 commits into
Conversation
Normalize transient Worker constructor failures into the generation retry contract while preserving the original cause. Cover bounded shared recovery and plain fallback, and apply the repository formatter to the eight reviewed files.
Reconcile preview artifacts by tool occurrence and batch additions into one atom update so timeline restore can re-register targets without resurrecting dismissals or replaying historical status writes. Prevent stale Shiki tokens from reaching a commit after code props change, release obsolete highlight state, and keep pagination ref writes outside React state updater callbacks. Add regression coverage for restore/reproduce, bounded preview writes, dismiss semantics, session pagination reset, exact tool-page boundaries, and stale highlighter props.
19 tasks
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
The macOS freeze report lost its original traces and cannot be reproduced on the Linux development host, leaving Electron-wide hangs and transcript rendering stalls indistinguishable. Add a test-only macOS arm64 Electron harness that drives five real local mock-backed chat exchanges, exercises renderer-heavy synthetic transcripts, and probes composer, Settings, IPC, event-loop, and process responsiveness. Run an exact counterbalanced A/B against the long-session candidate while preserving logs, profiles, screenshots, and failure samples. The harness is injected only into ephemeral diagnostic builds and does not change the shipping renderer. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
The short-session hang harness needs native Apple-silicon execution, but the fork has no provider configuration and GitHub Actions is disabled. Add a CircleCI M4 Pro job with pinned Node and checksum-verified uv tooling, run the exact baseline/candidate diagnostic, and retain artifacts on failure. Limit the workflow to the diagnostic branch and ignore tags so enabling the project cannot start this job on unrelated branches. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
The macOS hang diagnostic clicked submit immediately after CDP inserted text, before the composer's animation-frame-coalesced state flush enabled the send control. Native CircleCI runs therefore failed before the first exchange and misclassified harness startup as a reproduced freeze. Poll the real submit control within the existing five-second exchange budget before clicking it. A stalled renderer still fails closed at the same freeze threshold, while normal next-frame propagation no longer creates a false positive. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
The first native CircleCI runs showed that the diagnostic submitted before the composer's derived button state settled, treated every harness exception as a product freeze, and uploaded the isolated Hermes home with its artifacts. Drive real chat submission through the contenteditable Enter path, distinguish five-second renderer/lifecycle failures from harness errors, and invalidate comparisons when setup or fixture contracts fail. Keep per-run sandboxes outside the artifact tree with guaranteed cleanup, and share semantic summary validation between both providers with focused regression coverage. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
Native macOS evidence showed both refs timing out before exchange one while the main and renderer processes remained idle. The CDP Enter packet omitted Chromium's return text fields, and a condition that stayed false was treated as an unresponsive renderer. Match Playwright's Enter packet, split exchange operations, require mock request dispatch, and classify only stalled CDP evaluations or lifecycle signals as reproductions. Responsive unmet chat and Settings conditions now invalidate the diagnostic. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
The macOS ARM64 runner left both target processes idle while every run waited forever for a synthetic keyDown command. Use Chromium's rawKeyDown packet, matching the repository's existing Electron diagnostic, and assert the exact Enter event sequence. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
CircleCI's Electron target leaves CDP keyboard dispatches unacknowledged even while both app processes remain idle. Activate the enabled submit control in the real composer instead, preserving the production submit handler, mock request, transcript, and Settings responsiveness checks. Refs NousResearch#63047 Related NousResearch#69275
egilewski
added a commit
to egilewski/hermes-agent
that referenced
this pull request
Jul 23, 2026
Return the CDP evaluation before activating the real submit control. The following mock-request wait and renderer probe can then distinguish a working submission from a renderer that freezes inside its submit handler. Refs NousResearch#63047 Related NousResearch#69275
15 tasks
Contributor
|
Thanks for the substantial investigation, realistic regression coverage, and preservation of the earlier contributors' attribution. Automated hermes-sweeper review found that the renderer-responsiveness protection is already implemented on current
Closing as implemented on main. This is an automated hermes-sweeper review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebased and hardened continuation of #68503 by @frizikk, whose branch became non-mergeable after #69019 changed the same thread-list virtualization code.
This keeps Hermes Desktop responsive when opening long, tool-heavy sessions without deleting, truncating, or mutating transcript data.
The first three commits preserve Jakub Wolniewicz's original authorship. The final commit contains review-driven hardening and regression tests from @iwillwill-ALLWILL.
Supersedes #68503.
Fixes #68467.
Root cause and approach
A representative transcript (266 messages, 143 tool calls, 650,451 content characters) could synchronously mount and highlight enough history to block the renderer for seconds even while the backend was idle.
The change:
content-visibilitybehavior while resolving the original PR's conflicts.Additional hardening after independent review
A second review found two correctness bugs in the original candidate. Both now have fail-before/fix-after regression coverage:
Setcould suppress a same-path artifact after restore/edit cleared the preview store and the regenerated timeline produced that target again. Registration now tracks bounded per-session tool-occurrence keys plus a clear generation, and batches all newly observed targets into one idempotent atom update. This preserves dismiss semantics and prevents historical-target replay churn.code/languageprops could survive into one committed frame before a passive effect cleared them. Highlight state now carries its source identity and is synchronously ignored unless it matches current props.The hardening commit also keeps ref mutation out of React state updater callbacks and adds coverage for:
Production Electron A/B
Fresh minified production renderers were compared on the same macOS arm64 machine, with the same 266-turn synthetic mixed-Markdown transcript and three runs per side.
mainThe final exact-HEAD run also passed the repository's committed performance gate. The large keystroke improvement is treated as host variance rather than claimed as a feature gain; the merge-safety signal is that no same-machine metric regressed materially, while transcript long-task time remained substantially lower.
A separate production Electron probe loaded a real fenced TypeScript block and observed 25 styled token spans after deferred highlighting, proving that the emitted worker asset loaded and returned tokens under the production renderer/CSP path.
Validation
Run after rebasing onto current
origin/main:npm --workspace apps/desktop run typecheck npm --workspace apps/desktop run lint npm --workspace apps/desktop test npm --workspace apps/desktop run build git diff --check origin/main...HEADResults:
git diff --check: passed;Scope and attribution
apps/desktop/src;DIRTYagainst currentmain; it is not presented as independently authored work.Type of change
Checklist