Repository navigation
deepagents@1.14.0
Minor Changes
-
#862
6e6b036Thanks @richardscarrott! - feat(deepagents): reload skills whenskillsMetadatais set tonullSkills are loaded once per thread and kept in state, so a long-lived thread never saw skills added, edited or deleted after its first run. Setting
skillsMetadatatonullnow makes the next model call re-read every source and replace the stored list. A thread whose sources hold no skills also counts as loaded, so it stops listing the backend on every run — including threads checkpointed by earlier versions, which store[]and need an explicitnullto reload.Loading moved from
beforeAgenttobeforeModel, so a reload is served by the next model call rather than the next run. Two consequences:- A middleware of your own can invalidate mid-run, from
afterModel, and the following model call sees the fresh list. - With a
StateBackend, a load now seesfileswritten during the run, so aSKILL.mdthe agent just wrote is picked up.
A fork inherits a pending invalidation: a fork spawned in the same iteration that set
skillsMetadatatonullreloads from its own sources rather than inheriting the parent's last loaded list.skillsMetadatais also part of the agent's state type now whenskillsis passed tocreateDeepAgent, which previously meant mountingcreateSkillsMiddlewareby hand to reach it. Inference mirrors the runtime condition, so an omitted option or an empty literal contributes no state, while a non-literalstring[]does.A middleware of your own can reach the field too:
skillsMetadataValueis exported for declaringskillsMetadataon a custom middleware's state schema, since a middleware can only read and write the fields its own schema declares. Treat the value as opaque — it exists to be passed toStateSchema, and its concrete type may change. - A middleware of your own can invalidate mid-run, from