Skip to content

Let grader images set a default sandbox timeout - #64

Merged
eliotwrobson merged 2 commits into
torch-tensor-supportfrom
torch-grader-defaults
Nov 26, 2026
Merged

eliotwrobson merged 2 commits into
torch-tensor-supportfrom
torch-grader-defaults

Conversation

@eliotwrobson

@eliotwrobson eliotwrobson commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Lets a grader image bake in a more sensible default sandbox timeout that questions can still override — the mechanism the :torch image needs.

  • ConfigObject.sandbox_timeout now defaults to None ("use the image/global default") instead of 1.0.
  • The plugin resolves an unset timeout from the PL_GRADER_SANDBOX_TIMEOUT environment variable, falling back to 1.0s. An explicit sandbox_timeout in a question's ConfigObject (or the module-level variable / marker) always wins.

Precedence: explicit per-question value → image env default → 1.0s.

Testing

  • New unit tests for _default_sandbox_timeout(): unset env, valid env, and invalid/non-positive env (ignored with a warning).
  • Updated the default-config test for the None sentinel.
  • Full suite green (361 passed) on Python 3.13; mypy clean.

Stacked on #63.

🤖 Generated with Claude Code

ConfigObject.sandbox_timeout now defaults to None, meaning 'use the image/global
default'. The plugin resolves an unset timeout from the PL_GRADER_SANDBOX_TIMEOUT
environment variable (falling back to 1.0s), so an image can bake in a more
sensible default while questions keep full control by setting an explicit value.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@eliotwrobson
eliotwrobson marked this pull request as ready for review November 26, 2026 04:45
@eliotwrobson
eliotwrobson merged commit 683d710 into torch-tensor-support Nov 26, 2026
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.

1 participant