commit 4c05d075ac1c0e6a7d51afd2e57760e3960f1784
parent afc47672462d58f41a435fd4d9b9eb0db62cb878
Author: William Casarin <jb55@jb55.com>
Date: Wed, 18 Feb 2026 09:57:39 -0800
fix Q&A answer submit not working for remote sessions
handle_question_response() only sent through the local oneshot
channel, never publishing to relays for remote sessions. Mirror the
permission response flow: return PermissionResponseResult, insert into
responded_perm_ids for remote, and propagate PublishPermissionResponse
from the UI action handler.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
2 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/crates/notedeck_dave/src/ui/mod.rs b/crates/notedeck_dave/src/ui/mod.rs
@@ -758,8 +758,22 @@ pub fn handle_ui_action(
request_id,
answers,
} => {
- update::handle_question_response(session_manager, request_id, answers);
- UiActionResult::Handled
+ let result =
+ update::handle_question_response(session_manager, request_id, answers);
+ if let update::PermissionResponseResult::NeedsRelayPublish {
+ perm_id,
+ allowed,
+ message,
+ } = result
+ {
+ UiActionResult::PublishPermissionResponse {
+ perm_id,
+ allowed,
+ message,
+ }
+ } else {
+ UiActionResult::Handled
+ }
}
DaveAction::ExitPlanMode {
request_id,
diff --git a/crates/notedeck_dave/src/update.rs b/crates/notedeck_dave/src/update.rs
@@ -276,11 +276,13 @@ pub fn handle_question_response(
session_manager: &mut SessionManager,
request_id: uuid::Uuid,
answers: Vec<QuestionAnswer>,
-) {
+) -> PermissionResponseResult {
let Some(session) = session_manager.get_active_mut() else {
- return;
+ return PermissionResponseResult::Local;
};
+ let is_remote = session.is_remote();
+
// Find the original AskUserQuestion request to get the question labels
let questions_input = session.chat.iter().find_map(|msg| {
if let Message::PermissionRequest(req) = msg {
@@ -378,21 +380,32 @@ pub fn handle_question_response(
agentic.question_answers.remove(&request_id);
agentic.question_index.remove(&request_id);
- // Send the response through the permission channel
- if let Some(sender) = agentic.pending_permissions.remove(&request_id) {
- let response = PermissionResponse::Allow {
- message: Some(formatted_response),
- };
- if sender.send(response).is_err() {
- tracing::error!(
- "Failed to send question response for request {}",
- request_id
- );
- }
+ if is_remote {
+ // Remote: mark as responded, signal relay publish needed
+ agentic.responded_perm_ids.insert(request_id);
} else {
- tracing::warn!("No pending permission found for request {}", request_id);
+ // Local: send through oneshot channel to Claude process
+ if let Some(sender) = agentic.pending_permissions.remove(&request_id) {
+ let response = PermissionResponse::Allow {
+ message: Some(formatted_response.clone()),
+ };
+ if sender.send(response).is_err() {
+ tracing::error!(
+ "Failed to send question response for request {}",
+ request_id
+ );
+ }
+ } else {
+ tracing::warn!("No pending permission found for request {}", request_id);
+ }
}
}
+
+ PermissionResponseResult::NeedsRelayPublish {
+ perm_id: request_id,
+ allowed: true,
+ message: Some(formatted_response),
+ }
}
// =============================================================================