Skip to content

Return SDK Task objects from list_tasks - #61

Open
snopoke wants to merge 6 commits into
mainfrom
sk/list-tasks-wrapper
Open

Return SDK Task objects from list_tasks#61
snopoke wants to merge 6 commits into
mainfrom
sk/list-tasks-wrapper

Conversation

@snopoke

@snopoke snopoke commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

list_tasks handed back the raw generated PaginatedTaskList, so .results were internal.models.Task — no update(), safe_update(), or any of the SDK surface. Callers had to know about internal/ to do anything useful with a listed task. It now returns a TaskList wrapping SDK Tasks, iterable directly.

Two compatibility notes for the reviewer, both deliberate:

  • TaskList defines __len__, so an empty page is now falsy where PaginatedTaskList was always truthy. if taskbadger.list_tasks(...) changes meaning.
  • The generated model's mapping protocol over additional_properties (page["unknown_key"], "k" in page) doesn't pass through — special methods bypass __getattr__. page.additional_properties still works. Nothing in-repo used it; flagging in case it's considered public.

Also here, unrelated to the above:

  • Celery eager/canvas tasks ignored a per-call taskbadger_parent and always nested under the enclosing task. They now honour it, including an explicit None meaning "make this a root task", matching publish-time behavior.
  • invoke tag-release now runs uv lock before committing — the lockfile pins the project's own version, so it was going stale on every release.

Wrap the generated PaginatedTaskList so the public API stops leaking
taskbadger.internal models.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@snopoke
snopoke marked this pull request as ready for review August 6, 2026 15:50
snopoke and others added 4 commits August 6, 2026 20:31
These are created in task_prerun rather than at publish time, where the
explicit parent was being ignored.

Also disconnect all signal handlers in the system integration test, not
just task_prerun — the rest stayed connected from the stale module and
fired twice for the remainder of the session.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@snopoke
snopoke force-pushed the sk/list-tasks-wrapper branch from 6799d9a to bec0786 Compare August 6, 2026 18:33
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant