File tree 1 file changed +26
-1
lines changed
codex-cli/src/components/chat 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,39 @@ export default function TerminalChatInput({
176
176
} ,
177
177
) ;
178
178
179
+ transcriber . current . on ( "error" , ( error ) => {
180
+ setIsRecording ( false ) ;
181
+ setShouldResumeRecording ( false ) ;
182
+ setItems ( ( prev ) => [
183
+ ...prev ,
184
+ {
185
+ id : `speak-transcription-error-${ Date . now ( ) } ` ,
186
+ type : "message" ,
187
+ role : "system" ,
188
+ content : [
189
+ {
190
+ type : "input_text" ,
191
+ text : `Transcription ${ error } ` ,
192
+ } ,
193
+ ] ,
194
+ } ,
195
+ ] ) ;
196
+
197
+ // Clean up the transcriber
198
+ if ( transcriber . current ) {
199
+ transcriber . current . cleanup ( ) ;
200
+ transcriber . current = null ;
201
+ }
202
+ } ) ;
203
+
179
204
await transcriber . current . start ( ) ;
180
205
} catch ( error ) {
181
206
setIsRecording ( false ) ;
182
207
setShouldResumeRecording ( false ) ;
183
208
setItems ( ( prev ) => [
184
209
...prev ,
185
210
{
186
- id : `speak-error-${ Date . now ( ) } ` ,
211
+ id : `speak-start- error-${ Date . now ( ) } ` ,
187
212
type : "message" ,
188
213
role : "system" ,
189
214
content : [
You can’t perform that action at this time.
0 commit comments