Repository navigation
Support dependencies that supply a task parameter's value from Annotated metadata - #591
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@twavv this carries your Annotated dependencies from uncalled-for#23 into docket, plus the |
Documentation build overview
3 files changed± api-reference/index.html± dependency-injection/index.html± getting-started/index.html |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 249c0fc4d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c33ebde71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0a2c5abe4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f0a2c5a to
04bd694
Compare
…ted metadata uncalled-for 0.6.0 resolves `db: Annotated[Connection, Depends(get_db)]` like a `Depends(get_db)` default, and adds `Provided` so the parameter stays optional for type-checked callers such as `docket.add(task)(...)`. Docket's contextual dependencies (CurrentDocket, CurrentWorker, CurrentExecution, TaskKey, TaskLogger) are now Providers, so they work as metadata too, and `Provided` is exported from docket. Docket bound each execution's arguments with `signature.bind`, which fails when a caller leaves out a required Annotated parameter. A ConcurrencyLimit on a sibling argument then raised TypeError, a parameter strike was silently skipped, and TaskArgument lost positional arguments. Those reads now use `bind_partial`, and `compact_signature` counts Annotated providers as dependencies in the worker's startup log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt
…guments A partial bind also accepted a call that left out an ordinary required argument, so a strike on another argument marked that malformed call STRUCK and hid it, where a full bind had let the task run and raise TypeError. Execution.bind_arguments now binds partially but raises TypeError for any missing parameter that no dependency supplies, and the strike check, ConcurrencyLimit's argument lookup, and the worker's provided-argument map all use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt
The worker's startup log read Annotated metadata itself and missed the bare-class shorthand, `Annotated[str, CurrentTenant]`, so it listed that parameter as one the caller passes. compact_signature now takes the task and collapses whatever get_dependency_parameters reports, which also covers type aliases and string annotations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt
The worker found lifecycle classes in parameter defaults and in the dependencies that wrap the call, so a Provider declared only as metadata, such as `Annotated[str, Pool()]`, never had its worker_lifecycle entered. It now scans every dependency that get_dependency_parameters reports, which covers both forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt
|
@codex review |
04bd694 to
24032fc
Compare
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24032fc7d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ConcurrencyLimit read its argument from the caller's call alone, so a limit on a parameter that a dependency supplies, such as `tenant: Annotated[str, Depends(get_tenant), ConcurrencyLimit(1)] = Provided`, keyed every task on the Provided sentinel, and a `Depends(...)` default keyed on the dependency object; either way every tenant shared one slot. It now asks the resolution frame for the argument, which returns the caller's value, the value a dependency supplies, or the default. Execution.get_argument had no other caller and gave the same wrong answer for dependency-supplied parameters, so it is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

uncalled-for 0.6.0 resolves
db: Annotated[Connection, Depends(get_db)]like aDepends(get_db)default, and addsProvidedso the parameter stays optional for type-checked callers such asdocket.add(task)(...). Docket's contextual dependencies (CurrentDocket, CurrentWorker, CurrentExecution, TaskKey, TaskLogger) are now Providers, so they work as metadata too, andProvidedis exported from docket.Docket bound each execution's arguments with
signature.bind, which fails when a caller leaves out a required Annotated parameter. A ConcurrencyLimit on a sibling argument then raised TypeError, a parameter strike was silently skipped, and TaskArgument lost positional arguments. Those reads now usebind_partial, andcompact_signaturecounts Annotated providers as dependencies in the worker's startup log.Stacked on #590, which moves docket to Python 3.11 through 3.15. Follows chrisguidry/uncalled-for#23 and chrisguidry/uncalled-for#24.
🤖 Generated with Claude Code
https://claude.ai/code/session_01P7t1QchSu9EFNKhYMZPedt