Fix truncated send-url bodies in Duo Workflow HTTP actions

What does this MR do and why?

Workhorse runs runHTTPRequest actions for Duo Agent Platform sessions itself, and collects each response in a nullResponseWriter. That writer does not implement http.Flusher.

sendurl flushes after every write through http.ResponseController.Flush(), and stops copying when a flush fails. For nullResponseWriter the flush fails with http.ErrNotSupported. As a result, any send-url response reaches Duo Workflow Service as status 200 with only the first chunk of the body (at most 32 KiB) and no error.

Since ci_job_trace_api_archived_log_via_workhorse reached 100% on GitLab.com (2026-09-22), archived job logs are served through send-url. So get_job_logs in agent flows now gets only the first chunk of each log. For the Fix pipeline flow, that is the runner setup output rather than the test failures at the end of the log.

This MR adds a no-op Flush() to nullResponseWriter. The body is already buffered in full, so there is nothing to flush.

References

Screenshots or screen recordings

Not applicable: no UI change.

How to set up and validate locally

  1. Run the new test:
    cd workhorse
    go test ./internal/ai_assist/duoworkflow -count=1 -run 'TestRunHttpActionHandler_Execute/backend_that_flushes_after_each_write'
    Without the fix, it fails with expected: "chunk-chunk-chunk-", actual: "chunk-".
  2. Optional end-to-end check: with job artifacts in object storage and the flag enabled, run an agent flow that calls get_job_logs on an archived job log larger than 32 KiB. The response should contain the whole log.

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.

Merge request reports

Loading
Loading