You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bundle ProvisionedInstance through the sandbox env (#16)
* Collapse cleanup-provider resolver and defer Ubuntu AMI lookup
`_resolve_cleanup_provider` duplicated `_resolve_provider`; the three
cleanup paths now share the latter. `_find_ami_ubu24` moves from
`schema.py` to `_instance_provider.py` and is called lazily from
`DefaultEc2InstanceProvider.create_instance`, cached per region on the
class so subsequent samples (and `cli_cleanup`) don't repeat the SSM
lookup. `from_settings()` is now a pure-Python operation and no longer
takes a `session` argument.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Keep from_settings(session=) backwards-compatible; note AMI cache lifetime
from_settings dropped its session parameter, which turned any external
caller passing session= into a pydantic ValidationError. Restore it as
an accepted-but-ignored kwarg so callers (e.g. custom Ec2InstanceProvider
wrappers) don't break; AMI resolution stays deferred either way.
Also document that the per-region AMI cache is intentionally never
invalidated (short-lived process, one AMI per run is desirable).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Make from_settings reject session (and other unknown kwargs) loudly
Reverses the previous commit's silent-compat approach. Dropping the
session parameter alone didn't break callers: pydantic BaseModel
defaults to extra="ignore", so session= (and any typo'd override) was
silently swallowed by **kwargs and dropped. That silent no-op is worse
than a clean break — a caller passing a session thinks it's used.
Validate kwargs against the model's fields and raise TypeError on any
unknown key. session= now fails loudly; this is the intended breaking
change (documented in CHANGELOG).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Use pydantic extra="forbid" instead of manual kwarg validation
More idiomatic than the hand-rolled set-diff: the model now rejects
unknown fields at construction, so a stale from_settings(session=...)
or any typo'd override raises a ValidationError instead of being
silently dropped (pydantic's default is extra="ignore"). Also catches
bad keys in a user-supplied config dict via config_deserialize.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* shut UP
* tersify
* Bundle ProvisionedInstance through the sandbox env
`region` was an explicit parameter on the env constructor, on the
sample-cleanup tracker (Set[Tuple[str, str]]), on the provider's
find_sandbox_instances(), and on the cli_cleanup fallback dance. All of
those were really one piece of information — instance metadata —
travelling alongside instance_id.
Pass ProvisionedInstance through whole:
- frozen so it can sit in a Set
- Ec2SandboxEnvironment.__init__ takes one (with flat self.X aliases
for the rest of the file's reads)
- _tracked_instances is Set[ProvisionedInstance]
- find_sandbox_instances() drops its region param; the default impl
derives it from its own config (with AWS_REGION fallback for the
cli_cleanup path that builds an empty config)
- cli_cleanup drops the fallback_region env-var read
terminate_instance(instance_id, region) keeps its signature: region is
the instance's own region, which a control plane in a different region
(e.g. the Lambda-backed provider) needs to route the call.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* tidy changelog
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments