Run inspect_swe coding agents in asta-bench#25
Conversation
03573d3 to
74fd2f2
Compare
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
74fd2f2 to
b120b33
Compare
|
GitGuardian flag was a local private key I accidentally staged. Force-pushed to remove and rotated the key. |
baa054c to
020a32f
Compare
Inspect solver wrapping the inspect_swe coding agents (claude_code, codex_cli, gemini_cli, mini_swe_agent) so they can run any asta-bench task. Model API calls and task tools are proxied back to Inspect via sandbox_agent_bridge; task MCP tools reach the agent as mcp__astabench_*. install_asta_skills="asta"|"asta-preview" passes the bundled asta-plugins skills (cloned host-side by setup.sh at a tag matching the asta image) through inspect_swe's standard skills= plumbing, and filters paper-search MCP tools with a 1:1 asta papers CLI subcommand from the bridge so the agent has one canonical path. The solver reads state.metadata["insertion_date"] and seeds ASTA_INSERTED_BEFORE / ASTA_PUBLICATION_DATE_RANGE on the agent env per sample so the asta CLI subprocess honors the same cutoff astabench's MCP wrapper applies. A bridge GenerateFilter strips model-provider-side web tools (WebSearch/WebFetch and provider variants) from every model API request.
020a32f to
4f840dd
Compare
|
|
||
| ## Stale containers | ||
|
|
||
| When a run is killed mid-flight (Ctrl-C in the wrong place, OOM, hard signal), inspect_ai's `finally`-block container cleanup may not finish — sandbox containers stick around as `tail -f /dev/null` and accumulate, eventually exhausting Docker Desktop's VM and causing OOM kills on subsequent runs. |
There was a problem hiding this comment.
fwiw I've seen this a while back although I don't recall it OOMing at the time. The fundamental issue is that astabench eval uses subprocess.run which SIGKILLs the child on interrupt. Could be worth fixing durably on the agent-eval side if we're at a point where we're writing troubleshooting documentation for it.
The previous setup.sh cloned asta-plugins separately and tried to keep ASTA_PLUGINS_REF in sync with ASTA_IMAGE by tag-name convention. That breaks for :latest (no matching git ref), digest pins (the tail isn't a git ref), and any image tag without a 1:1 plugins tag — and even when both refs name the same release, nothing structurally prevents the host-side clone from drifting out of sync with what the image actually has baked in. The asta image already contains the canonical asta-plugins source repo at /opt/asta-plugins (per the asta-plugins Dockerfile: COPY . /opt/asta-plugins). Source the host-side skill trees from there via 'docker run --rm <img> tar' streamed into .vendor/asta-plugins/. ASTA_IMAGE becomes the single source of truth for both the CLI runtime and the host-loaded skill files; skew is structurally impossible *as long as setup.sh has been run for the current ASTA_IMAGE*. To close the remaining drift window — operator changes ASTA_IMAGE between setup.sh and inspect eval without re-running setup — setup.sh stamps the resolved image ID into .vendor/asta-plugins/.image-id, and _resolve_bundled_skills compares it against $ASTA_IMAGE's docker ID at solver construction. Mismatch raises with a clear 're-run setup.sh' message. This generalizes the existing _check_plugin_image_version_match preflight (semver tags only) to all image forms — :latest and digest pins are now covered.
|
Replaces the host-side The original clone setup couldn't keep A second drift window — operator changes Tests: +5 covering no-stamp / no-env / no-docker / matching-IDs / mismatch. Suite is 19 baseline → 24. |
Summary
Adds an Inspect solver wrapping the
inspect_swecoding agents (claude_code, codex_cli, gemini_cli, mini_swe_agent) so any of them can run any asta-bench task. The agent runs in the sample sandbox; model API calls and task tools are proxied back to Inspect viasandbox_agent_bridgeso token usage / transcript / model aliases / MCP tools flow through the standard Inspect path.Coding agents see two surfaces for asta:
snippet_search,get_paper,table_editor,python_session, …) reach the agent asmcp__astabench_*.-S install_asta_skills=asta|asta-preview) — a more native surface for coding agents:setup.shclonesasta-pluginsat a tag matching the asta image into.vendor/, the solver passes the bundled skill dirs through inspect_swe's standardskills=plumbing (each agent's wrapper handles its own discovery path), and paper-search MCP tools that have a 1:1asta papersCLI subcommand are filtered out of the bridge so the agent has one canonical path. Non-paper MCP tools and MCP tools without a CLI equivalent (get_paper_batch,search_paper_by_title) always bridge. (Needs Bring bundled skill frontmatter into Agent Skills spec compliance asta-plugins#56 —fix/skill-frontmatter-spec-compliance— shipped in a tagged release so the bundledSKILL.mdfiles passinspect_ai.tool.read_skillsvalidation.)The solver reads
state.metadata["insertion_date"](populated by allenai/asta-bench#151 —expose-insertion-date-metadata) and seedsASTA_INSERTED_BEFORE/ASTA_PUBLICATION_DATE_RANGEon the agent's env per sample, so the asta CLI subprocess honors the same cutoff as astabench's MCP wrapper. (ASTA_INSERTED_BEFOREonasta papers snippet-searchreads via allenai/asta-plugins#57 —feat/date-broker;ASTA_PUBLICATION_DATE_RANGEreads onasta papers get/search/citationsalready work againstv0.16.0+.)An
inspect_aiGenerateFilterplumbed through the bridge strips model-provider-side web tools (WebSearch/WebFetchand provider variants) from every model API request — they execute on the provider's infrastructure and aren't reachable from inside the sandbox. Tasks can still wire astabench's cutoff-aware native search (make_native_search_tools(inserted_before=...), already used bylitqa2/sqa/paper_finder) intostate.tools; those bridge asmcp__astabench_*and survive the filter. Agent subprocess access to external hosts (curl,wget, Pythonrequests) is unrestricted at the sandbox layer in this PR.Validation
One
LitQA2_FullText_validationsample (claude_code + sonnet-4-6) run for each of the threeinstall_asta_skillssettings, e.g.:inspect eval astabench/litqa2_validation \ --solver agent_baselines/solvers/inspect_swe/agent.py@inspect_swe_solver \ --model anthropic/claude-sonnet-4-6 \ --sandbox docker:solvers/inspect-swe/sandbox_compose.yaml \ -S agent=claude_code -S install_asta_skills=asta \ --limit 1All three runs exit with
status: success. With the asta-bench prereq dev-installed locally, the eval log also showsSample.metadata.insertion_date = "2024-10-17"reaching the solver.inspect viewshows the surfaces each run actually used. Wheninstall_asta_skillsis set, inspect_swe installs the bundled skills by writing eachSKILL.mdinto the agent's skill-discovery path inside the sandbox — those appear aswrite_fileevents in the log:install_asta_skills=None(default, MCP-only path) — nowrite_fileevents to/app/.claude/skills/; the agent issued 19mcp__astabench__*calls (mix ofsearch_papers_by_relevance,snippet_search,get_paper) and received real paper data (paperId,corpusId,title,abstract, …) back. 0Object of type ContentText is not JSON serializableerrors — the bridged-MCP serialization fix in inspect_ai 0.3.220 (this PR pinsinspect_ai>=0.3.220for that reason) makes the MCP path usable; older versions fail every bridged MCP call.install_asta_skills="asta"—write_fileevents drop the bundled asta plugin'sSKILL.mdfiles into/app/.claude/skills/<skill>/; the agent invokesSkill(skill="semantic-scholar", …)and then runs Bashasta papers snippet-search "…" --limit 10(×N, refined queries) andasta papers get CorpusId:58004838 --fields title,abstract,year --format text.install_asta_skills="asta-preview"—write_fileevents drop the asta-preview plugin's larger skill set into/app/.claude/skills/<skill>/(analyze-data, artifacts, local-paper-index, pdf-extraction, preview, research-step, semantic-scholar, workspace, …); the agent again choseSkill(skill="semantic-scholar", …)and then ran manyasta papers snippet-search/search/getBash calls.Merge order
The three referenced PRs are independent on GitHub but ordered by what each one ships through:
fix/skill-frontmatter-spec-compliance) and Add date-cutoff env vars to papers subcommands asta-plugins#57 (feat/date-broker) — parallel; both targetasta-plugins:main.asta-pluginstag containing both, and build/publish a newghcr.io/allenai/astaimage pinning that tag.expose-insertion-date-metadata) — independent; can land any time, only gates whether per-sample cutoff metadata is populated.ASTA_IMAGEdefault in this PR'ssolvers/inspect-swe/README.md+sandbox_compose*.yamlto the new tag and merge.setup.shclonesasta-pluginsat${ASTA_PLUGINS_REF:-$ASTA_IMAGE_TAG}, so the same bump aligns the host-side skill source.