fix(code): keep long thread resumes responsive - #5772
Merged
Conversation
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
August 24, 2026 15:25
The `_restoring_resumed_history` flag was cleared only when the entire session-start sequence exited, so a resumed launch with `--startup-cmd` kept showing "Resuming" while the command (or resume compaction/initial submission) ran. Clear the flag and sync the status bar immediately after `_load_thread_history`, keeping the exception path in the outer finally for setup that fails before or during that phase.
Address review findings on the resume-responsiveness change.
Coverage. The line that arms `_restoring_resumed_history` and the two
that clear it on a failed startup had no test: every test hand-set the
flag, and the status-bar test replayed the handler's own assignment
instead of dispatching it. All three lines were deletable with a green
suite. Drive the real handlers instead, and add the reconnect case that
proves a mid-session respawn cannot resurrect the label.
Docs. Restore the `_resuming` invariant the handler depends on ("set
once, never re-armed") and the status-bar ownership note, both dropped
while the lifecycle grew a third flag. Document the new flag's arm and
clear sites, and the rule that every clear must repaint.
Error handling. Route both clears through `_clear_resume_indicator`, so
the repaint cannot replace an exception propagating through the
`finally`. Monitor the session-start task: it has no `except`, so a
failing `_init_session_state` previously surfaced nowhere and left a
settled status bar over an empty transcript. Report an interrupted or
failed restore as an error rather than neutral app chatter.
Tests. Add the `INITIAL_WINDOW_SIZE` boundary cases, which no bulk_load
test reached, and a test that the event loop keeps running while a long
history is prepared. Patch the prepare function instead of blanket-
stubbing `asyncio.to_thread`, which now also covers hook recording.
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Aug 24, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`, not this PR description — keep them aligned anyway so the PR stays an accurate historical record for reviewers and anyone returning later._ --- ## [0.1.61](deepagents-code==0.1.60...deepagents-code==0.1.61) (2026-08-24) ### Features - Added `google_anthropic_vertex` provider support for Claude on Vertex AI ([#5760](#5760)). - Enforced configured model allowlists ([#5649](#5649)). - Injected goal and rubric context directly, replacing `get_goal` and `get_rubric` ([#5041](#5041)). - Made `/offload` server-owned ([#5261](#5261)). - Added prompt clipboard support ([#5733](#5733)). - Show Auto approval review progress ([#5729](#5729)). ### Bug Fixes - Kept long thread resumes responsive ([#5772](#5772)). - Render first streamed text immediately ([#5761](#5761)). - Show the incognito shell command widget ([#5768](#5768)). - Only highlight actionable tool rows ([#5769](#5769)). - Warn and ignore `--auto-approve` and `--yolo` in headless mode ([#5750](#5750)). - Sweep expired history archives at startup ([#5751](#5751)). - Clarified auth environment setup ([#5767](#5767)). _End release notes preview._ --- > [!NOTE] > A **community contributors** list and a **Special thanks** section (crediting the users who filed the issues this release's PRs closed) are appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 3). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
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.
Long thread resumes now paint sooner and keep the Resuming indicator visible until restoration finishes.
This reduces the initial synchronous transcript window from 100 to 30 messages and moves checkpoint deserialization plus hook transcript projection off the UI thread; existing bounded hydration continues after first paint.
Made by Open SWE
References