Skip to main content
Version: v5.7.0

opschain admin agent forget

packs:agents

opschain admin agent forget <agent-id> [--server <url>] [--auth-token <token>]

Removes a stale agent registration (v2 AgentService.ForgetAgent) so the same identity may re-register later. This is housekeeping, not revocation: the agent's key is not tombstoned, and a fresh registration of the same identity is welcome. To refuse an identity outright, use opschain admin agent revoke.

An online agent is refused with 409 — stop it (or drain it) first, or let it age out of liveness.

<agent-id> is the agent's member id — the ID column of opschain admin agents list.

Flags​

FlagMeaning
--server <url>Server base URL. Default: the active context, then OPSCHAIN_SERVER.
--auth-token <token>Admin bearer token override. Default: your opschain login session, then $OPSCHAIN_ADMIN_TOKEN, then the token stored by opschain admin login for that server.

Output​

Always a machine document (JSON unless -o yaml):

{
"forgotten": true,
"id": "01999a7e-…"
}

Exit codes​

CodeMeaning
0The registration was removed.
1The server refused or failed the request (online agent, rejected admin token, unknown id).
2Usage — wrong arguments, or no server / admin token resolvable.

Named errors​

  • agent is online: stop or drain it before forgetting it — 409, exit 1.
  • a server is required — pass --server <url>, set OPSCHAIN_SERVER, or 'opschain context use <name>' — exit 2.
  • this command needs a login or an admin token — run 'opschain login', pass --auth-token, set OPSCHAIN_ADMIN_TOKEN, or store one with 'opschain admin login' — exit 2.
  • the server rejected the credential — run 'opschain login' again, or check the admin token — exit 1.
  • agent <id> is not known to this estate — admin agent verbs take the ocr_ member id from 'opschain admin agents list' (a UUID is usually the identity-side service_account_id, not the member id) — the unknown, already-revoked or runner id 404, exit 1.

See also​

  • opschain docs cli/admin-agent-revoke — refuse the identity instead of forgetting it.
  • opschain docs cli/admin-agent-drain — quiesce an online agent first.