Changelog
What shipped, release by release. Releases are tagged on GitHub.
v0.2.0
AddedChangedRemovedFixed
Any model you bring
Breaking: Agentling no longer ships a model provider.
Migrate from 0.1 shows the 0.1 code and its 0.2 replacement for every removed or changed API.
Agentling no longer bundles an OpenAI adapter or depends on openai. Any object with a stream(messages, tools) method that yields Deltas is a model, so an app can use OpenAI, Anthropic, Gemini or a local server through an adapter of its own. Write a model adapter explains the contract, and the reference adapters are ready to copy.
Added#
ToolDefinition, the provider-neutral description of a tool that adapters render in their own format, andTool.definitionto get one.reasoning,finish_reasonandprovider_dataonDeltaandChatMessage, andcached_input_tokensandreasoning_tokensonUsage.provider_datamust be JSON-serialisable; the loop raisesModelOutputErrorwhen it isn't.FinishReason, andFinalEvent.finish_reasonfor the last model turn.- A
ModelErrorsubclass for each kind of model failure (ModelConnectionError,ModelRateLimitError,ModelServerError,ModelTimeoutError,ModelAuthError,ModelBadRequestError,ModelContextLengthError), withretryable,retry_afterandstatus. See the Errors reference. RetryPolicyandAgent(retry=...). The loop retries a turn that fails with a retryable error before its first chunk, with backoff and jitter, honouringretry_afterup tomax_delay.retry=Noneturns retries off.deltas_from_message, for adapters whose backend doesn't stream, andexamples/custom_model_generate_only.pyto show it.AgentSession.resume(), which continues an interrupted or failed run from memory without adding the task again, andAgentSession.is_running.ModelOutputTruncatedError, raised when the model's output limit cuts a tool call short. The loop no longer asks the model to fix such a call.- Async step callbacks. Callbacks run in order and are awaited before the step's
StepEvent;StepCallbackis their type. agentling.testing:ScriptedModel, which replays scripted turns so an agent runs offline;check_model, which runs an adapter through a text turn and a tool turn and reports which contract rule it broke; andRecordingTransport,write_fixtureandread_fixturefor recording a backend once and replaying it in tests. Recorded mode needshttpx; the rest doesn't.- Reference adapters to copy, in
examples/providers/:openai_chat.pyfor OpenAI-compatible endpoints,anthropic_messages.pyfor the Anthropic Messages API (thinking blocks are kept and replayed throughprovider_data), andollama_native.pyfor Ollama's/api/chat. Each takes anextra_body, ships a recorded fixture and passescheck_model. They needhttpx, which Agentling itself doesn't depend on. examples/providers/record.py, which records an adapter against a live backend into a fixture with API keys redacted.
Changed#
model_timeoutbounds the wait for each streamed chunk, not the whole turn.- A tool call that arrives without an id gets one (
agentling_call_<index>_<8 hex>) instead of failing the turn. ModelOutputErroris now a subclass ofModelError.FinalEvent.usageisNonewhen the model never reported usage, instead of zero counts.interrupt()also ends a wait between retries, and does nothing while no run is active. It used to stop the next run before its first step and leave its task in memory.- A session runs one task at a time:
run()orresume()during a run raisesRuntimeError("Session is already running"). final_answerno longer produces aToolCallEventorToolResultEvent; the step'sStepEventis followed by theFinalEvent. The call is still recorded in memory.- Turns whose tool calls can't be parsed no longer count towards
max_steps. run(..., stream=True)is typed as an async generator, so it can be closed early withcontextlib.aclosing, andrun()without it as a coroutine, so it can be passed toasyncio.create_task.- The answer forced at the step limit goes through
context_manager, retries and interrupts like any other turn. Agent()raisesTypeErrorstraight away for a model without a usablestreammethod.- Memory saves as format 2, which adds the new fields. Format 1 saves still load, but 0.1 can't read format 2.
- Agentling describes itself as an agent engine: the loop, typed memory and streamed events, with any model you bring. The README quickstart runs offline on
ScriptedModel.
Removed#
OpenAIModeland theopenaidependency. The only runtime dependency ispyyaml.ToolSpecandTool.to_schema(); useTool.definition.Model.generate.Modelhas one method,stream, which takesToolDefinitions.
Fixed#
- A slow consumer of
run(stream=True)no longer receives aCancelledErrorcaused bymodel_timeout. - Retries no longer stack. Agentling used to retry on top of the OpenAI SDK's own retries, up to nine attempts per request.
- Interrupting a run mid-stream now closes the adapter's stream.
- An interrupt during the last step stops the run instead of making one more model call for the step-limit answer.
- A step callback that raises on the step where the model called
final_answerno longer loses the answer: it is in memory, and the run isn't left looking resumable.
v0.1.1
AddedFixedChanged
Dynamic tools
Tools whose schemas come from somewhere else (an MCP server, an OpenAPI spec, a plugin) now work, and a running session can gain or lose tools.
Added#
AgentSession.add_tools(tools, replace=False)andAgentSession.remove_tools(names)change a live session's tools. The model sees the change from its next call. Each call is all or nothing, andfinal_answer(plusload_skillwhen skills are configured) can't be removed or replaced.Tool.validate_arguments(defaultTrue) and the matching@tool(validate_arguments=...)option, for tools whose arguments are validated elsewhere.Tool.validate(arguments), a public way to check arguments without running the tool.call()now goes through it.examples/cli_dynamic_tools.py, and a Dynamic tools and MCP guide with an MCP bridge recipe. agentling still has no MCP dependency.
Fixed#
- A property whose
typeis a list, such as["string", "null"], no longer crashes validation. A value passes if it matches any listed type, and"null"matchesNone. - A schema with no
propertiesno longer rejects every argument. - Extra arguments are rejected only when
additionalPropertiesisfalse. - Validation skips keywords it doesn't implement (
anyOf,$ref,format, nested objects) and only ever raisesToolCallError.
Changed#
- Tool names and schemas are checked wherever a tool is registered, not only in
@tool. AToolsubclass with an invalid name or a non-object schema now fails withValueErrorat registration. - A
Toolsubclass whose schema doesn't set"additionalProperties": falsenow accepts extra arguments, as JSON Schema intends.@toolschemas still reject them. - Loading a skill that declares a tool whose name is taken by a different tool now returns an error to the model instead of silently keeping the existing tool.
- Docstrings and the Errors reference now say which errors are reserved and not yet raised, and that provider errors reach your code unwrapped.
v0.1.0
Added
The first release
The first real release: the core loop plus a production-hardening pass.
Added#
- Async ReAct agent loop with a single streaming code path (
Agentconfig and factory,AgentSessionrun state); blocking and streamingrun(). - Provider-neutral model layer and an OpenAI-compatible adapter with retries.
@tooldecorator with JSON Schema generation, argument validation, and per-tool metadata (timeout,parallel_safe,max_output_chars).- Typed memory (
TaskStep/ActionStep/FinalStep) with JSON persistence and load validation (MemoryLoadError). - Streaming events, a
print_eventsrenderer, and a terminal runstatus(completed / interrupted / max_steps). - Progressive-disclosure skills (
SKILL.md) with a built-inload_skilltool. - An exception hierarchy under
AgentlingError, public API exports, and__all__. - Timeouts (
tool_timeout,model_timeout), prompt cancellation, sync tools run off the event loop, optional error redaction (redact_errors), cumulative token usage on the final event, and acontext_managerhook for long runs.