feat: add client-surface source values to Duo Agent Platform session tracking

What does this MR do and why?

Adds four client-surface values — duo_cli_interactive, duo_cli_run, duo_cli_acp, ide_extension — to WORKFLOW_ACTIONS_SOURCE, so Duo CLI and IDE-extension clients can attribute their agent_platform_session_created events to the surface that created the session.

Today no client sends source, so CLI and IDE usage of Duo Developer are indistinguishable in Snowflake. Rails already forwards source into gitlab_standard.extra on the session-created event; the only missing server-side piece is accepting these values (the param is validated against a closed list — unknown values fail session creation with a 400).

Step 1 of 4 (Rails → gitlab-lsp → Duo Workflow Service → dashboards) for #612068. Architecture reference: Duo Agentic Platform Tracking wiki.

Clients gate on this MR's milestone: the gitlab-lsp change only sends source to instances at (merged milestone + 1) or later, so old instances never receive an unknown value. Please keep the milestone label accurate at merge time.

Changes

  • ee/lib/api/ai/duo_workflows/workflows.rb: extend WORKFLOW_ACTIONS_SOURCE.
  • ee/config/events/agent_platform_session_created.yml: document both value families (feature entry points vs client surfaces) and the permanently-unattributed populations.
  • doc/api/duo_agent_platform_flows.md + regenerated doc/api/openapi/openapi_v3.yaml.
  • ee/spec/requests/api/ai/duo_workflows/workflows_spec.rb: guard spec pinning the client-surface values (removing one would 400 every session create from released clients).

Testing

  • bundle exec rspec ee/spec/requests/api/ai/duo_workflows/workflows_spec.rb -e 'when source param is provided' — 5 examples, 0 failures.
  • bundle exec rspec ee/spec/services/ai/duo_workflows/create_workflow_service_spec.rb — 140 examples, 0 failures.
  • rake gitlab:openapi:v3:check_docs — up to date.
  • End-to-end against GDK + Snowplow Micro: POST with source=duo_cli_interactive → 201 and the Snowplow event carries gitlab_standard.extra.source=duo_cli_interactive; unknown value → 400 source does not have a valid value; /micro/bad stays 0.

References

Merge request reports

Loading
Loading