Skip to content

fix: task listing, timestamps and relay bugs #208

Closed

Description

@uniqueg

Why?

A review of the task controllers found several bugs:

  • GET /tasks raises IndexError (500) when no task matches, and returns a next_page_token on the last page, so clients keep paging (Next page cursor loop #165; fix: resolve next page cursor loop #189 changed the bug but didn't fix it). Invalid page_token values give 500 instead of 400.
  • name_prefix is put unescaped into a MongoDB $regex (^{name_prefix}): callers can send arbitrary regular expressions (expensive patterns, matches beyond the prefix).
  • For non-Funnel backends, create_task() replaces the task's Input/Output objects with bare URL strings (remove_auth()), drops inputs without URL (content), and keeps the changed payload for the next backend tried. Tasks with inputs likely fail on TESK and Poiesis.
  • creation_time, start_time and end_time are local-time strings (%m-%d-%Y %H:%M:%S), not RFC 3339 as TES requires.

How?

  1. Listing: empty next_page_token ("") when there is no next page, no error for empty results, 400 for invalid page_tokens, page_size bounds (TES: default and maximum as configured).
  2. name_prefix: escape with re.escape() (prefix match only).
  3. Relay: strip credentials from URLs field by field, keeping the model objects and inputs without URL; build the payload per backend from an unchanged copy.
  4. Timestamps: timezone-aware UTC, RFC 3339.
  5. Tests for each case.

Acceptance criteria

  • Paging through all tasks ends with an empty next_page_token; empty listings return 200 with no tasks; invalid tokens return 400.
  • name_prefix matches literally.
  • Inputs and outputs reach non-Funnel backends as objects, including inputs with content; each backend gets the same payload.
  • Timestamps are RFC 3339 in UTC.

Closes #165.

Activity

  1. added
    priority: high
    status: blocked
    type: bug
    type: security
    workload: hours
    on Oct 22, 2026
  2. added
    status: in progress
    and removed
    status: blocked
    on Oct 22, 2026
  3. removed
    status: in progress
    on Oct 22, 2026
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

    priority: hightype: bugtype: securityworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions