Skip to content

fix(question): register answer channel before prompt event#53

Open
cursor[bot] wants to merge 2 commits intomainfrom
cursor/critical-bug-inspection-40a9
Open

fix(question): register answer channel before prompt event#53
cursor[bot] wants to merge 2 commits intomainfrom
cursor/critical-bug-inspection-40a9

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented Apr 25, 2026

Summary

Fixes a race introduced by the oneshot question-response refactor. The evolve loop previously emitted the question event before registering the pending oneshot sender, so a fast UI choice could call darwin_evolve_answer while no pending question existed. That rejected the answer, the UI marked it answered, and the backend could wait indefinitely.

This registers the response receiver before emitting the question event and then awaits that prepared receiver.

Test Plan

  • Added prepared_question_response_accepts_immediate_answer regression coverage.
  • Attempted cargo +stable test prepared_question_response_accepts_immediate_answer in the Linux cloud environment. It is blocked by existing unrelated Linux build errors in Tauri window code (hidden_title, RunEvent::Reopen, and unused variable: window under unused = deny).
  • cargo +stable test --lib ... is not available because the package has no library target.

Docs

  • No docs update needed
Open in Web View Automation 

Co-authored-by: cooper <czxtm@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).
Messages
📖 No docs update needed — acknowledged.

📋 PR Overview

Lines changed 38 (+35 / -3)
Files 0 added, 2 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

Generated by 🚫 dangerJS against f7b386b

@scottmcmaster
Copy link
Copy Markdown
Contributor

This seems valid but the suggested PR fails the build, so I will pull it and fix it up.

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.

2 participants