File tree Expand file tree Collapse file tree 4 files changed +32
-20
lines changed
controllers/chat/messenger Expand file tree Collapse file tree 4 files changed +32
-20
lines changed Original file line number Diff line number Diff line change @@ -250,9 +250,11 @@ export class Messenger {
250
250
const actionId =
251
251
tool . type === ToolType . ExecuteBash ? 'run-shell-command' : 'generic-tool-execution'
252
252
253
- this . dispatcher . sendCustomFormActionMessage (
254
- new CustomFormActionMessage ( tabID , { id : actionId } )
255
- )
253
+ if ( ! validation . requiresAcceptance ) {
254
+ this . dispatcher . sendCustomFormActionMessage (
255
+ new CustomFormActionMessage ( tabID , { id : actionId } )
256
+ )
257
+ }
256
258
} else {
257
259
// TODO: Handle the error
258
260
}
Original file line number Diff line number Diff line change @@ -32,21 +32,31 @@ export class ChatStream extends Writable {
32
32
}
33
33
34
34
override _write ( chunk : Buffer , encoding : BufferEncoding , callback : ( error ?: Error | null ) => void ) : void {
35
- const text = chunk . toString ( )
36
- this . accumulatedLogs += text
37
- this . logger . debug ( `ChatStream received chunk: ${ text } ` )
38
- this . messenger . sendPartialToolLog (
39
- this . accumulatedLogs ,
40
- this . tabID ,
41
- this . triggerID ,
42
- this . toolUse ,
43
- this . validation ,
44
- this . changeList
45
- )
46
- callback ( )
35
+ try {
36
+ const text = chunk . toString ( )
37
+ this . accumulatedLogs += text
38
+ this . logger . debug ( `ChatStream received chunk: ${ text } ` )
39
+ this . messenger . sendPartialToolLog (
40
+ this . accumulatedLogs ,
41
+ this . tabID ,
42
+ this . triggerID ,
43
+ this . toolUse ,
44
+ this . validation ,
45
+ this . changeList
46
+ )
47
+ callback ( )
48
+ } catch ( error ) {
49
+ this . logger . error ( `Error in ChatStream.write: ${ error } ` )
50
+ callback ( error instanceof Error ? error : new Error ( String ( error ) ) )
51
+ }
47
52
}
48
53
49
54
override _final ( callback : ( error ?: Error | null ) => void ) : void {
50
- callback ( )
55
+ try {
56
+ callback ( )
57
+ } catch ( error ) {
58
+ this . logger . error ( `Error in ChatStream.final: ${ error } ` )
59
+ callback ( error instanceof Error ? error : new Error ( String ( error ) ) )
60
+ }
51
61
}
52
62
}
Original file line number Diff line number Diff line change @@ -50,15 +50,15 @@ export class FsRead {
50
50
public queueDescription ( updates : Writable ) : void {
51
51
const fileName = path . basename ( this . fsPath )
52
52
const fileUri = vscode . Uri . file ( this . fsPath )
53
- updates . write ( `Reading file: [${ fileName } ](${ fileUri } ), ` )
53
+ updates . write ( `Reading file: [${ fileName } ](${ fileUri } ) ` )
54
54
55
55
const [ start , end ] = this . readRange ?? [ ]
56
56
57
57
if ( start && end ) {
58
- updates . write ( `from line ${ start } to ${ end } ` )
58
+ updates . write ( `L ${ start } to L ${ end } ` )
59
59
} else if ( start ) {
60
60
if ( start > 0 ) {
61
- updates . write ( `from line ${ start } to end of file` )
61
+ updates . write ( `from L ${ start } to end of file` )
62
62
} else {
63
63
updates . write ( `${ start } line from the end of file to end of file` )
64
64
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export interface MessageErrorInfo {
13
13
}
14
14
15
15
export function extractErrorInfo ( error : any ) : MessageErrorInfo {
16
- let errorMessage = 'Error reading chat stream.'
16
+ let errorMessage = 'Error reading chat stream: ' + error . message
17
17
let statusCode = undefined
18
18
let requestId = undefined
19
19
You can’t perform that action at this time.
0 commit comments