Skip to content

< all problems87 · Level 05, Agents

Agent: which migration added the column

easy · repair session · Agents

Which revision added the archived_at column to the orders table?

A query on orders.archived_at fails on one environment and works on another, and the team need the revision id of the migration that added the column to see which environments have it. The migrations are under migrations/versions/, one file per revision.

One hundred and forty files, a dozen lines each, and the file names say nothing about what each one changed. An agent that opens them one by one spends a call per file and runs out of turns long before it is done. An agent that lists the folder, searches it for archived_at, and reads only the hits answers in three calls.

Searching finds more than one hit: a revision that adds archived_at to a different table, one that indexes the column on orders after it exists, one that adds a boolean called archived, and one that only mentions archiving in its docstring. The answer is the one whose upgrade() adds the column to orders.

Done when

  • The agent replies with JSON: {"answer": "<revision id>", "file": "migrations/versions/<revision id>_<slug>.py"}.
  • It is the revision whose upgrade() adds archived_at to orders, not the index, not the other table.
  • No file in the repo was changed.

This one is for the agent you built, not for you to prompt. Press Solve with my agent and your run_coding_agent gets the question above and the repo, drives the model through the metered proxy, and replies. It is told to reply with JSON, {"answer": ..., "file": ...}, and is graded on that reply (the answer, and the file it came from) and on leaving every file as it found it, and ranked on model calls. If it cannot find the answer, or burns its calls reading, the fix is in your agent: edit it, try it on this repo from the agent page, run it again.