Bill Shorten has inflicted a historic humiliation on Scott Morrison's Coalition.

The Labor leader's hope will be that it doesn't come with damaging consequences.

Because beneath Mr Shorten's legislative victory in the name of humanitarianism lies a hardened gamble that the boats won't start up again.

If they do, and an asylum boat manages to reach Australia between now and polling date, the Coalition will castigate Mr Shorten as being to blame.

About 1000 people are still on Manus Island and Nauru. ( AAP Image/Supplied by Refugee Images )

With a slim 74-75 government loss on the floor of the House of Representatives on the first day of the parliamentary year, the tenor of asylum seeker policy debate changes.

The result undoubtedly reflects the changed public sentiment on border matters.

Labor can claim to be allied with this new sentiment.

But the political dividend expected by the Coalition for being the one to stop the boats is potentially up-ended if the Coalition can lay ownership of any new boat arrival on Mr Shorten.

Which is why some in Labor are not entirely without anxiety.

As one grizzled Labor veteran puts it, the ALP party room has a tendency to break into two tribes when it comes to border protection — and it's not always down the Left or Right divide.

It's often down the lines of who remembers and who's forgotten, or who simply wasn't there.

Many who lived through the Rudd-Gillard-Rudd years are still scarred by what happened on the high seas and in parliamentary combat about boats.

Some veterans in the Labor caucus make it their business to reinforce the lessons from that time, to recall the hundreds of anonymous deaths at sea, the dozens of limp bodies brought ashore at Christmas Island, the battering that Labor's reputation took at the hands of a ruthless and devastatingly effective opponent in Tony Abbott.

About 1,000 still languish on Nauru and Manus

It's not about being flint-hearted, they say. It's about knowing what the grim consequences are.

But what's tested Labor's near six-year resolve to be largely in lock-step with the Coalition on asylum seeker policy has been the fact that so many people — including children — remained on Nauru and Manus Island for so long.

Four children still on Nauru are expected to be flown to the US in coming days. ( Supplied: World Vision )

The Coalition likes to compare its record with that of the Howard government. In some ways, that's fair enough.

Mr Abbott and Mr Morrison did indeed stop the boats, employing hardball tactics many doubted would work. Boat turn-backs worked.

But where the comparison is unfavourable is the fact that after five-and-a-half years, about 1,000 people still languish on Nauru and Manus.

The Howard government had practically emptied its offshore detention centres in the same period (it peaked at 1,515 and only four remained when the Ruddslide took Labor to power in 2007).

The Government's stubborn refusal to accept New Zealand's longstanding offer to accept 150 refugees a year, the slow pace of transfers to the US under the deal struck niftily by Malcolm Turnbull with Barack Obama, and the apparent inability of the Government to attract similarly attractive first-world options for the refugees haven't helped.

(Ironically, given the current parliamentary brouhaha about medical evacuation, there'd be close to 2,000 people on Manus and Nauru if so many people hadn't already been transferred, often under Federal Court order, to Australia for medical treatment.)

Labor seized the chance to embarrass the Government

With so many people in effective limbo, the political dynamic was always going to change.

Mr Morrison recognised this when he became the accidental Prime Minister in September.

With the fate of 110 or so children on Nauru becoming a subject of increasingly heated public attention, he and Immigration Minister David Coleman resolved to hasten their removal.

Sorry, this video has expired Christopher Pyne on medical transfers of asylum seekers

As of today, there are still four children remaining on Nauru.

They are expected to be flown to the US in coming days with their families.

Labor's response to the changed public sentiment on Nauru and Manus converged with an opportunity to embarrass the Government.

Its support of Senate crossbencher Tim Storer's medical evacuation bill in that frenzied last day of Parliament in December was a dangerous moment for the Coalition.

If it weren't for the fact the Government closed down the House of Representatives prematurely, the Coalition might've become the first government since 1941 to lose a vote on legislation.

The summer break saw tensions simmer. In those weeks, Mr Shorten indicated he remained in support of the medivac bill.

The Government regathered. It argued its case against the bill, claiming it would unpick offshore processing. Labor appeared unmoved.

It took Mike Pezzullo for Labor to blink.

The Government leaked and then declassified advice from the Home Affairs Secretary that warned of the bill's effect on the hardline border regime.

Potential test of 'character' for Bill Shorten

Within four weeks of Royal Assent, Mr Pezzullo's advice said, most of the 1,000 people on Nauru and Manus would find doctors recommending their transfer to Australia for medical treatment or assessment.

Point 11 of his advice warned starkly: "We expect that this may encourage those prospective clients of people smugglers who, to date, have not decided to travel due to the dissuasion of returns, turnbacks and regional processing. This bill removes the third pillar — regional processing."

Sorry, this video has expired PM says Labor is soft on borders after losing key vote in House

In short, the Pezzullo advice was that the boats would resume and offshore processing ended, neither of which Labor wants.

Mr Pezzullo and ASIO boss Duncan Lewis proffered similar advice to Mr Shorten in person on Monday morning, leaving Labor's continued support for the medivac bill politically untenable.

Mr Shorten knew it. The Labor old timers knew it.

Yet Mr Shorten found himself squeezed between those urging for a more compassionate approach on asylum seekers and the old timers wanting their leader to show tremendous caution in any retreat on current settings.

His proposed amendments to the medivac bill sought to answer the Pezzullo-Lewis concern about "pull factors" by restricting the bill to the existing groups on Nauru and Manus.

Scott Morrison's historic humiliation could work in his favour. ( ABC News: Jed Cooper )

He proposed strengthening ministerial discretion and he relaxed the proposed timeframe for ministerial decisions, bolstering the Prime Minister's accusation that the Labor leader had acted without due caution back in December.

After Greens leader Richard di Natale traipsed through the Press Gallery, advertising his deep reservations about the Labor amendments, it looked like the bill was doomed.

But the minor party works in mysterious ways and some folk had underestimated Mr Shorten's determination to salvage the bill.

Greens MP Adam Bandt and Mr Shorten were at the other side of the building, quietly re-negotiating the amendments to the satisfaction of the Opposition and the crossbenchers.

Bill Shorten's rare legislative victory over an elected Government was achieved, he says, in the name of proving "our national character" and reinforcing in law that Australians take seriously the way people in the care of their Government are treated.

He must now hope that the next three months pass without incident for Australia's maritime border security.

If not, Mr Morrison will make it his business to ensure this moment was truly a test of "character" — Mr Shorten's.