add autobuild repro_command for triage script reproduction#90
Merged
Conversation
Emits the exact `(cd <ws> && env KEY=val ... python3 <script>)` command
autobuild would have used to run a single workspace script — same defaults
+ per-pattern overrides as `env_config.build_env_for_script`, but starts
from `{}` instead of `os.environ.copy()` so the output is portable across
shells.
Intended for triage handoffs: when pasting a failing script into a chat
or issue, the reader gets a self-contained reproduction that matches
autobuild's environment exactly (PYAUTO_TEST_MODE, PYAUTO_SMALL_DATASETS,
etc.), not just `python3 <file>` which silently omits them.
Wired into the dispatcher under a new "Triage support" section. Verified
end-to-end against the 2026-05-20 release-prep run: spot-check of the
Cluster A `imaging/visualization.py` failure reproduces the recorded
`AssertionError: dataset.png missing` verbatim.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
autobuild repro_command <script>— a small helper that emits the exact shell command autobuild would have used to run one workspace script, including the env vars from the workspace'sconfig/build/env_vars.yaml. Solves a recurring triage-handoff pain point: when pasting failing scripts into chats or issues, the chat-side reader couldn't reproduce the failure becausepython3 <script>omits the autobuild-injected env (PYAUTO_TEST_MODE,PYAUTO_SMALL_DATASETS,PYAUTO_FAST_PLOTS, etc.) and per-patternset:/unset:overrides. The new helper emits a self-contained one-liner like(cd <workspace> && env KEY=val ... python3 <script>)so the chat-side reproduction matches autobuild's environment exactly.API Changes
None — internal additions only. New shell subcommand
autobuild repro_command, new Python moduleautobuild/repro_command.py, and one dispatcher edit (bin/autobuild). No existing functions, classes, or arguments are modified.See full details below.
Test Plan
pytest tests/test_repro_command.py -q— 7 tests pass (defaults emission, set-override precedence, unset removal, no-match pass-through, script-not-found error, no-workspace-root error, empty env_config)bash bin/autobuild help repro_command— prints the new docstringbash bin/autobuild help— listsrepro_commandunder a new "Triage support" sectionautogalaxy_workspace_test/scripts/imaging/visualization.pyandautogalaxy_workspace/scripts/guides/results/start_here.py) — env diff matches the workspaceenv_vars.yamlexactly, including chained substring-matched override unsets (guides/+guides/results/)AssertionError: dataset.png missingmatching the recordedreport.jsonfailureFull API Changes (for automation & release notes)
Added
autobuild/repro_command.py— new module exposingrepro_command(script_path) -> strandcanonical_env_for_script(file, env_config) -> dict. The CLI entry pointmain(argv=None) -> intis invoked by the dispatcher.autobuild repro_command <script_path>— new shell subcommand wired throughbin/autobuildunder a newTriage supportsection.Migration
🤖 Generated with Claude Code