@@ -4520,12 +4520,14 @@ function codexTokenCandidates(config: AdapterConfig): string[] {
45204520 return candidates ;
45214521}
45224522
4523- function redactedCommandResult ( result : CommandResult ) : JsonObject {
4523+ export function redactedCommandResult ( result : CommandResult ) : JsonObject {
45244524 const diagnostic = runtimeDiagnostic ( result ) ;
45254525 return {
45264526 ...result ,
4527+ args : result . args . map ( ( arg ) => redactTokenish ( arg ) ) ,
45274528 stdout : redactTokenish ( result . stdout ) ,
45284529 stderr : redactTokenish ( result . stderr ) ,
4530+ spawn_error : redactTokenish ( result . spawn_error ) ,
45294531 ...( diagnostic ? { runtime_diagnostic : diagnostic } : { } ) ,
45304532 } ;
45314533}
@@ -4582,14 +4584,14 @@ export function redactTokenish(text: string): string {
45824584 }
45834585 return text
45844586 . replace ( / - - - - - B E G I N [ A - Z ] * P R I V A T E K E Y - - - - - [ \s \S ] * ?- - - - - E N D [ A - Z ] * P R I V A T E K E Y - - - - - / g, "[redacted private key]" )
4587+ . replace ( / ( h t t p s ? : \/ \/ ) [ ^ / \s : @ ] + : [ ^ @ \s / ] + @ / gi, "$1[redacted]@" )
4588+ . replace ( / x - a c c e s s - t o k e n : [ ^ @ \s ' \" ] + / gi, "x-access-token:[redacted]" )
45854589 . replace ( / \b (?: g h [ p o u s r ] _ | g i t h u b _ p a t _ ) [ A - Z a - z 0 - 9 _ - ] { 6 , } / g, "[redacted github token]" )
45864590 . replace ( / \b s k - (?: p r o j - ) ? [ A - Z a - z 0 - 9 _ - ] { 8 , } / g, "[redacted OpenAI token]" )
45874591 . replace ( / \b B e a r e r \s + [ ^ \s ' \" ] + / gi, "Bearer [redacted]" )
45884592 . replace ( / \b [ A - Z 0 - 9 . _ % + - ] + @ [ A - Z 0 - 9 . - ] + \. [ A - Z ] { 2 , } \b / gi, "[redacted email]" )
45894593 . replace ( / \b o n a c c o u n t \s + ` ? [ ^ ` \n . ] + ` ? / gi, "on the configured account" )
4590- . replace ( / \b e y J [ A - Z a - z 0 - 9 _ - ] + \. [ A - Z a - z 0 - 9 _ - ] + \. [ A - Z a - z 0 - 9 _ - ] + \b / g, "[redacted JWT]" )
4591- . replace ( / x - a c c e s s - t o k e n : [ ^ @ \s ' \" ] + / gi, "x-access-token:[redacted]" )
4592- . replace ( / ( h t t p s ? : \/ \/ ) [ ^ / \s : @ ] + : [ ^ @ \s / ] + @ / gi, "$1[redacted]@" ) ;
4594+ . replace ( / \b e y J [ A - Z a - z 0 - 9 _ - ] + \. [ A - Z a - z 0 - 9 _ - ] + \. [ A - Z a - z 0 - 9 _ - ] + \b / g, "[redacted JWT]" ) ;
45934595}
45944596
45954597function failTask ( path : string , task : JsonObject , reason : string , detail : string ) : JsonObject {
0 commit comments