Osprey Agent: a Coding Agent on the pydantic-ai Port
The pydantic-ai agent engine is ported to Osprey's Python flavor, and a desktop coding agent runs on it with real file and command tools.
Language design and implementation notes.
The pydantic-ai agent engine is ported to Osprey's Python flavor, and a desktop coding agent runs on it with real file and command tools.
Computer-use agents squint at screenshots; browser agents read the page's accessibility tree. Osprey's UI machines give every native control a role and a label, so tests and agents find the Play button by name and press it with real pointer events, with no window, browser or device.
Chrome only casts a tab, and macOS has no Cast button. This native Mac player finds your Chromecast or Google TV, plays an MP3 on it with full controls, and puts a moving spectrum on the TV instead of a still picture.
GPUI is the GPU-rendered Rust UI framework behind the Zed editor. Osprey's UI machines put a whole GPUI app's interface in one data file: parallel state machines, a view, and skins drawn from an image atlas. The only code left is a small adapter.
Static typing catches the wrong value before the program runs; dynamic typing finds out when that line executes. Osprey's Python flavor keeps def, lambda and f-strings, and infers every type and checks it at compile time. Here it is on a real 1,262-line port of a Chromecast sender.
Osprey Native now has a GPUI host: the application is Osprey, Zed's Rust UI framework draws it with the GPU. A boids game holds 120 fps on an M4 Max, and a port of GPUI's painting example matches the Rust original pixel for pixel.
Osprey's Python-flavor ports compile as Osprey packages. Real Python dependencies use uv. Here is how effects, scoped package names and verified locks connect the two.
Give Osprey Hunt a program and an input bound. It explores branches with KLEE, records a failing input, and checks whether a native build reproduces the crash.
GPT-2 generation in Osprey’s Default and Python syntax flavors, with CPU and GPU handlers. Recorded Apple M4 Max measurements include a 3.3× training-step speedup on Metal.
Osprey handlers are now ordinary values, operations declare whether they can be abandoned, and integer overflow is an effect the compiler makes you handle.
Exceptions and panics turn ordinary control flow into hidden exits. Osprey makes expected failure explicit with Result types and algebraic effect handlers.
Semantic versioning records maintainer intent, not compatibility proof. Osprey's package plan proposes exact identity, compatibility epochs, and downstream testing.
Osprey ships opt-in Perceus automatic reference counting. The compiler inserts ownership operations, and the runtime reclaims values as owner counts reach zero.
Every Osprey flavor lowers its concrete syntax tree into one canonical AST.
Osprey now ships persistent List<T> and Map<K,V> backed by a 32-way bitmapped vector trie and a HAMT — the same data structures that power Clojure and Scala. Append, set and remove are O(log32 n); old versions of a collection stay valid in O(1) extra space.
Osprey-managed values are memory-safe; C calls cross that boundary.
Use union variants to represent API outcomes and match each case explicitly.