Skip to content

Commit 53945a7

Browse files
committed
roll failed steer flush back onto queue
1 parent 308f905 commit 53945a7

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/react-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
fi
6060
REPORT="${RUNNER_TEMP}/react-doctor-report.json"
6161
status=0
62-
npx --yes react-doctor@0.4.2 . --blocking error --changed-files-from "$CHANGED" --json --json-compact --no-telemetry > "$REPORT" || status=$?
62+
npx --yes react-doctor@0.5.4 . --blocking error --changed-files-from "$CHANGED" --json --json-compact --no-telemetry > "$REPORT" || status=$?
6363
echo "exit-code=$status" >> "$GITHUB_OUTPUT"
6464
echo "report=$REPORT" >> "$GITHUB_OUTPUT"
6565
if [ "$status" -ne 0 ]; then

packages/ui/src/features/sessions/hooks/useToggleMessagingMode.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ export function useToggleMessagingMode(taskId: string | undefined): () => void {
2929
if (next === "steer") {
3030
// Flush buffered messages into the running turn in queued order so a
3131
// message typed first lands first. rawPrompt preserves rich content.
32+
// They are already dequeued, so roll any failed send back onto the queue
33+
// rather than dropping it silently.
3234
const queued = sessionStoreSetters.dequeueMessages(taskId);
3335
void (async () => {
36+
const failed: typeof queued = [];
3437
for (const message of queued) {
35-
await sessionService
36-
.sendPrompt(taskId, message.rawPrompt ?? message.content, {
37-
steer: true,
38-
})
39-
.catch(() => {});
38+
try {
39+
await sessionService.sendPrompt(
40+
taskId,
41+
message.rawPrompt ?? message.content,
42+
{ steer: true },
43+
);
44+
} catch {
45+
failed.push(message);
46+
}
47+
}
48+
if (failed.length > 0) {
49+
sessionStoreSetters.prependQueuedMessages(taskId, failed);
4050
}
4151
})();
4252
}

0 commit comments

Comments
 (0)