tdfs4ds.agentops.names¶
tdfs4ds.agentops.names
¶
Who holds an agent name in AgentOps, and how to free it for a new deployment.
A definition name is unique in the workspace, and DELETE /agent_definitions/{id}
only archives the definition: it keeps the name, so a second POST
/agent_definitions with the same name is 409 CONFLICT_ERROR (seen on AI
Studio pp54). The API has no hard delete, but PATCH /agent_definitions/{id}
accepts a new name on an archived definition. Renaming it to
<name>-archived-<id8> frees the name and keeps the history; that is the
mechanism used here.
Safety rules, each tested:
- a name held by a live deployment, or by a deployment another user created, is
never touched (
blocked, with who and what to do); - a definition is freed only when it is archived or failed. A published or
still-creating definition with no deployment has no owner on record
(
created_byissystemfor every definition), so it is refused rather than guessed; - every lookup failure is fail-open: the state is
unknown, nothing is changed, and the register step reports the platform's own answer.
archived_name
¶
The name an archived definition is renamed to (pure, within 255 chars).
inspect_name
¶
Who holds name. Returns {"state", "definitions", "reason", "hint"}.
free: nobody. reusable: only archived/failed definitions of this
caller, without live deployment; :func:free_name can release them.
blocked: a live deployment, another user, or an unarchived definition.
unknown: the registry could not be read (fail-open).
free_name
¶
Rename the archived/failed definitions holding name; archive a failed one first.
Returns the list of (definition_id, new_name) renamed. Raises nothing
for an API refusal: a refused rename is left out of the list and logged.
release_definition
¶
Rename one archived definition so its name can be reused.
Returns (name_before, new_name); new_name is None when it was already
renamed. Raises on an API error (the caller decides how to report it).
name_is_free
¶
True/False whether no definition (archived included) holds name; None if unreadable.