Heat oven to 160C/140C fan/gas 3. Rub the meat with 1 teaspoon of the oil and plenty of seasoning. Heat a large flameproof casserole dish and brown the meat all over for about 10 mins. Meanwhile, add 2 teaspoon oil to a frying pan and fry the carrots and celery for 10 mins until turning golden.
Lift the beef onto a plate, splash the wine into the hot casserole and boil for 2 mins. Pour in the stock, return the beef, then tuck in the carrots, celery and bay leaves, trying not to submerge the carrots too much. Cover and cook in the oven for 2 hrs. (I like to turn the beef halfway through cooking.)
Meanwhile, thinly slice the onions. Heat 1 tablespoon oil in a pan and stir in the onions, thyme and some seasoning. Cover and cook gently for 20 mins until the onions are softened but not coloured. Remove the lid, turn up the heat, add the butter and sugar, then let the onions caramelise to a dark golden brown, stirring often. Remove the thyme sprigs, then set aside.
When the beef is ready, it will be tender and easy to pull apart at the edges. Remove it from the casserole and snip off the strings. Reheat the onion pan, stir in the flour and cook for 1 min. Whisk the floury onions into the beefy juices in the casserole, to make a thick onion gravy. Taste for seasoning. Add the beef and carrots back to the casserole, or slice the beef and bring to the table on a platter, with the carrots to the side and the gravy spooned over