You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 96b9943
Browse filesBrowse the repository at this point in the historyBrowse files
feat(chat): answer question prompts orphaned by OpenCode server restart
When the OpenCode server restarts while a question tool call is waiting,
the pending request only lived in server memory and is destroyed
(upstream anomalyco/opencode#36347), leaving the chat stuck with no
answerable card. Detect question tool parts stranded pending/running in
the last message of an idle session and re-render them as answerable
QuestionCards: submitting re-checks the server first (question.reply
when still pending) and otherwise delivers the answers as a new user
message using the asking assistant message's model/agent.
Ported from the `custom` branch across 1612 upstream commits. Three
things changed on the way:
Upstream now has its own question recovery (sync/question-recovery.ts),
which retries fetching a question the server STILL holds. This covers the
opposite case, a question the server no longer has, so the two sit side by
side in ChatContainer. collectOrphanedQuestionRequests already skips any
call id present in the live pending set, so a successful recovery wins and
no orphan card appears.
QuestionCard renders inside the virtualized timeline now, so no caller can
hand it an `orphaned` prop. It defaults to the `orphaned:` id prefix that
collectOrphanedQuestionRequests stamps on, which keeps both call sites and
any future one correct without threading a prop through every list row.
The effect that nudged layout through handleMessageContentChange was
dropped: that callback no longer exists, and the virtualized list reflows
on data change by itself.
Tests for answerOrphanedQuestion are not yet ported; orphanedQuestions.ts
keeps its own suite.
Copy file name to clipboardExpand all lines: packages/ui/src/lib/i18n/messages/en.ts
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2337,6 +2337,8 @@ export const dict = {
2337
2337
'chat.questionCard.submitFailed': 'Failed to send response',
2338
2338
'chat.questionCard.dismissFailed': 'Failed to dismiss question',
2339
2339
'chat.questionCard.noLongerPending': 'This question is no longer waiting for a response.',
2340
+
'chat.questionCard.orphanedBadge': 'Interrupted',
2341
+
'chat.questionCard.orphanedNotice': 'The session restarted before this question was answered. Your answer will be sent to the agent as a new message.',
2340
2342
'chat.questionCard.tryAgain': 'Please try again in a moment.',
2341
2343
'chat.textSelection.toast.noProject': 'No project found for this session',
2342
2344
'chat.textSelection.toast.addToNotesFailed': 'Failed to add to notes',
"chat.questionCard.orphanedNotice": "La sesión se reinició antes de que esta pregunta fuera respondida. Tu respuesta se enviará al agente como un mensaje nuevo.",
2318
2320
"chat.questionCard.tryAgain": "Inténtalo de nuevo en un momento.",
2319
2321
"chat.textSelection.toast.noProject": "No se encontró proyecto para esta sesión",
2320
2322
"chat.textSelection.toast.addToNotesFailed": "No se pudo añadir a las notas",
Copy file name to clipboardExpand all lines: packages/ui/src/lib/i18n/messages/fr.ts
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3256,6 +3256,8 @@ export const dict = {
3256
3256
'chat.questionCard.submitFailed': 'Impossible d’envoyer la réponse',
3257
3257
'chat.questionCard.dismissFailed': 'Impossible d’ignorer la question',
3258
3258
'chat.questionCard.noLongerPending': 'Cette question n’attend plus de réponse.',
3259
+
'chat.questionCard.orphanedBadge': 'Interrompue',
3260
+
'chat.questionCard.orphanedNotice': 'La session a redémarré avant que cette question ne reçoive une réponse. Votre réponse sera envoyée à l’agent sous forme de nouveau message.',
3259
3261
'chat.questionCard.tryAgain': 'Veuillez réessayer dans un instant.',
'chat.questionCard.submitFailed': 'Nie udało się wysłać odpowiedzi',
963
963
'chat.questionCard.dismissFailed': 'Nie udało się odrzucić pytania',
964
964
'chat.questionCard.noLongerPending': 'To pytanie nie czeka już na odpowiedź.',
965
+
'chat.questionCard.orphanedBadge': 'Przerwane',
966
+
'chat.questionCard.orphanedNotice': 'Sesja została uruchomiona ponownie, zanim udzielono odpowiedzi na to pytanie. Twoja odpowiedź zostanie wysłana do agenta jako nowa wiadomość.',
965
967
'chat.questionCard.tryAgain': 'Spróbuj ponownie za chwilę.',
966
968
'chat.textSelection.toast.noProject': 'Nie znaleziono projektu dla tej sesji',
967
969
'chat.textSelection.toast.addToNotesFailed': 'Nie udało się dodać do notatek',
"chat.questionCard.orphanedNotice": "A sessão foi reiniciada antes desta pergunta ser respondida. Sua resposta será enviada ao agente como uma nova mensagem.",
2320
2322
"chat.questionCard.tryAgain": "Tente novamente em instantes.",
2321
2323
"chat.textSelection.toast.noProject": "Não foi encontrado projeto para esta sessão",
2322
2324
"chat.textSelection.toast.addToNotesFailed": "Não foi possível adicionar às notas",
"chat.questionCard.submitFailed": "Не вдалося надіслати відповідь",
2316
2316
"chat.questionCard.dismissFailed": "Не вдалося відхилити питання",
2317
2317
"chat.questionCard.noLongerPending": "Це питання більше не очікує відповіді.",
2318
+
"chat.questionCard.orphanedBadge": "Перервано",
2319
+
"chat.questionCard.orphanedNotice": "Сесію було перезапущено до того, як на це питання відповіли. Вашу відповідь буде надіслано агенту як нове повідомлення.",
2318
2320
"chat.questionCard.tryAgain": "Спробуйте ще раз за мить.",
2319
2321
"chat.textSelection.toast.noProject": "Для цієї сесії не знайдено жодного проєкту",
2320
2322
"chat.textSelection.toast.addToNotesFailed": "Не вдалося додати до нотаток",
0 commit comments