Repository navigation
Add idempotent dispatch submissions - #87
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Included review availability: 1 review is currently available. Based on recent review activity, included reviews refill at 4 per hour. 📝 WalkthroughWalkthroughThe dispatch client now accepts an optional ChangesDispatch idempotency-key flow
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to The new keyed retry path can recover an already accepted job, but it depends on the server replacing the callback destination atomically; otherwise the client may miss the callback and fail to complete or cancel the recovered job. The PR is mergeable with explicit owner awareness that the companion contract or polling fallback must be in place before production rollout. Sequence Diagram(s)sequenceDiagram
participant Caller
participant run
participant _submit_and_poll
participant Smithers
Caller->>run: Provide idempotency_key
run->>_submit_and_poll: Forward idempotency_key
_submit_and_poll->>Smithers: Submit job with key
Smithers-->>_submit_and_poll: Response or lost response
_submit_and_poll->>Smithers: Retry with same key
Smithers-->>_submit_and_poll: Return existing job
_submit_and_poll->>Smithers: Poll job
Smithers-->>Caller: Return result
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds an optional idempotency key to function dispatch submissions so callers can safely retry after transient submission/response failures without creating duplicate smithers jobs, while keeping existing unkeyed callers backward compatible.
Changes:
- Plumbs a new optional
idempotency_keyparameter throughjig.dispatch.run()into the smithers submission JSON payload. - Documents the idempotency behavior in
run()’s docstring. - Adds tests covering inclusion, omission (back-compat), and a retry-after-response-loss recovery path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_dispatch_module.py | Adds coverage for keyed submissions, optional omission, and retry recovery behavior. |
| src/jig/dispatch/client.py | Adds idempotency_key parameter and includes it in the smithers submission payload; documents behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Verification
Integration
Gecko PR #366 pins this commit and uses its deterministic DBOS operation identity as the submission key. Requires the companion Smithers idempotent-job-submission contract before production rollout.
Summary by CodeRabbit
New Features
Bug Fixes