Skip to content

agent: Address review follow-ups for quit-time thread flush - #59079

Merged
MartinYe1234 merged 1 commit into
mainfrom
rtfeldman/quit-flush-follow-ups
Jun 16, 2026
Merged

agent: Address review follow-ups for quit-time thread flush#59079
MartinYe1234 merged 1 commit into
mainfrom
rtfeldman/quit-flush-follow-ups

Conversation

@rtfeldman

Copy link
Copy Markdown
Contributor

Follow-up to #58962 addressing review feedback on the quit-time thread flush.

The flush now builds its save payloads through the same helper as save_thread, so the two write paths can't drift — in particular, the flush now captures the current draft prompt the same way ordinary saves do, instead of writing whatever stale draft was last serialized. It also logs database connection errors instead of silently discarding them, and runs the per-thread saves concurrently, since all quit observers share gpui's 200ms SHUTDOWN_TIMEOUT and serial saves risked a partial flush.

The regression test now quits through the real App::shutdown path, so the on_app_quit registration itself is exercised rather than just the flush method, and it additionally covers draft-prompt capture and the empty-thread skip.

Release Notes:

  • N/A

@rtfeldman rtfeldman self-assigned this Jun 10, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 10, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 10, 2026
@rtfeldman rtfeldman assigned MartinYe1234 and unassigned rtfeldman Jun 16, 2026
@rtfeldman
rtfeldman marked this pull request as ready for review June 16, 2026 14:27
@MartinYe1234
MartinYe1234 added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit 8ad9d18 Jun 16, 2026
44 checks passed
@MartinYe1234
MartinYe1234 deleted the rtfeldman/quit-flush-follow-ups branch June 16, 2026 14:33
This was referenced Jun 18, 2026
liusuren123 pushed a commit to liusuren123/zed that referenced this pull request Jun 30, 2026
…stries#59079)

Follow-up to zed-industries#58962 addressing review feedback on the quit-time thread
flush.

The flush now builds its save payloads through the same helper as
`save_thread`, so the two write paths can't drift — in particular, the
flush now captures the current draft prompt the same way ordinary saves
do, instead of writing whatever stale draft was last serialized. It also
logs database connection errors instead of silently discarding them, and
runs the per-thread saves concurrently, since all quit observers share
gpui's 200ms `SHUTDOWN_TIMEOUT` and serial saves risked a partial flush.

The regression test now quits through the real `App::shutdown` path, so
the `on_app_quit` registration itself is exercised rather than just the
flush method, and it additionally covers draft-prompt capture and the
empty-thread skip.

Release Notes:

- N/A
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…stries#59079)

Follow-up to zed-industries#58962 addressing review feedback on the quit-time thread
flush.

The flush now builds its save payloads through the same helper as
`save_thread`, so the two write paths can't drift — in particular, the
flush now captures the current draft prompt the same way ordinary saves
do, instead of writing whatever stale draft was last serialized. It also
logs database connection errors instead of silently discarding them, and
runs the per-thread saves concurrently, since all quit observers share
gpui's 200ms `SHUTDOWN_TIMEOUT` and serial saves risked a partial flush.

The regression test now quits through the real `App::shutdown` path, so
the `on_app_quit` registration itself is exercised rather than just the
flush method, and it additionally covers draft-prompt capture and the
empty-thread skip.

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants