pypi / pydantic-monty
pydantic-monty
What changed in pydantic-monty 0.0 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
34 breaking7 security129 new APIs and options13 performance34 behavior and defaults6 tooling96 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpydantic-monty 1135 changes
Breaking changes 16
Protocol roles are renamed from parent/child to client/worker.
Rust 1.98 is required so macOS 27 builds load.
Container repr raises
MemoryErrorinstead of truncating.Date arithmetic outside the supported range raises
OverflowError.The sandbox fails empty paths instead of resolving them to the current working directory.
Removing the filesystem root is refused.
A result that cannot be converted to Python raises
MontyRuntimeError.Directory creation counts against a mount's write-bytes limit.
Rejects renaming a directory into one of its descendants.
re.split() results now include capture groups.
Rejects a script path that collides with the type stubs file.
With ag-ui-protocol >= 1.0, converts binary input parts to image, audio, video, or document content; parts missing a MIME type or payload still raise.
Dumps switch from postcard to CBOR.
AutoOsCallsis renamed toOsPolicy.Session
max_durationis replaced with feed and turn limits.Wire types are restricted to a whitelist; other values use a proxy.
Security 3
Remote server certificates are verified with the operating system's trust store.
Rejects a file replacing a directory, regardless of operation order.
Resource limit checks were added for binascii and base64 operations.
New APIs and options 50
The filesystem protocol adds exclusive file creation.
annotationlib,get_type_hintsformats, and PEP 563 handling are added.CPU execution limits and supervision can be configured per pool.
date.fromtimestamp()is added.datetime.fromtimestamp()is added.File imports are added.
The
fnmatchmodule is added.A gRPC transport is added.
json.dumps()supports thedefault=argument.Hosts can lower the protocol decode budget.
Rust hosts can set session telemetry parents.
PEP 649
__annotate__is supported.typing.get_type_hints()is added.Adds the decimal module.
Adds a WebSocket pool to the napi JS client.
The bisect module is now available.
The csv module is implemented and available to Monty programs.
Dataclasses support field(), default_factory, and __post_init__.
The hashlib module is implemented and available to Monty programs.
Host calls can now be imported.
json.dump is available.
json.load is available.
Match statements are now supported.
The os.path module is implemented and available to Monty programs.
Path.scan is available as an os call.
The tomllib module is implemented and available to Monty programs.
Adds the complex type.
asyncio.sleep()is added.Sessions gain auto-resume.
Automatic OS calls are added.
Percent formatting is supported for string and bytes format strings.
The copy module is added.
Current working directory support is added.
Ephemeral sessions are supported.
eval()is implemented.exec()is implemented.The
format()builtin is implemented.locals()is implemented.Remaining math aggregation functions are implemented.
fmais implemented in the math module.An
os.urandomhost call is added.The random module is added, along with an
os.urandomhost call.Runtime definitions such as
tuple[int, str]anddict | dictare supported.Sessions can be forked.
Sessions gain IDs, forking, ephemeral sessions, and auto-resume.
The sys constants with known values are implemented.
The time module is extended.
time.sleep()is added.time.time()is added.Timezone support is added.
Performance 7
Repeating an empty list or deque returns at once.
Binary arithmetic adds numeric fast paths.
Sorting uses a port of CPython's timsort.
Reduces allocations when formatting floats with f-strings and
%.Makes len and indexing O(1) on ASCII heap strings.
F-string concatenation now optimizes buffer preallocation and refcount churn.
Sequence unpacking was optimized to use direct unpacking.
Behavior and default changes 16
Async host calls start without waiting for the host.
The first request behind Configure is sent without waiting for its reply.
File-import search is capped at 32
__path__directories.Enclosing bindings are collected from function defaults.
A function's repr no longer puts quotes around its name.
The pool refills to
min_processesin the background.Pool workers are recycled after 1000 checkouts by default.
Monty can now build for 32-bit targets.
File objects are now iterable.
The binary module is now loaded eagerly at package import.
Sets and frozensets now support ordering comparisons.
Many more dunder methods are now supported on user instances.
Skips message roles, input content types, or media source types introduced by a newer protocol version, with a warning, rather than failing the whole request.
Await handling becomes eager.
Monty drops its experimental framing ahead of v1.
The source position of every suspension is reported.
Tooling 1
Wheels are built for Python 3.14t.
Fixes and other changes 42
Index searches start at the requested offset.
Pathlib errors now match CPython's.
Client failures are exposed as typed failures, and remote error details are preserved.
Checkouts can confirm subprocess termination.
Its repr falls back to insertion order when counts cannot be ordered.
Updating an entry preserves its original key.
Only spaces and tabs are stripped before
eval()source.Exceptions record
__cause__and__context__.float()now supports bytes arguments.json.dump()supports thedefault=argument.Restored sessions apply the checkout's OS policy.
Text appends to byte-backed files are fixed.
Intermediate files are reported as
NotADirectoryError.MemoryFile growth is capped.
Formatting with custom numeric classes is fixed.
Regex patterns are parsed with CPython's grammar.
Stat results preserve file types when special permission bits are set.
Out-of-range bounds are handled correctly.
The Python client preserves WebSocket disconnect diagnostics.
Preserves snapshots when auto-resume is rejected.
Preserves OSAccess state when a path is renamed to itself.
Matches Python's line-boundary behavior when splitting strings.
Float format precision is capped at INT_MAX - 1024, matching CPython 3.14.8.
JavaScript print callbacks no longer swallow thrown null.
List slice assignment is now supported.
open() now honours its newline argument.
Restored session budgets are capped at the destination limits.
Treats bool values as int values in arithmetic expressions.
Scans raise, assert, and except expressions for closure captures.
Fixes octal escapes in the re module.
The module gains uu, quoted-printable, and CRC-16 conversions.
casefoldand other case methods gain improved compatibility.date.today()is answered during standard execution.datetime.now()is answered during standard execution.Exception classes are resolved directly and modeled inbound.
Integer/float arithmetic on long integers and float power overflow match CPython.
The math module accepts long integers.
Container growth is checked against the memory limit before allocation.
pow()accepts long integers.print(file=sys.stderr)is supported.round()accepts long integers.Unpacking supports attribute and subscript targets.
pydantic-monty 0.0184 changes
Breaking changes 18
A stalled async scheduler now raises instead of aborting.
Mutating a dictionary's size during iteration now raises
dictionary changed size during iteration, including on last-element mutation.Unknown keys in the limits dict are now rejected instead of silently ignored.
The CLI no longer includes logfire by default.
The peek module has been removed.
Raises RuntimeError when a coroutine is reused across gathers.
Renames external_lookup and changes its behaviour.
Removes max_allocations from resource limits.
Moves mounting to the host side and moves fs to monty-fs.
Renames the monty-cli crate to monty-runtime.
Rejects open modes that specify no action.
Only swallows AttributeError, allowing other exceptions raised during attribute lookup to propagate.
Enforces Monty's BigInt limits for JSON integers, including the natural JSON BigInt path.
Renamed prefix_code to type_check_stubs; developers should use the new name.
Source containing lone surrogates now raises MontySyntaxError.
The scheduler is now required.
The external_functions parameter is removed; external functions are detected automatically with NameLookup.
Changed the exceptions raised when using LongInt.
Security 4
Mounts are confined with cap-std descriptors instead of path checks, with follow-up fixes to confinement defects.
Caps CollectString and CollectStreams so print loops cannot exhaust host memory.
Input safety changed; the notes do not specify further details.
Fixes a leak in id().
New APIs and options 79
Adds the itertools adaptor accumulate.
Adds the itertools adaptor batched.
Implements str.format.
Adds the itertools adaptor zip_longest.
Adds the
base64module, including the ascii85 pair.Supports the
eqargument to@dataclass.Supports the
frozenargument to@dataclass.Implements
datetime.time.Adds
functools.partial.Adds the
functoolsmodule withreduce.Adds the
dropwhileitertools adaptor.Adds the
filterfalseitertools adaptor.Adds the
starmapitertools adaptor.Adds the
takewhileitertools adaptor.Adds
object.__setattr__, a hook-bypassing write.Adds
max_suspensions, enforced by the host viaAbortFeed.Supports sending custom headers on the WebSocket transport.
Adds protocol version utilities.
Adds collections support for deque, namedtuple, defaultdict, and Counter.
Native @dataclass definitions are now supported inside the sandbox.
A file handle API is now available for TypeScript.
Function decorators are now supported.
Adds itertools support including count, repeat, pairwise, compress, islice, chain, and cycle.
Adds raw wire-level turns to monty-pool.
os.listdir and filesystem wrappers are implemented in the os module.
The package is split into a metapackage over client and runtime.
Adds memory limits for async execution.
Adds support for class decorators.
Adds encode and decode codecs and error types.
Iterator helpers manage recursion and time.
Adds __name__ and related names.
Adds resume_auto() to iteratively drive feed_start snapshots.
Experiments with StringBuilder to guard strings under construction.
Adds the unicodedata module.
Adds support for user-defined classes.
Adds a websocket protocol.
Adds bindings for Dart and Flutter.
Adds the open builtin and buffered open() methods, with limitations, so Monty code can open files.
Adds context manager support for code using with statements.
Implements the setattr builtin function.
Added support for chain assignment.
Added the hasattr builtin function.
A Monty instance can now be built asynchronously and without holding the GIL.
Added methods for calling Python functions from Rust.
Added ExternalExceptionData.
Added
mounton start.Added
oson start.Adds CollectStreams for print_output.
Adds CollectString for print_output.
Adds strict mode to zip() to enforce equal lengths of iterables.
Async support is available in Rust.
Filesystems can now be mounted.
The datetime feature is implemented.
A limit is added for BigInt string conversion.
A json module is added.
Named single keyword arguments are supported.
Nested subscript assignment is supported.
The str.expandtabs(tabsize) method is implemented.
The CLI accepts arguments to set resource limits.
Dict views and set/frozenset operators are implemented.
The filter builtin function is implemented.
The getattr builtin function is implemented.
The full Python math module, with about 50 functions, is implemented.
The re module is implemented.
Tuple comparison supports <, >, <=, and >=.
Added asyncio run.
Added builtin resolution.
Implemented dataclass methods.
Implemented the map builtin function.
Implemented calling of user-defined functions.
REPL execution can now be suspended.
Adds a linux-arm64 target for the JavaScript binding.
Adds a printer callback for the JavaScript binding.
Added support for namedtuple fields.
Added support for os.environ.
Added support for property.
Added support for star unpacking.
Bigint literals are supported.
Pseudo filesystem support is added.
Performance 6
An empty tuple singleton no longer contributes to the memory limit.
Added cheaper sourcemaps.
Improves type checking performance.
JSON performance improvements may make JSON operations faster.
Implemented optimizations for small tuples.
The GIL is released when printing with Python.
Behavior and default changes 18
Print output in the worker is debounced.
Class __annotations__ are now populated with stringized annotations.
The / operator now supports Path / Path and reflected str / Path.
The wire protocol is now versioned independently of the package.
Adds pytest-style assert failure messages.
Allows any iterable after * instead of only five container types.
Moves execution to a subprocess pool.
Supports multi-level closure capture.
Adds limits on F-string precision.
In monty-js, allocation limits can exceed u32::MAX.
In monty-js, GC interval limits can exceed u32::MAX.
In monty-js, maxMemory limits can exceed u32::MAX.
In monty-js, recursion depth limits can exceed u32::MAX.
Added natural JSON support in MontyObject.
Import statements now support importing multiple modules, such as import a, b, c.
PEP 448 generalised unpacking is implemented.
In-place mutation is not supported for str and bytes.
Adds a depth guard, affecting how deeply Monty can execute nested operations.
Tooling 5
Teaches the type checker about iter and next.
Adds type checking in the REPL.
Memory growth is tracked in mutable container operations.
The REPL gains line editing and history through rustyline.
Type stubs are being added, providing type information for developers using the package.
Fixes and other changes 54
A failing
gathernow leaves its sibling tasks running.Dispatches
__index__for indexing, slicing, and integer arguments.REPL input now continues after decorators and for triple-quoted strings.
Wire validation now accepts multi-line spans.
The in operator now works for bytes.
User-defined __iter__, __next__, and __contains__ methods are now dispatched.
Implements NotImplemented and uses it for user equality.
Bounds native evaluate_function re-entry to prevent infinite recursion.
Improves error messages for suspensions in evaluate_function.
Improves f-string support.
Reintroduces the feed_start API for Python and JavaScript.
Returns an error instead of panicking when reading the ForIter heap.
Fixes interactions involving global names, function scopes, and the REPL.
Includes argument fixes for int(), str(), and round().
Implements iter(callable, sentinel).
Makes an existing iterator self-iterable.
Fixes type-object marshalling across the sandbox boundary.
Fixes exception propagation from async external functions.
Fixes a panic when a function has duplicate parameter names.
Uses name-based identity and equality for external function values.
Rejects reuse of an already-awaited external future via gather.
Fixes a panic when a coroutine is duplicated in gather.
Avoids a panic when the key callback mutates the list being sorted.
Prevents the OpenFile buffer_meta cache from being serialized across snapshots.
Adds local/global store operations for comprehension expressions in the REPL.
Deduplicates source lines in tracebacks.
Implements trial deletion to collect cycles and properly release references held by values in cycles.
Fixes the GC interval being ignored in ResourceTracker and Heap.
Fixes panics when negating i64::MIN overflows.
Fixed panics during partial future resolution in mixed gathers.
Input Unicode conversion errors are now wrapped as MontyRuntimeError.
Fixed a panic when parsing source files with lines larger than u16::MAX.
Corrected the types for datetime os calls.
Corrected the type for
not_handled.Fixes mount edge cases.
Stack-depth tracking after break or continue in unreachable code is fixed.
max() supports keyword arguments and the default argument.
dict supports dict(iterable, **kwargs), and dict(zip(...)) is fixed.
A VM panic is fixed when a function parameter shadows an outer local variable.
Builtin calls are supported in module attributes.
A panic in os.environ is fixed in the JS bindings.
JS runMontyAsync forwards printCallback.
The REPL session is preserved when runtime errors occur in start or resume.
Comparison operations are implemented for str and bytes.
Augmented assignment is supported on subscript targets.
Fixed async stack overflow.
Fixes a TypeError when comparing heap-allocated strings.
Handles i64::MIN division overflow in //, %, and divmod().
Enforces max_duration better.
Fixed AST depth overflow.
Improved getattr support, allowing developers to use it more reliably.
Included wrapper.js and wrapper.d.ts in the npm package.
Syntax fixes may affect code accepted by the implementation.
The TypeScript implementation is brought to parity with the Python implementation.