Draft: Remove the incremental checkpoint read gates
What does this MR do and why?
Removes the six blob-read feature flags (duo_workflow_read_incremental_checkpoints and dw_read_blobs_{api,graphql,trace,notifications,list}), all fully rolled out on GitLab.com. Gitlab::DuoWorkflow::IncrementalBlobGate collapses to one #read?, gated on the workflow's incremental_checkpoints_enabled column and the newest checkpoint header's channel membership. The gate class stays until the column drops in #627332. Second step after !255931 (merged) flips the same six flags to default-on; this MR stays Draft until that one has merged and the AI Gateway change is deployed.
Design notes
IncrementalBlobGate#read?(ee/lib/gitlab/duo_workflow/incremental_blob_gate.rb) replacesfor_notifications?,for_list?,for_trace?,for_graphql?,graphql_candidate?, andreconstruct?. It's true whenincremental_checkpoints_enabledis set andlegacy_checkpoint_fallback?is false for the newest header.Workflow.prime_latest_checkpoint_headers/prime_earliest_checkpoint_headers(ee/app/models/ai/duo_workflows/workflow.rb) checkworkflow.incremental_checkpoints_enabled?directly, not the gate, so filtering a page of workflows doesn't trigger a header query. Same for the__start__blob read inee/app/services/ai/duo_workflows/create_checkpoint_service.rb(write path). Behaviour is unchanged at both call sites.API::Helpers::DuoWorkflowHelpers#push_feature_flagsno longer pushesdw_read_blobs_apiorduo_workflow_read_incremental_checkpointsto the AI Gateway.- GraphQL field descriptions on
Query.duoWorkflowBranchesandDuoMessage.threadTs/parentTs/alternativeCountno longer mention the flag.doc/api/graphql/reference/_index.mdandpublic/-/graphql/introspection_result.jsonare regenerated. - The trace endpoint keeps its
read=incremental|legacyoverride and legacy branch until #611971. - Specs: contexts that stubbed a read flag off became "workflow not created with incremental checkpoints" (
update!(incremental_checkpoints_enabled: false)). The callback-hook spec inee/spec/requests/api/ai/duo_workflows/workflows_spec.rbstubs the write flagduo_workflow_incremental_checkpoints: falseinstead, so the created workflow stays on the plain checkpoint table. Tests that only asserted flag-off behaviour are deleted. - Deleted the six YAML files under
ee/config/feature_flags/wip/.Changelog: other,EE: true. - Ordering: the AI Gateway MR gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!6941 (merged) must merge and deploy first. Today the gateway gates its
by_thread_tsread on the two pushed flags plus the column; once this MR deletes the definitions Rails can't push them, and the gateway would fall back to the paged legacy read, which is empty under write-only. - This MR must merge before #629089 (stop legacy checkpoint writes). On self-managed both flag families default off, so stopping legacy writes while reads still hit the legacy table would lose data.
References
- Issue: #629088
- Merge first (default-on step): !255931 (merged)
- Gateway MR (merge first): gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!6941 (merged)
- Blocked by this MR: #629089
- Follow-ups: #627332, #611971
- Rollout issues: #604687, #606987, #606988, #606989, #606990, #614021, #612821
Screenshots or screen recordings
No UI change.
How to set up and validate locally
- Start the GDK at http://gdk.test:3000 with a project that has Duo Agent Platform enabled.
- In the rails console, run
Feature::Definition.get(:dw_read_blobs_graphql). Expect:nil. - Start a Duo Agentic Chat session in the project with any prompt. Expect: a workflow with
incremental_checkpoints_enabled: truethat writes headers and blobs. - Query GraphQL:
duoWorkflowWorkflows(projectPath:) { nodes { id latestCheckpoint { threadTs duoMessages { content threadTs parentTs } } } }. Expect: messages come back withthreadTsset (blob read path). - Call
GET http://gdk.test:3000/api/v4/ai/duo_workflows/workflows/<id>/trace.jsonlwith a PAT. Expect:ui_chat_loglines with the chat content. - In the rails console, run
Ai::DuoWorkflows::Workflow.find(<id>).incremental_blob_gate.read?. Expect:true. - On that workflow, run
update!(incremental_checkpoints_enabled: false)and callincremental_blob_gate.read?on a freshfind. Expect:false.
Extra checks
- Call the trace endpoint with
?read=legacy. Expect: it reads from the checkpoints table. - A workflow whose newest header has
channel_keys: nil. Expect:read?returnsfalseand readers use the legacy table.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.