The TV writers and agents had been operating under a franchise agreement that took effect in 1976. That agreement was set to expire at 12:01 a.m. Saturday, when the Writers Guild of America would technically break ties with every agency that had not signed the new code of conduct.

The four major agencies — William Morris Endeavor, Creative Artists Agency, United Talent Agency and ICM Partners — had been steadfast in shunning the writers’ attempt to make serious changes to the structure that has long been in place.

The fight made for an unusual labor battle. The writers’ unions, which went on strike in 2007 and nearly did so again two years ago, have traditionally had disputes with their bosses at the big studios. This time, they have directed their fury with the people who have served as their advocates and friends.

During a programming boom often referred to as Peak TV — 495 shows were available in the United States last year, thanks in part to the rise of streaming — television writers have claimed that their pay is stagnant or going down. The writers blame what they perceive as insufficient compensation on the agencies, accusing them of corrupt business practices.

Two specific practices have gnawed at television writers. One is the agents’ decades-old habit of packaging a roster of talent from their pool of clients for a given project. In return, the agencies waive the usual 10 percent commission fee paid to them by individual clients and collect large sums, called packaging fees, from the studios. The writers claim that these deals allow the agents to effectively pocket money that should be theirs.

The writers’ second complaint concerns how three of the major agencies — William Morris Endeavor, Creative Artists and the United Talent — have ventured into the production business with the creation of affiliated companies that produce and own content. This development, the writers say, can mean that agents sit across the table from executives who are essentially their colleagues in what the unions call a conflict of interest.

The agencies have called the writers’ claims preposterous, arguing that their services are needed more than ever in a changing media environment in which Netflix, Amazon and Apple are on the rise.