Support cursor and codex external agent types

What

Adds cursor and codex to Ai::ExternalAgents::AgentIdentity::AGENT_TYPES, so identities and sessions can be registered for them through the API.

Changes

  • Model: AGENT_TYPES now includes cursor and codex. The identities and sessions API params read from this list, so they pick up the new types with no further change.
  • Frontend: add codex to AGENT_TYPE_LABELS (cursor was already there) and cursor and codex to CLIENT_TYPES. Without these, the agent artifacts view labels them as GitLab Duo or a humanized fallback.
  • Specs: extend utils_spec.js and add an identities request spec that registers every type in AGENT_TYPES. The model spec already iterates AGENT_TYPES.

Not included

  • Sessions::CreateService still hardcodes source: :claude_code_glab. Cursor and codex sessions created through glab are therefore labelled Claude Code (glab). Fixing this needs a new session source value, which touches GraphQL and ClickHouse, so it belongs in a follow-up.
  • Mcp::Audit::ResolveSessionService already maps cursor and codex, so it needs no change.
Why no migration

ai_agent_identities.agent_type is a text column with a limit of 50 and no DB check constraint. The allowlist is enforced only by the model validation.

Edited by Jean van der Walt

Merge request reports

Loading
Loading