What the agent does
The agent reads the schema module that raised the error and the file that pins its dependencies. In Netflix-Skunkworks/swag-client, a library and CLI for cloud account metadata, setup.py requires marshmallow>=3.5.0, boto3, click>=6.7, click-log, dogpile.cache, deepdiff, jmespath, retrying, simplejson and tabulate, so a clean install resolves marshmallow 4.4.0. swag_client/schemas/v2.py passes missing= on twenty fields and default= on one, and line 20, secondaryApprover = fields.Str(default=None, missing=None), is the first to run, so the traceback there names default rather than missing; the next schema class would have named missing. swag_client/util.py has twelve more missing= across the option schemas for the file, S3 and DynamoDB backends, line 14's schema_context = fields.Dict(missing={}) among them.
Then it pins the boundary and finds what else moved. marshmallow 3.26.1 accepts both keywords and prints RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated. Use 'load_default' instead. and the same for default and dump_default. marshmallow 4 also has no __version__ attribute, so the agent reads the installed version with importlib.metadata. With the two keywords renamed, loading an account hits the next removal: validate_type on line 82 of v2.py reads self.context.get(field), and a marshmallow 4 schema has no context; backend.py line 29 builds v2.AccountSchema(context=context) from the manager's schema_context setting. marshmallow 4 replaced that with marshmallow.experimental.context.Context, a context manager the caller enters around load, and Context[dict].get() inside a validator.
The agent makes those changes and proves them with the repository's own vectors. swag_client/tests/vectors/valid_accounts_v2.json holds two accounts; loaded through AccountSchema(many=True) on the branch they come back with the same keys and the same defaults filled in as on marshmallow 3.26.1 with the original code, and the dumps of the two are byte-identical. A record with a bad provider, a bad email and no description is refused with the same three messages on both. The committed invalid_accounts_v2.json is empty, so the agent builds that record itself and says so.
Two things stay out of the change and go in the pull request instead. The test suite does not collect on a current environment, because it imports mock and moto.mock_s3, which moto 5 renamed, so the proof above stands in for it. And backend.py line 46 discovers backends with pkg_resources.iter_entry_points, which fails on setuptools 82 and later; its replacement is importlib.metadata.entry_points, a separate pull request.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "This project fails with \"TypeError: Field.__init__() got an unexpected keyword argument 'missing'\". Find every marshmallow field that passes missing= or default=, and every use of a schema's context attribute or context= argument, and list each with file and line. Read the dependency files and say which marshmallow a clean install resolves. Reproduce on the newest marshmallow, then install the last 3.x release and quote the RemovedInMarshmallow4Warning it prints for the same lines. Rename missing to load_default and default to dump_default, and move any schema context to marshmallow.experimental.context.Context, entered by the caller and read inside the validator. Prove nothing changed: load the repository's own valid example records through the schema on the branch and through the original code on the last 3.x, compare the loaded data and the dumps, and show that an invalid record is refused with the same messages on both. Run the test suite, and if it cannot collect on a current environment say why. Open a pull request with the version findings and the comparisons.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
A pull request that renames thirty-three keyword arguments across schemas/v2.py and util.py, replaces the schema's context read and the backend's context= argument with the marshmallow 4 context manager, and raises the floor in setup.py to the release that has load_default. The description quotes the error, the two 3.x deprecation warnings and the context error that appeared next, and shows the two example accounts loaded and dumped on both versions with the comparison result.
A reviewer checks that no field lost a default in the rename, which the loaded records' filled-in values show, and that the context manager wraps every load the backend performs, not only the one in validate. The note about the test suite's stale mock_s3 import tells them why there is no pytest output and what the next pull request fixes.
The pkg_resources line is named but untouched, so a reviewer who merges this on an environment with setuptools 82 or later should expect that second error at import and plan the follow-up.
Run it on every failed CI run on a dependency bump
marshmallow 4 arrives as a bot pull request or with the next clean install, and the failing job is the alert. An automation with a github trigger on pull requests starts one run per event with the event appended to the prompt; its prompt tells the agent to act only when the bump is marshmallow, webargs or a Flask-marshmallow package and the log contains unexpected keyword argument. The automation's own runs-per-hour cap bounds a burst of bot pull requests.
A library used by several services gets the same break in each of them. One scheduled run a week that upgrades marshmallow in a fresh environment, imports each service's schema modules and opens a pull request only where one fails catches them before the bot does.
The use case this job follows, with its automation and trigger: Fix a bug from an alert.
Why run it on Rush?
The keyword rename is the visible break; the removed schema context is the one that waits behind it, and it only shows up when a record is actually validated. A Rush sandbox lets the agent fix the first error, load real records, hit the second, and fix that too, with every traceback kept in the session, so the pull request describes the whole chain.
Proof here is data, not a test run, because the project's tests no longer collect. The agent loads the repository's own example records on the old and new releases and compares the results byte for byte, and the pull request carries those outputs so the reviewer can check the claim rather than take it.
Frequently asked questions
What replaces missing and default on a field?
load_default and dump_default, which marshmallow 3.13 introduced and 3.x accepted alongside the old names with a RemovedInMarshmallow4Warning. marshmallow 4 removed the old names, so a schema that still uses them fails at class definition, before any data is loaded.
Why does loading fail again after the rename?
Because marshmallow 4 also removed Schema.context and the context= constructor argument. The replacement is marshmallow.experimental.context.Context: the caller enters it around load or dump, and a validator reads it with Context.get(). The agent changes the schema and the caller together.
Should I pin marshmallow below 4?
It is the right stopgap for a dependency you cannot patch, and the pull request says where. For your own schemas the renames are mechanical and the context change is small, and the project then runs on the release that gets fixes.
The tests did not run. How is the change proven?
By the repository's own example records: loaded and dumped through the schema on the last 3.x with the original code and on the branch with marshmallow 4, with identical results, plus an invalid record refused with the same messages on both. The pull request names the stale moto import that keeps the suite from collecting.
More marshmallow jobs
More jobs like this: Fix a bug from an alert
- Fix NoMethodError: Undefined Method exists? for File:Class on Ruby 3.2 and Later (Ruby)
- Fix "ValueError: not enough values to unpack (expected 3, got 2)" from cv2.findContours (OpenCV)
- Fix "Fixtures are not meant to be called directly" in a pytest Suite (pytest)
- Fix Flaky Tests in a Cypress Suite (Cypress)
- Fix Flaky Tests in an Elixir App (Elixir)