Skip to content

lionagi v1.2.0

Latest

Choose a tag to compare

@ohdearquant ohdearquant released this 03 Dec 00:56
b49e9ef

lionagi v1.2.0

Date: 2026-12-02
Previous: v1.1.0

pip install -U lionagi

Upgrading from 1.1.0

Read these before you restart anything that writes to a lionagi state store.

  • Run li state migrate before restarting Studio or any other writer. The state store schema moves from version 7 to version 10: engine preset IDs and kinds become text columns, saved workflows keep immutable revisions, and sessions gain an indexed preset ID. Until the store is migrated, opening it for writing raises SchemaMigrationRequiredError (set LIONAGI_STATE_AUTO_MIGRATE=1 to let the writer migrate instead), and Studio Operator answers with the command to run. A SQLite store is backed up beside itself before any table is rebuilt. A store holding engine presets with a NULL ID is refused with recovery steps rather than migrated. Existing workflows become revision 1, and sessions recorded before the migration show in Fleet with no preset. (#5137, #5144, #5168, #5175, #4845, #4506)
  • Plan for a one-time table rewrite on PostgreSQL. The first write-mode open after the upgrade widens the token columns of sessions and schedules to 64-bit integers, under an exclusive lock, and takes longer the larger those tables are. The same open adds an index on dispatch_outbox(created_at DESC, id); the schema version does not change for either. (#5125, #5115)
  • Run the Codex sandbox probe again. Run python -m lionhub.providers.openai.codex_sandbox_probe after upgrading. Probe records move to format 8, and a Codex child does not launch on an older record. (#5142)
  • If you set LIONAGI_HOME, keep settings.yaml there. lionagi reads user settings only from settings.yaml in LIONAGI_HOME. When that file is missing and ~/.lionagi/settings.yaml exists, lionagi now refuses with SettingsLocationError instead of running on default settings. Copy the file into LIONAGI_HOME or unset the variable. (#5238)
  • A broken nearest project settings file now stops the load. When the nearest .lionagi/settings.yaml is a dangling link or a directory, load_settings raises reading it instead of falling through to a farther file. (#5265)
  • Check agent profiles for settings that used to load with a warning. A profile whose only mcp key sits inside another setting is now refused. A configured Python pre-tool hook whose module or callable is missing now stops the agent from being built. A khive MCP server handed to a child agent no longer keeps KHIVE_NAMESPACE, KHIVE_CONFIG or KHIVE_DB from its env entry, and one whose command is kkernel is refused if its args pass --config or --db and also loses KHIVE_SOCKET, KHIVE_PID and HOME; use khive_injection.mcp_config to give an agent its own store. (#5118, #5195, #5234, #5240)
  • Flows no longer run an operation on its predecessor's error. A dependent of a failed operation with no other open path is skipped with reason upstream_failed. Code that expected those dependents to run should handle the skip. (#5224)
  • Some flow resumes are now refused. A resume refuses when an upstream operation's artifact directory is missing, or when the run it continues may itself have been a resume whose checkpoint does not record where its operations wrote their files. Start a fresh run in those cases. (#5259)
  • Move terminal-notice payloads out of command arguments. A --notify or notify.on_terminal template that puts {payload} or {invocation_id} in its arguments now resolves to disabled with a warning, and the run sends no notice. A notice command for runs the MCP server starts that names {label} or {reason_detail} is refused, and a notify_seat must be one plain argument. Read the JSON payload from stdin, or from LIONAGI_NOTIFY_PAYLOAD and LIONAGI_NOTIFY_INVOCATION_ID. (#5258, #5261)
  • Rename adapt_legacy_hook to adapt_tool_hook. The old name still works for one minor release and warns when called. (#3999)

Changelog

Studio

  • Library lists saved workflows. Saved workflows appear under All and Workflows, where you can inspect a workflow, supply its inputs and a base directory, and open the run in Fleet. Run now is enabled only after the runtime compiler accepts the saved workflow and its arguments, and the reason is shown beside the button when it does not. The Library has no Engine tab: it lists no engine blueprints or presets and has no preset form, the retired /engines address opens the Library, and the engine-definition and engine-catalog API routes are unchanged. (#5190, #5251)
  • Workflows can run agents and gates, with typed inputs and outputs. Spec version 2 adds typed inputs, explicit engine input sources and named outputs, kept in YAML and TOML. An agent node runs a named profile on its own branch with a typed prompt, and a gate asks for a verdict and findings in one turn; a rejection, a missing or invalid verdict, or a failed or cancelled gate stops everything downstream even when another incoming edge succeeded. A gate's verdict is available as an output, a skipped node supplies a null optional output, and a missing required output names the output and its source node. Readiness and run history show the resolved profile for each agent and gate node, and Studio checks it again at launch. (#4846, #5191, #5197)
  • Workflow revisions. Saving a workflow keeps the previous revision, so Run detail opens the exact graph a run used even after later edits or deletion. Two saves against the same expected revision return a conflict, and a save's message and source are recorded only when the graph changes. (#5168)
  • Workflow and preset checks. Engine node options are checked against the same engine kind as preset creation, export directories resolve inside the configured export root, a historical workflow without typed inputs is refused if it declares sensitive inputs, schedules explain that engines are launch-only, and preset pages keep oversized option values in the database. (#4241, #4242, #5193, #4225, #4232)
  • Operator. Conversations can upload images, with header checks, quotas and automatic expiry of unused files. Operator asks for confirmation only after the whole proposal is stored, and an oversized proposal returns a tool error at once. When a store error leaves a turn's final status unconfirmed, Operator names the Session, and the next turn reports it as a conflict with a link to the run. A store that needs migration is reported as a non-retryable refusal with the li state migrate command. (#2843, #5025, #3952, #4503)
  • Attention, translations and VS Code panels. Attention shows a play with unreadable metadata as unavailable, with its name linking to Fleet and confirmed gates keeping their acknowledgement control. Translations can keep shared wording independent of English edits or follow the English source, and full ICU catalogs export and import through the frontend's messages command. The VS Code run detail and tree panels share one reconnect schedule and cancel pending retries when closed or pointed at another run. (#5083, #4861, #4864)

Flows and playbooks

  • Failed operations stop their dependents. A dependent with no other open path is skipped with reason upstream_failed, and its result names the failed operations it traces back to. A join that runs on any open path does not require a predecessor whose sibling path is open. li o flow --graph and flow.submit(graph=...) follow the same rule. (#5224)
  • Resumed flows keep a gate's veto, and the summary tells you what did not finish. A gate restored with a reject verdict skips its dependents again. li o flow records whether each operation completed, failed, was skipped or left no result, and the synthesis pass reads only completed output; failed and skipped operations are named to it as work not done, and no synthesis is written when no final operation completed. (#5233)
  • Playbook arguments. Playbooks warn about unresolved prompt arguments, and strict_args: true refuses them. (#4846)
  • Resumed flows read upstream files where they were written. A re-run worker is pointed, read-only, at the artifact directories where earlier runs wrote their completed upstream operations' files, where it used to get the new run's empty directories; this holds across a resume of a resume. The resume refuses before any worker starts if one of those directories is missing, and refuses, naming the reason, when it cannot tell whether the run it continues was itself a resume. run.json of a resumed run records resumed_from_run and resumed_from_session. (#5259)
  • Smaller checkpoint journals. Separated array insertions and deletions can be stored as compact edits; existing records keep their format and replay in order. (#3984)

Runs and terminal notices

  • Correlation ids. li agent, li o flow, li o fanout and li play take --correlation-id ID, and an MCP submit takes correlation_id. Every terminal notice for the run returns the value unchanged in correlation_id (null when none was given), the MCP job handle returns it too, and a resumed flow keeps it unless the resume passes its own. The value is at most 200 characters, not empty, and free of control and format characters and line and paragraph separators. It is stored in the job record, on the child's argv and in the notice environment, so it must not hold a secret. (#5256)
  • One notice shape. Every terminal notice carries the same common fields at schema_version 1, including correlation with the run's lifecycle ids. The --notify override and the MCP job notice add the new fields beside their existing keys, and docs/internals/runtime.md lists the fields each producer sends. (#5256)
  • Notice commands take no outside text in their arguments. A --notify or notify.on_terminal template that puts {payload} or {invocation_id} in an argument resolves to disabled with reason on_terminal_placeholder_in_argv. A notice command for runs the MCP server starts that names {label} or {reason_detail} is refused where it is loaded, and the job's notify_delivery records delivery_command_takes_free_text_in_argv. {status} is still substituted. (#5258, #5261)
  • Agent deadlines. run.json records the deadline a run is held to, with its seconds and whether the caller or the profile set it, and job.status returns it. With resume_on_timeout on, the deadline now bounds the whole run: the first attempt gets the deadline minus a continuation window (10% of it, at least 60 seconds, never more than half) and the continuation gets the window, where it used to start with a fresh copy of the full timeout. (#5250, #5257)
  • Hook refusals end the run with their own reason. A UserPromptSubmit hook that refuses a prompt ends the run as run.failed.hook_refused in its status, job record and terminal notice, naming the hook and the first line of its reason with credentials and directory paths removed. The refusal is raised as HookRefusedError, a PermissionError. (#5252)

Provider CLIs

  • Session continuation is recorded per call. Only Claude Code and Gemini CLI, which continue sessions themselves, are sent a stored session id; Codex and Pi get the whole conversation each turn as before. Each call records continuation (native, replay or resume_failed) and the provider_session_id the CLI reported, branch.run and branch.chat copy both onto their answer, and ProviderError carries the provider_session_id of the call that failed. (#5237)
  • Codex stream shows MCP tool calls and web searches as paired tool-use and tool-result events with the item id, the qualified tool name (or web_search) and a completed or failed outcome. Arguments and results are not copied into the session. (#5232)
  • Codex sandbox probe records say more. Each denied location tried is recorded with what the child saw, a directory reached through a link is no longer read as readable, linked directories with no file to open are listed in links_without_a_file, and the record's file name carries its format so two installs with different formats can share one LIONAGI_HOME. A launch refused for account containment names the profile and the contain_account_integrations: false setting. (#5140, #5142, #5145, #5228, #5229)
  • CLI requests reject malformed input with a validation error. Input that is not a mapping, messages that are not a list of role and content mappings, an empty iterator, and a non-string Pi model now raise a validation error instead of AttributeError, TypeError, KeyError or IndexError, and a read-only mapping such as types.MappingProxyType is accepted and left unchanged. (#5161, #5165, #5170, #5180, #5184)
  • Claude Code auto_finish survives an empty answer. A buffered call that gets a successful, explicitly empty text result resumes the same session once; a failed or interrupted turn still ends at once. Mirrored Claude text records the model the provider reported, including changes within a session, and can keep reported token counts. (#4371, #2232)
  • Provider CLIs start without the state store settings. Claude Code, Codex, Antigravity CLI (agy) and Pi processes no longer inherit LIONAGI_STATE_DB_URL or LIONAGI_STATE_AUTO_MIGRATE; managed li workers keep them. li profile show NAME and profile.show report the resolved Antigravity CLI model, and --check-availability checks it against the signed-in account. (#4505, #4853)
  • Billing refusals are quota failures. A Codex or OpenAI refusal that asks the caller to check the plan and billing details ends the run as run.failed.provider_quota_exhausted and is not retried; it was an unclassified provider error before. The runtime guide lists each provider failure class with its run reason and whether a retry can succeed. (#5249)
  • Subagent pools count slots still being cleaned up. A slot whose agent has ended, while the end of its process group could not be confirmed, stays held until the process that started the agent exits. li monitor counts such slots as (N cleanup pending), and each pool reports cleanup_pending and available. (#5253)

Agent profiles, hooks and MCP

  • Profiles can name their own khive store. khive_injection: {mcp_config: <path>} names an MCP config file with one khive server, and recall and writeback use it. A file that cannot be read, names no khive server or several, or whose command is missing stops the agent with an error naming the profile. (#5230)
  • Child agents keep their own khive store. A khive server handed to a child no longer keeps env entries or args that would point it at another store or namespace, and a profile store that selects one through those entries is refused when the agent is built. (#5234, #5240)
  • Profile loading is stricter about malformed YAML. A nested mcp key is refused, YAML merges past a 65,536-unit expansion budget or forming a cycle are refused before the mapping is built, and indentless lists count toward the 64-level nesting limit. (#5103, #5118, #5138, #5135)
  • Tool hooks. A missing Python pre-tool hook stops the agent from being built, missing post-tool and error observers warn, and errors raised while a hook module initializes propagate. adapt_tool_hook replaces adapt_legacy_hook. (#5195, #3999)
  • MCP connections and jobs. A stdio MCP server that ignores discovery can connect through one initialize-only retry after the handshake deadline. Checking whether an MCP job is running no longer reaps a reused pid's process, so its waiter gets the real exit code. (#3807, #5245)
  • Leg hosts. A leg host refuses to start when a Codex configuration under its homes names an MCP server, and a Codex request with an empty MCP grant is refused unless its final command keeps the server set empty. Operators can configure a lock for benchmark windows; while a benchmark holds it, launches get HTTP 503 before taking a slot. (#5089, #5080)

Schedules and dispatch

  • li schedule apply --machine returns the plan. It and the schedule.apply MCP verb return one row per member and per owned row the set no longer declares, with the action and the schedule row id, with or without --dry-run. An unresolved set or a row owned by another set reports valid: false, and a row that changes during planning is refused as a conflict; nothing is written in either case. (#5235)
  • Agent schedules need a prompt. A missing, empty or whitespace prompt is refused at create, at an update that sets the kind or prompt, and in a schedule-set declaration. Rows already stored without one are left alone. (#5113)
  • GitHub schedules keep their poll target. A poll keeps the target generation it observed at its start, and changing only the page limit keeps pending events. (#3931, #3932)
  • Dispatch list and lookup. Durable dispatch rows can be listed by status with their latest transition reason, and a dispatch ID returns its delivery state and full history. The list reads the newest rows through an index, orders ties by ID, and returns an empty list on an empty PostgreSQL store. (#1714, #5115, #5121)

State store

  • Schema 10. See Upgrading for the migration. Overlapping SQLite migrations retry a busy backup checkpoint and skip a rebuild another migration finished, a backup is taken before the workflow revision migration only when it rebuilds workflow_defs, and a pre-versioned store that needs end-time repair reports the migration before writing anything. (#5137, #5144, #5168, #5175, #4845, #4506)
  • PostgreSQL. Session token counts and schedule token budgets are 64-bit, so values above 2,147,483,647 are accepted. Session pruning lets delivery acknowledgements and consumer registrations commit during archive writes, rechecks the archive before deleting, and raises PruneArchiveRetryExhaustedError after three unstable attempts. (#5125, #4403)
  • Batched message writes accept one-shot progression ID iterables and append to each progression in order. A malformed message ID raises ValueError, and a valid one aimed at another run's progression raises StateCompatibilityRefused. (#4494)

Settings

  • One settings file under LIONAGI_HOME. Beside the refusal described in Upgrading, a settings.yaml that exists but is not a readable regular file raises an error naming the path, every message names the file lionagi actually reads, and a sandboxed Claude Code child may not edit it. CHILD_SANDBOX_OPT_OUT now ends with “in the lionagi settings file” and each refusal follows it with the path, so code that showed the constant as a sentence should append the path. (#5238)
  • Where a terminal callback comes from. li doctor --notify-settings [--project-dir DIR] prints the global and project settings paths, where a linked project file resolves, the search root in force, and the file that supplied each part of notify.on_terminal; it starts no process. LIONAGI_PROJECT_SEARCH_ROOT limits the project settings search to the run's directory and its parents up to that directory, and refuses a project settings file inside it that links outside it. (#5265)
  • One project settings search. load_settings, find_project_settings_file and load_project_settings_layer share one search (see Upgrading for the dangling-link change). A LIONAGI_HOME that is the .lionagi directory of a parent of the run's directory is no longer read a second time as the project layer, which repeated each element of a notifier argv, and a relative project_dir such as . now searches the working directory's parents. (#5265)

API providers

  • OpenRouter records the cache-read and cache-write token counts a response reports, and keeps a request's provider routing object instead of dropping it. (#5225)
  • Anthropic account routing holds and writes an account block the ledger refused after a 401, 403 or billing rejection before its next reservation, and records the attempt's reason. (#5132)
  • Faster tool loops. Context folding reuses the count it already measured for a bounded result, and unchanged tool results reuse their YAML rendering on later requests. (#3746, #3869)

Fixes

  • Branch.from_dict loads the cookbook's two recordings again by ignoring an unused template: null entry. (#5227)
  • AgentSpec copies keep model and effort precedence for unchanged settings, and AgentSpec.from_yaml(path, trust_origins=True) restores it for a saved spec. (#3936)
  • Engine judges propagate deterministic refusals from CLI argument preparation and from callbacks that report a denied expansion, keeping the original refusal and cause. (#5198)
  • li engine run records a run that degraded (budget or deadline) without producing any result text as failed, with reason run.failed.degraded_empty, and exits 1; it used to record it as completed and exit 0. Cancelling Branch.operate while its start is being reported no longer leaves a never-awaited coroutine warning. (#5254)
  • Checks that run earlier or say more. New and resumed API agent runs share effort selection, and a model override is validated before the saved request settings change. Provider declarations check their names and endpoint kinds against their configuration, and repeated plugin activation failures keep the warning that names a conflicting alias. Claude worker profiles keep tool names separate through containment validation, and team-round refusals name the role profile. (#3938, #4137, #4146)

Security

Documentation

  • Credential ledger timing and ADR status. The ledger documentation says each SQLite lock wait has its own busy timeout, so one call can take longer than five seconds; ADR-0126 indexes its current routing, settlement and cancellation rules; ADR-0041 Amendment 11 (configured Python tool hooks) is Accepted; six design records point to the implemented rules for scheduled follow-ups and terminal writes. (#4085, #4145, #5205, #4442)
  • Hook files over MCP. The CLI reference names the MCP route for hook files: agent.submit carries one leg's hook file with hooks_from, hooks_from_format and hooks_from_carry. (#5249)

Project

Shared implementations with no change in behaviour except where noted: prompt-cache mark ordering and placement coordinates (#3870, #3871), terminal-delivery capacity (#3976), MCP file choices on resume (#4219), CLI request models and flags (#4865, #5156), engine and schedule validators (#4866), the moved-module registry (#4908), Studio request building, routes, icons and run-canvas folds (#4949, #5146, #5155, #5200, #5129, #5130), the PostgreSQL widening statements (#5127), LNDL declaration parsing (#5136), the Rust core's wire formats and dependencies (#5148, #5154), the MCP verb catalog (#5181), kernel operations (#5196), request refusal classes (#5203), ReAct option forwarding (#5206) and provider lazy exports, whose private __getattr__ and __dir__ hooks now report lionagi.ln._lazy_init as their module and can no longer be pickled under their former package-level names (#5211). Tests were consolidated or extended for CLI cleanup guards, notifier cancellation, scheduler startup, route areas, CLI field descriptions, the frozen CLI contract, mutable models, backup checkpoints, Operator MCP, hook registries, shared-memory delivery, pytest hooks, Studio layout and engine catalog, and configured hooks (#3980, #4450, #5147, #5149, #5150, #5152, #5159, #5163, #5166, #5167, #5169, #5171, #5173, #5174, #5183, #5187, #5199, #5201, #5204, #5210).

Full changelog: v1.1.0...v1.2.0