Smoothly exiting from the current output pact, and perhaps replacing it with another agreement, has become an important policy question for Opec and its allies.

Under the current “declaration of cooperation”, issued in December 2016, Opec with Russia and some non-Opec countries have pledged to limit their output. Production limits were originally intended to apply for six months between January and June 2017 but have since been extended for a further nine months until the end of March 2018.

The original declaration was vague about its objectives but senior officials have since indicated the primary goal is to reduce oil inventories in OECD industrialised countries down to the five-year average.

Opec and its allies are now approximately half-way towards that goal, with stocks about 160 million to 170 million barrels above the five-year average, compared with 280 million at the start of 2017.

Opec officials have stressed their resolve to finish what they have started and reduce stocks even further next year.

“We are determined to do whatever it takes to bring global inventories down to the normal level which we say is the five-year average,” the Saudi energy minister Khalid Al Falih said in Riyadh on Tuesday.

“The intent is to keep our hands on the wheel between now and until we get to a balanced market and beyond,” he said.

Since inventories are unlikely to be reduced to the target by the end of March, Opec officials are discussing an extension of the production cuts for up to another nine months.

But the more complicated and important task is deciding when and how to exit from the current agreement and whether to try to replace it with another production accord.

“When we get closer to that [five-year average] we will decide how we smoothly exit the current agreement, maybe go to a different arrangement to keep supply and demand closely balanced so we don’t have a return to higher inventories,” Mr Al Falih said on the sidelines of the Future Investment Initiatives conference in Riyadh.

Knowing when to declare that an objective has been achieved and making a course correction is often a major challenge for policymakers.

If a policy has been successful, there is a tendency to continue pursuing it, even when the environment has changed and demands a different response.

Opec and its allies must decide when to switch the focus from limiting output and cutting stocks to growing production again to meet rising demand.

If they wait too long, stocks will fall too far, prices will rise strongly, shale production will ramp up and the oil market’s adjustment will overshoot.

There is an entire branch of engineering and information technology on “control theory” or how to adjust system inputs to achieve the desired level of output.

The challenge is to adjust inputs smoothly and in a timely manner to keep outputs close to a reference value rather than swinging around wildly.

In Opec’s case, the challenge is to adjust production to achieve some desired level of inventories, prices and market share.

In practice, the organisation has found that a challenge; policy shifts have tended to be reactive rather than proactive.

Opec’s declared objective of reducing excess global oil inventories to their five-year average is only an intermediate target.

The ultimate objective is to achieve some desired combination of price and market share that sustainably maximises income for its member states (leaving to one side the question of time horizon).

In practice, the organisation is led by Saudi Arabia, and the kingdom’s priority tends to alternate between supporting prices and defending market share.

Between the middle of 2014 and the middle of 2016, the kingdom focused on defending market share. Since the end of 2016, its priority has switched to cutting stocks and pushing up prices, and it has been willing to accept some reduction in market share to achieve it.

Saudi officials have so far indicated the focus will remain on inventory reduction and price support well into 2018, even if the kingdom has to concede market share to rival producers.

But as stocks continue to fall, the country will have to make some tricky decisions about when to adjust its production policy and what combination of prices and market share to target.

Global consumption rose by almost 6 million barrels per day (bpd) over the past five years, from less than 91 million bpd in 2012, to more than 96 million bpd in 2016.

Consumption is forecast to rise by another 1.5 million bpd in both 2017 and 2018, which means demand will be almost 10 million bpd higher in 2018 than in 2012.

If a balanced oil market includes some desired ratio of stocks to consumption, then a balanced market in 2018 will need to carry a significantly higher level of stocks than 2012-2016 average.

Cutting inventories back to the five-year average would leave the market feeling exceptionally tight. If Opec tries to force stocks down to that level, the result will be a big rise in spot prices and a sharp move into backwardation.

This is exactly what happened following previous Opec-led efforts at market rebalancing in 1999/2000 and 2010/2011, and it could happen again in 2018/19.

In the aftermath of an oil price slump, Opec and its advisers normally announce they will cut excess stocks, raise prices to a “normal” level and then pledge to keep the market stable.

Following the wrenching 1997/98 price slump, Opec announced it would target a price band of US$22 to $28 per barrel, which became a formal target between 2000 and 2004 before being shelved.

In 2008, Saudi Arabia’s then King Abdullah called $75 to $80 per barrel a “fair price”, and it became a de facto price target for a time, before it, too, was overtaken by events and abandoned.

Oil prices quickly overshot both targets, and Opec found it hard to prevent them climbing further.

As the oil market continues to tighten in 2018, the same pattern could repeat itself, with both spot prices and the backwardation increasing.

Opec and its allies must decide whether to take some of the increase in demand for their crude in the form of higher prices, higher output, or both.

Since most countries are already pumping near full capacity, the decision will principally rest with Saud Arabia and Russia.

Higher prices would risk a renewed boom in shale production from the United States, so Saudi Arabia is likely to be cautious about the market tightening too much.

But the kingdom needs higher oil revenues to help to fund an ambitious social and economic transformation programme.

And higher prices might help achieve a better valuation if and when the kingdom tries to sell shares in its national oil company Aramco.

Averting a renewed shale boom suggests the kingdom should focus on adding production to keep prices below $60.

But revenue maximisation and the looming sale of oil company shares argues for letting prices rise above $60 in 2018.

Policymakers are likely to adopt a mixed strategy and opt for some combination of both increased output and higher prices.