docs(server): the handle-less recreate gap spans the agent.create.before hook

This commit is contained in:
Mohamed Boudra
2026-11-05 12:49:36 +01:00
parent 77af4fc4fb
commit a29d2cb5ef
@@ -134,8 +134,10 @@ export async function ensureAgentLoaded(
}
// Known gap: `record` was read before this create, and createAgent deletes the stored
// state outside the agent's lifecycle lane. A setMetadata that saves between the read and
// the delete is overwritten by this stale metadata. The fix is to read and delete the
// stored record inside the lane (createAgentInternal), which is a lifecycle change.
// the delete is overwritten by this stale metadata. That window spans everything from the
// read to the delete, including the agent.create.before hook, which a plugin can hold
// open. The fix is to read and delete the stored record inside the lane
// (createAgentInternal), which is a lifecycle change.
snapshot = await deps.agentManager.createAgent(config, agentId, {
labels: record.labels,
metadata: record.metadata,