[Bug] Completed /refine leaves the spinner running after a daemon resync #2873
Replies: 1 comment
|
Investigated this report and produced a candidate fix, validated on a fork of this repository. Root cause, fix and validation from the working notes:
Diff: awhite0030/prime-agent@main...fix/2873-refine-spinner-resync-9787782507837704432 The change passes |
Uh oh!
There was an error while loading. Please reload this page.
Summary
In daemon-backed interactive mode,
Refining continual harness state...can remain visible after refinement succeeds. Resuming the same session clears it.An extension automatically submitted
/refinein the observed session. This uses the same session-command path as a typed/refine; it was not a manual user action. The saved session contains both the successful refinement and itssession_slash_command_result.Version
Checked upstream
mainatcd1f215cffd09223316c54dddae5e1b654718c31(package version 0.9.6). The relevant loader and resync methods are unchanged from the locally reproduced version. Local reproduction used macOS and Node 24.19.0.Reproduction and cause
Two isolated, provider-free replays reproduce the failure mechanism:
message_startto the interactive UI. The refine loader starts.message_start.Separately, replaying the observed outcome/notice/completion message sizes through production daemon delivery methods and a real private-framed Unix socket caused the output buffer to reach 68,687 bytes with a default 65,536-byte high-water mark. The receiver was reading normally. Both command-result events were skipped and a resync was queued. No model calls, forced backpressure flag, or fake socket were used. Historical socket packets were not captured, so this is a causal reproduction rather than a packet trace of the original occurrence.
The transport intentionally substitutes snapshots for events under backpressure. However,
InteractiveModestops the refine loader only on the live command-result event.renderResyncedSession()does not reconcile refinement completion from the snapshot, andsyncWorkingLoader()keeps remounting the stale loader.Expected behavior
A resync containing the matching completed refinement should clear its loader. An older result must not clear a newer pending refinement, and a snapshot with an unfinished refinement must keep showing it.
A local fix now reconciles the loader from ordered snapshot command/result records and retains newer pending refinements. Regression coverage includes completed and failed commands, missing starts, repeated commands, and command-ID mismatches. Removing snapshot reconciliation makes five regression cases fail. Would you be open to a PR for this? I have not opened an unsolicited upstream PR. No private conversation or harness content is included in this report.
All reactions