leonard_agent 0.3.1
leonard_agent: ^0.3.1 copied to clipboard
Web-compatible harness library.
Changelog #
0.3.1 #
- Fix: schema-declared integer and number tool arguments now normalize lossless
quoted SwiftInfer numerics before strict
ActionSchemavalidation. Outgoing schemas,ActionValidator, and retry budgets remain strict.
0.3.0 #
Promotes 0.3.0-rc.1 to stable. The candidate's full change list is under that
entry below; the break is restated here because this is the version a consumer
on 0.2.x upgrades to.
- Breaking: owning VM-service connections live in
leonard_agent_io.dart. The staticconnectconstructors —VmServiceClient.connect,LeonardSession.connectandMultiHostSession.connectAll— are gone from the default, web-safe library. Migration: importpackage:leonard_agent/leonard_agent_io.dartand call the top-levelconnectVmServiceClient,connectLeonardSessionorconnectMultiHostSession. A consumer that only wraps an already-connectedVmService(VmServiceClient.fromVmService) is unaffected. - Breaking:
SwiftInferChatOptions's sampling fields are nullable.maxTokens,temperature,topP,topK,presencePenaltyandrepetitionPenaltymoved fromint/doubletoint?/double?, so an unset override is omitted from the request instead of being sent as a default. Migration: null-check before reading one. - Fix: device tool descriptors carried in a handshake are parsed into agent
manifest entries and core descriptors route through
coreTools, so validation rejects a malformed call before device dispatch. A legacy names-only handshake keeps the permissive projection (lenny#123). - Add: the loop driver and conversation builder carry the trim-proof scratchpad, so a remembered result survives history trimming and is read back by recall (lenny#116).
0.3.0-rc.1 #
- Breaking: owning VM-service connections moved to
leonard_agent_io.dart. The staticconnectconstructors —VmServiceClient.connect,LeonardSession.connectandMultiHostSession.connectAll— are gone from the default, web-safe library. Migration: importpackage:leonard_agent/leonard_agent_io.dartand call the top-levelconnectVmServiceClient,connectLeonardSessionorconnectMultiHostSession. A consumer that only wraps an already-connectedVmService(VmServiceClient.fromVmService) is unaffected and stays onleonard_agent.dart. - Fix: model-response transport faults are classified as retryable failed turns and their diagnostic context carries into the terminal agent-stuck footer. Any exception still escaping the session loop is named and scrubbed, so a harness error is never anonymous.
- Fix: prior reasoning replays as native thinking blocks in assistant history, so swift-infer populates reasoning content without template-specific marker parsing.
- Fix: unset sampling overrides are omitted rather than sent; shared driver token and effort defaults are added, with operator overrides.
- Fix: the swift-infer qwen tier advertises its native context window, and the dogfood harness reads the shared capability registry.
- Fix: tooltip-only semantics are promoted to labels, distinct tooltips are preserved as hints, and the optional field carries through typed observations, so icon buttons are addressable by drivers.
- Fix: self-drive completion is gated on observed timeline evidence — a scenario-declared node pattern must match and captured row tokens are cross-checked against the completion reason — and diagnostic evidence is preserved when an observation fails.
- Raise the
leonard_contractfloor to^0.2.2; the declared^0.2.0floor was unsatisfiable against this package's owngenesis_perceptionrange.
0.2.0 #
- Breaking: VM-service methods now use
ext.leonard.*. Construct names withkLeonardExtensionPrefixfromleonard_contract. - The VM-service client now consumes the shared Leonard wire contract.
0.1.6 #
- Provider response metadata is now persisted with the trajectory turn. The served model id and the streamed result identifier carry through model decisions into trajectory turns, so swift-infer observability stays on dartantic's standard result-identifier seam.
- New
ModelDecision.modelMetadata(optional, defaults to empty). Dartantic-backed providers populateserved_model_idand an explicitprovider_request_id; custom providers may leave it empty.
0.1.5 #
- Perception nodes now carry
identifierandvalueend-to-end to the brain.SemanticsNodeparses and re-emits the stable, locale-independentidentifier(fromSemantics(identifier:)) and the node'svalue(text-field contents / secure-field bullets); both join==/hashCode, so a field filling in shows up in the diff. The host emitted these already — the agent model had been dropping them, so the brain only saw them on the native channel. - The bundled agent guide (
kDefaultAgentsMd) documents the split: readlabelto understand what a node is, useidentifieras the stable handle for addressing it across locales/sessions, and always act by integernode_id.
0.1.4 #
- Multi-host attach:
MultiHostSessionattaches to N VM-service hosts at once, merges each host's perception fragment into one observation (side-by-side, keyed by namespace), and routes each tool call to the owning host by namespace (core.*→ the Flutter host,native.*→ the native channel). A newSessionSurfaceinterface is implemented by BOTH the unchanged single-hostLeonardSessionandMultiHostSession, so the loop drives either transparently. The agent context-switches by perception, not by hardcoded mode flags.
0.1.3 #
HandshakeResultgains acapabilitiesfield: host-level features that are reachable but are NOT namespaced tools (so they never appear underextensions) — notablyscreenshot. The handshake parse reads the newcapabilitiesarray and is tolerant of its absence (older bindings parse to an empty list). Lets a driver listscreenshotwhere agents look instead of concluding "no such capability" from the tool manifest alone.
0.1.2 #
- Adopt dartantic as the model-backend seam: a single
DartanticModelProviderdrives any backend — swift-infer via lenny's customChatModel, Anthropic and OpenAI via stock dartantic models. The hand-rolled per-provider classes are removed; the loop keeps retry ownership and theSchemaRejectioncontract. - Anthropic backend defaults are now compatible with extended thinking: a
non-forcing
tool_choice(auto) and no temperature override. Anthropic rejects a forcingtool_choiceor any non-1temperature while thinking is enabled, so the previous defaults returned request-time400s when driving Claude. Thinking stays on; the driver's retry covers a rare prose-only turn. - Fix (Anthropic): per-turn observation context is no longer dropped. The
dartantic Anthropic mapper serializes only the
tool_resultblock of a tool-bearing user message and discards sibling text parts, so from turn 1 on the model never saw the observation — it was driven blind after the first turn (the swift-infer path is unaffected; its mapper keeps the text). The Anthropic backend now folds the observation + diff into thetool_resultbody so the model sees the live screen every turn. - Observation: expose scroll extent on scrollable nodes.
0.1.1 #
- Fix: bound runaway model output. The swift-infer provider now aborts a
response once it streams a large amount of reasoning text with no tool
call in sight, surfacing a retryable
SchemaRejectioninstead of letting weaker models ruminate all the way tomax_tokens— the "endless stream, no tool call" failure. The loop retries with a fresh sample.
0.1.0 #
Initial release.