Skip to content

fix: stop reading a reply turn after its thread disappears - #4525

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4522
Oct 27, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4522

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A refused comment removes its temporary thread before the retained reply field finishes repainting. The shared fieldReading still classified that missing subject as “Reply”, allowing the turn lead added in #4510 to call threadAttention without a thread. The field reader now returns an empty reading while its subject is absent, so both the hint and its lead stop describing a reply until the panel retires the route.

This preserves the retained composition renderer and native editor ownership from #4393. The rejected thread still disappears and the user's words, placement and focus return through the existing refusal recovery. No layout or styling changes are introduced.

Both reported browser regressions reproduce the null dereference on the base and pass with the fix. Validation also passes 10 adjacent refusal cases, four panel cases covering status, reply/walk labels and sending, the browser build, and all 684 runtime tests. Existing tests cover the transition without another reproduction test.

A served command-hub startup comparison against the base keeps 45 code requests through widget upgrade and first server-state presentation, adding 158 code bytes. Both arms show no console errors or layout shifts. The added branch belongs in the shared field reading rather than a second null guard in the attention reader; it states whether the retained field still has a subject.

Closes #4522 — automated triage

A retained composition field may repaint after refusal removes the optimistic thread and before the panel retires its route. fieldReading fell through to Reply for that missing key, so the turn lead introduced by #4510 dereferenced a nonexistent thread. Classify the missing subject in the shared field reader so both its hint and lead stop describing a reply. Native row ownership and refusal recovery remain intact.

Existing refused-comment regressions fail before and pass after this change, preserving returned words, placement and focus. Twelve refusal cases and four adjacent panel cases pass, as do the browser build and 684 runtime tests.

Closes #4522
@leaf-agent
leaf-agent merged commit fb71279 into main Oct 27, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4522 branch October 27, 2026 23:52
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.

Refused comment composition dereferences a missing thread in threadAttention

1 participant