What the agent does
Matplotlib used to ship a style called seaborn. Version 3.6 deprecated it and 3.8 removed the name, so plt.style.use('seaborn') now raises OSError: 'seaborn' is not a valid package style, path of style file, URL of style file, or library style name. The agent first finds every place the name is used and, more usefully, when each one executes. In inoryy/tensorflow2-deep-reinforcement-learning the call is line 155 of a2c.py, inside if args.plot_results:, and the same line appears in the notebook actor-critic-agent-with-tensorflow2.ipynb. Read upward from line 155: the script has already called agent.train(...), which returns the reward history, and agent.test(...). The style line is the first plotting statement after all of that.
That ordering is the real bug report. With the -p flag set, the script trains for its full number of updates, prints the test score, and then dies on a style name. The reward history existed only in a local variable, so the curve the user asked for is gone and the only way to see it is to train again. And nothing in the project prevents it: requirements.txt lists matplotlib with no version, so pip install -r requirements.txt, the command the README gives, installs a release where the name no longer exists.
The rename itself is exact, and the agent verifies that instead of assuming it. The deprecation message in 3.6 and 3.7 says the old styles will remain available as 'seaborn-v0_8-<style>'. Comparing the two definitions directly, the seaborn style in Matplotlib 3.5.3 and seaborn-v0_8 in a current release hold the same 44 settings with the same values, from the #EAEAF2 axes background to the first line colour. So plt.style.use('seaborn-v0_8') reproduces the old look, and the agent renders the script's plotting block with a stand-in reward list under both and attaches the two images. One limit goes into the pull request: the new name does not exist before 3.6, so the unpinned requirement becomes matplotlib>=3.6. The agent does not reach for the seaborn package. seaborn.set_theme() gives a similar look, but it adds a dependency to fix a string.
Then it fixes the ordering, in the smallest way. The style call moves to the top of the __main__ block, still under the same flag, so a name Matplotlib does not know fails in the first second and not after training. The agent says plainly what it could and could not run. This project pins tensorflow>=2.0.0,<=2.1.0, releases that only install on old Python versions, so it exercises the plotting lines in isolation with the non-interactive Agg backend and savefig, and reports that the training loop itself was not run. In the notebook it edits only the one source line and leaves stored outputs untouched.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "This project fails with \"OSError: 'seaborn' is not a valid package style, path of style file, URL of style file, or library style name\". Find every plt.style.use, plt.style.context and matplotlib.style call in scripts and notebooks that names 'seaborn' or a 'seaborn-...' style. For each, say what the program has already done by the time that line runs; if it runs after long computation whose results are only in memory, say so. Replace each name with its 'seaborn-v0_8' equivalent. Prove the replacement is exact: install the last Matplotlib release that still had the old name and a current release, compare the two style definitions setting by setting, and report the count and any difference. Render the project's own plotting code with stand-in data under both, using the Agg backend and savefig, and attach the two images. Because the new name needs Matplotlib 3.6 or later, add that lower bound to the requirements. Where a style call sits after expensive work, move it before that work, under the same conditions, so an invalid style fails immediately. Do not add the seaborn package, do not change colours, figure sizes or labels, and in notebooks change only the source line, not stored outputs. If the rest of the project cannot run in your environment because of other pinned dependencies, say exactly what you ran and what you did not. Open a pull request with the comparison, the images and that statement.",
"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 with a few one-line edits: the style name in each script and notebook, the lower bound in the requirements file and, where it applied, the style call moved ahead of the expensive work. The description carries the evidence for the rename, the setting-by-setting comparison between the old and the new style, and two rendered images of the project's own plot, one from the last release with the old name and one from a current release. On a2c.py it also states that only the plotting block was executed, with synthetic rewards, because the pinned TensorFlow range does not install on a current interpreter.
A reviewer opens the two images side by side, confirms the requirement bound, and checks that the moved line is still guarded by the same flag so nothing changes for users who never plot. If the project supports people on Matplotlib older than 3.6, they will want a fallback instead of a bound, and the comparison in the description is what they need to decide.
Run it on every Linear issue labelled plotting
Reports of this bug come from users, phrased as the plot crashing at the end, and they land in the tracker. An automation in the Project with a linear trigger on linear.issue.labeled and your label in labels starts a run when a member of your Rush org adds that label; a label added by an app integration does not fire it. The automation's runner needs a Linear connection, made in the console under Settings → Connections.
The issue is placed after the saved prompt as third-party data, so keep the instructions in the prompt and let the issue supply the traceback. Map the state you use for ready work to exec in states if you also want a state change to start it; a state mapped to plan starts a read-only run that posts its plan as a comment on the issue instead.
The use case this job follows, with its automation and trigger: Turn a Linear label into a PR.
Why run it on Rush?
Showing that two styles are identical needs two Matplotlib releases installed at once, one from before the removal and one from after, and a way to render without a display. Nobody watches a plot window in a sandbox, which is exactly the condition under which the Agg backend and savefig are the honest test, and the agent can install each release in its own environment without disturbing the one you work in. The rendered files come back attached to the session, and the commands that compared the settings are in its transcript.
The other half is reading what happens before the failing line. An error on a style name looks cosmetic, and a quick local fix changes the string and stops there. The run reads the script from the top, notices that the failure arrives after the work it was meant to present, and returns a pull request that fixes the name and the order together, with a clear statement of which parts of the program it was able to execute.
Frequently asked questions
What do I use instead of plt.style.use('seaborn')?
plt.style.use('seaborn-v0_8'). Each old variant has the same suffix under the new prefix, for example seaborn-v0_8-whitegrid and seaborn-v0_8-darkgrid. plt.style.available lists the names your installed version accepts.
Will my figures look different?
No. The seaborn style in Matplotlib 3.5.3 and seaborn-v0_8 in a current release contain the same 44 settings with equal values. The agent repeats that comparison in the run and attaches renders from both.
Does the new name work on old Matplotlib?
Only from 3.6. Versions 3.6 and 3.7 accept both names and print a deprecation warning for the old one; 3.5 and earlier know only the old one; 3.8 and later know only the new one. The agent adds a matplotlib>=3.6 bound, or a fallback if you ask for one.
Should I install seaborn instead?
Only if you want seaborn for its plotting functions. seaborn.set_theme() produces a similar appearance, but it is a new dependency with its own releases. For a script that only wanted the look, renaming the style is the smaller and more stable change.