← All posts
October 23, 2026

Nexa 2.4.0: from language declarations to reliable agent execution

v2.4.0ReleaseHarness Native

Nexa lets humans and models express agents, tools, protocols and control flow in the same .nx program. Version 2.4 connects that language to a shared compiler and a reliable execution lifecycle.

The Python distribution, source package and checksums are available in the 2.4.0 GitHub Release. The full source archive also includes the Rust AVM, examples and tests.

One compiler, one execution lifecycle

CLI, SDK and embedded API now share recursive include resolution, AST normalization, source diagnostics and generated Python checks. AgentRunner handles text, structured output, streaming, tools, budgets and terminal states through one execution path.

Native Chat Completions, Responses and Anthropic adapters retain their protocol state, including opaque reasoning items and signed thinking blocks. Explicit run states make completion, failure, approval, timeout and budget exhaustion visible to callers.

Approvals and recovery follow the actual work

Tool dispatch checks the declared exposure set and argument schema before execution. High-risk tools wait for explicit approval. SQLite checkpoints record revisions, pending calls, usage and a tool journal.

The journal records a tool start before an external effect. Completed results can be reused during recovery; uncertain outcomes require reconciliation. Nexa Code uses this path to read a workspace, request approval for changes, edit files and run verification commands.

For follow-up tasks, NexaAgent.continue_run() creates a new run from settled conversation history with fresh budgets, deadlines and approvals. Native provider history is retained, and parent/session identifiers connect the evidence across turns. Editor integrations can use the original declaration locations returned by inspect --format json.

Install the official wheel

Use Python 3.10+ in an activated virtual environment:

python -m pip install https://github.com/Nexa-Language/Nexa/releases/download/v2.4.0/nexa_lang-2.4.0-py3-none-any.whl
nexa --version

The nexa-lang name on PyPI belongs to another project. Install using this exact GitHub URL. Optional Anthropic, terminal and MCP dependencies are covered in the installation guide.

Save this as hello.nx, then run nexa run hello.nx. It prints 42 without model credentials:

flow main {
    result = 23 + 19;
    print(result);
}

Verification with a stated scope

The local macOS arm64 / Python 3.12.13 snapshot passed 2,187 Python tests; five PostgreSQL cases were skipped and three benchmark cases excluded. Rust passed 141 tests with default features and 144 with WASM. The example inventory contains 63 compiling programs and 12 historical drafts with recorded reasons.

Tests exercise real subprocess crashes, MCP stdio sessions, file edits, approvals and verification commands. The model responses are deterministic fixtures. Real-provider authentication, compatibility, quality, cost and latency remain to be measured; MCP HTTP server end-to-end testing is also pending.

Read the verification record for environments, commands and logs. CI covers Python 3.10/3.12/3.14 and Rust default/WASM on Linux.

Historical syntax still has execution gaps in struct/enum construction, flow requires/ensures and defer. The runtime contract records these limits and the behavior of flow return values and JSON text.

Migration and supported boundaries

See the complete release notes and runtime contract before migrating existing agents.

Build from the release source

git clone --branch v2.4.0 --depth 1 https://github.com/Nexa-Language/Nexa.git
cd Nexa
uv sync --locked --all-extras
uv run nexa --version

Download SHA256SUMS alongside the Python packages and verify them with shasum -a 256 -c SHA256SUMS. The release tag identifies the same source used for the packages and this site.