Contents

AI agents

An AI agent that edits posts through the API has no browser tab, so it never checks in. Instead, each time it saves a post, Presence API shows it working on that post for the next 75 seconds.

How it works #

An agent's save writes its rowAn agent saves a post. On wp_after_insert_post, if the current user is an agent, the plugin writes agent-{id} in the post's room, expiring after 75 seconds. Admin screens show the agent with a label until the row expires.wp_presenceWordPressAgentwp_presenceWordPressAgentAdmin screens show the agent, labelled,until the row expiresSave post 42wp_after_insert_post, is the user an agent?Write agent-{id} in postType/post:42, expires in 75 s

Source: presence.php

Check your understanding #

An agent saves a post once and stops. How long does it appear on that post?

75 seconds, until its agent- row expires.

Edit this page on GitHub