Add run dedupe key and idempotent create flow - #6861
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Production triggers remain unkeyed, and permanent uniqueness conflicts with the requirement to deduplicate only currently running jobs.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds API-level run deduplication using caller-provided keys.
Changes:
- Adds dedupe-key persistence, validation, filtering, and collision handling.
- Exposes deduplication through the client and UI types.
- Adds supporting tests and documentation.
File summaries
| File | Description |
|---|---|
services/hackbot-ui/lib/types.ts |
Adds dedupe keys to UI run documents. |
services/hackbot-api/tests/test_finalize_run.py |
Updates no-execution finalization coverage. |
services/hackbot-api/tests/test_create_run_api.py |
Tests keyed creation and collisions. |
services/hackbot-api/tests/conftest.py |
Adds reusable API test fixtures. |
services/hackbot-api/app/schemas.py |
Exposes dedupe keys in API schemas. |
services/hackbot-api/app/routers/runs.py |
Implements validation, claiming, and filtering. |
services/hackbot-api/app/database/models.py |
Adds the dedupe column and unique index. |
services/hackbot-api/alembic/versions/a7d4e9c21b83_runs_dedupe_key.py |
Migrates the database schema. |
libs/hackbot-client/hackbot_client/client.py |
Supports sending dedupe keys. |
docs/hackbot/api.md |
Documents deduplication behavior. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
suhaibmujahid
marked this pull request as draft
September 16, 2026 15:27
suhaibmujahid
marked this pull request as ready for review
September 16, 2026 16:48
evgenyrp
reviewed
Sep 16, 2026
evgenyrp
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6279