Skip to content

Actions log downloads ignore tool cancellation #3705

Open

Description

@flysheep-ai

Problem

downloadLogContent accepts the caller's context, but starts the HTTP download with http.Get. Canceling get_job_logs does not interrupt a pending download or an open streaming response. The function can continue consuming download resources after the tool call has been canceled.

Reproduction

Use a local HTTP server that either withholds response headers or flushes headers and one log line, then keeps the response open. Invoke downloadLogContent with a cancellable context and cancel after the server receives the request. On main at 99d6d65, the function remains blocked until the fixture is released. An already-cancelled call also reaches the server and succeeds instead of reporting context.Canceled.

Expected: the existing context governs the HTTP request, so cancellation stops waiting and is preserved in the wrapped error. Successful downloads should retain the same log tail and line count.

Environment and scope

Go 1.27.3, macOS arm64. Three cancellation cases reproduced using local httptest servers only; no live GitHub calls. A normal three-line response is also checked to preserve the last two lines and total count.

A focused local fix uses NewRequestWithContext and the same http.DefaultClient. No URL policy, credentials, content limit or schema change is proposed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions