Skip to content

fix: read reply availability only for a current panel thread - #4438

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

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A refused optimistic comment removes its thread before the floating panel reconciles its route. The retained composer introduced in #4393 can read that stale route during its own update and pass a null thread to replyAvailable, interrupting refusal recovery. The field reader and panel template now require a current thread before reading reply availability. This preserves the retained renderer and native editor ownership intended by #4393.

The visible behavior remains the existing refusal recovery: the rejected thread closes, the user's words return to their editor, and focus follows the existing intent rules. No layout, styling, or timing changes are introduced.

Validation: the detached-comment test reproduces the reported exception before this fix. The same focused selection passes afterward: 24 browser cases, including all seven cases in the report and adjacent refusal/application-boundary transitions. The browser build and all 682 runtime tests pass. Existing regression tests provide coverage without adding another copy.

A served command-hub startup comparison against the base keeps 45 code requests through widget upgrade and first server-state presentation, with 115 additional code bytes; both arms report no console errors or layout shifts. The document/code combined increase is 206 bytes. Timing was diagnostic only.

Closes #4422 — automated triage

A refused optimistic comment removes its thread before the panel route is reconciled. Composition callbacks can read the field in that interval; a route key alone does not establish a current thread. Check the thread in both field selection and the retained panel template, keeping the existing editor and refusal recovery.

The 24 focused refusal and application-boundary cases pass, including all seven reported cases; the detached refusal reproduced the null dereference before the fix. Runtime: 682 passed. Browser build passes.

Closes #4422
@leaf-agent
leaf-agent merged commit 6488a73 into main Oct 27, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4422 branch October 27, 2026 10:35
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 rendering dereferences a null thread in replyAvailable

1 participant