@@ -1210,8 +1210,13 @@ describe("oauth refresh hardening", () => {
12101210 await saveCredential ( "anthropic" , { access : "old" , refresh : "rt-old" , expires : 1 , source : "local-cli" } ) ;
12111211 const id = getAccountSet ( "anthropic" ) ! . activeAccountId ;
12121212 const stored = getAccountCredential ( "anthropic" , id ) ! ;
1213- writeOAuthRefreshIntent ( "anthropic" , id , credentialGeneration ( stored ) ) ;
1214- expect ( readOAuthRefreshIntent ( "anthropic" , id ) ) . toBeDefined ( ) ;
1213+ const pending = writeOAuthRefreshIntent ( "anthropic" , id , credentialGeneration ( stored ) ) ;
1214+ expect ( markOAuthRefreshIntentCleanupPending (
1215+ "anthropic" ,
1216+ id ,
1217+ pending ,
1218+ "definitive-rejection" ,
1219+ ) ) . toMatchObject ( { cleanupPending : "definitive-rejection" } ) ;
12151220
12161221 seedClaudeCredentials ( "disk" , "rt-new" , Date . now ( ) + 3600_000 ) ;
12171222 const mock = mockRefreshFetch ( [ new Response ( "unexpected" , { status : 500 } ) ] ) ;
@@ -1234,6 +1239,7 @@ describe("oauth refresh hardening", () => {
12341239 expect ( mock . count ( ) ) . toBe ( 0 ) ;
12351240 expect ( getCredential ( "anthropic" ) ?. refresh ) . toBe ( "rt-new" ) ;
12361241 expect ( getAccountSet ( "anthropic" ) ! . accounts [ 0 ] ! . needsReauth ) . toBeUndefined ( ) ;
1242+ expect ( readOAuthRefreshIntent ( "anthropic" , id ) ?. cleanupPending ) . toBe ( "definitive-rejection" ) ;
12371243 } ) ;
12381244
12391245 test ( "marked Anthropic local-cli account lazily recovers only from a newer disk generation" , async ( ) => {
0 commit comments