Skip to content

fix: keep the smoke runner alive when jupyter is missing - #133

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/smoke-runner-jupyter-guard-3sxcc0
Aug 6, 2026
Merged

fix: keep the smoke runner alive when jupyter is missing#133
Jammy2211 merged 1 commit into
mainfrom
claude/smoke-runner-jupyter-guard-3sxcc0

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Sibling of PyAutoLabs/autolens_workspace#471 — tracking issue PyAutoLabs/autolens_workspace#470. Identical patch.

What changed

.github/scripts/run_smoke.py::execute_notebook shelled out to a bare jupyter argv with no FileNotFoundError guard. On a machine without jupyter the exception escaped main(): the run died with a raw traceback at the first notebook entry, printed no === Smoke test summary === line, and left every remaining entry silently uncovered. The script leg was never affected — it invokes sys.executable, which always exists.

That is a contract break, not just a missing optional tool: the runner is documented (module docstring, and this repo's AGENTS.md) to continue through failures and always end with the summary line. CI never saw it because the runner images always ship jupyter, so it only bit a local sweep — where it looked like a crash and quietly discarded coverage.

The fix catches FileNotFoundError and reports the entry as a failure with exit 127 and an actionable message. Three details worth review attention:

  • The guard nests inside the existing try/finally, so the staged notebook copy and temp dir are still cleaned up.
  • run_notebook's early return sits before the is_clean_skip_exit branch, so an absent executor can never be laundered into a PASS.
  • It also skips the regenerate-and-retry, which cannot help when the executor itself is missing.

Scope

Only three of the 10 run_smoke.py copies carry the notebook leg — this repo, autogalaxy_workspace, autolens_workspace. The other seven have no execute_notebook at all and cannot hit this bug. The identical patch went into all three; this repo and autolens_workspace were byte-identical before and remain so.

Consolidating the copies is deliberately not done here — it is owned by a separate PyAutoMind prompt, re-scoped in the same session after measurement showed its premise was stale. Full rationale in PyAutoLabs/autolens_workspace#471.

Verification

jupyter is genuinely absent in the session container, so the original traceback was reproduced first, then the real runner re-run: exit 1, both notebook entries [FAIL (exit 127)] with an actionable message, all 10 entries executed and counted, summary line printed, no escaped traceback. Normal path confirmed unchanged with a stub jupyter exiting 3 — reported 3, not 127, and still retried.

Caveat: the PyAuto libraries are not installed in that container, so every script entry also failed on ImportError. Unrelated to this change — and it is the ideal evidence, since it exercises the continue-through-failures path the fix defends. Not evidence that those scripts are broken; CI has the libraries and is the real check.

Scripts Changed

None — scripts/ is untouched, so no notebook regeneration is needed. Only .github/scripts/run_smoke.py changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LWj2zyGu6ptvqTS8drWhaJ


Generated by Claude Code

execute_notebook shelled out to a bare `jupyter` argv with no
FileNotFoundError guard, so on a machine without jupyter the exception
escaped main(): the run died with a raw traceback at the first notebook
entry, printed no `=== Smoke test summary ===` line, and left every
remaining entry silently uncovered. The script leg was never affected --
it invokes sys.executable, which always exists.

That is a contract break, not just a missing optional tool: the runner is
documented (module docstring, workspace AGENTS.md) to continue through
failures and always end with the summary line. CI never saw it because the
runner images always ship jupyter, so it only bit a local sweep -- where it
looked like a crash and quietly discarded coverage.

Catch FileNotFoundError and report the entry as a failure with exit 127 and
an actionable message. The check in run_notebook sits before the
is_clean_skip_exit branch so an absent executor can never be laundered into
a PASS, and it skips the regenerate-and-retry, which cannot help when the
executor itself is missing. The guard nests inside the existing try/finally,
so the staged notebook copy and temp dir are still cleaned up.

Verified with jupyter absent: every entry runs and is counted, notebook
entries report [FAIL (exit 127)], the summary line prints, and the runner
exits non-zero. With a stub jupyter that exits 3 the runner still reports 3
and still retries, so the normal path is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LWj2zyGu6ptvqTS8drWhaJ
@Jammy2211
Jammy2211 merged commit eef1d88 into main Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants