Make the trigger identify a new run from a deduplicated one - #6893
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No blocking issues were identified, and the behavior is covered by tests.
Review effort: Lite
Findings: None
What changed in this PR
Updates the Hackbot client to distinguish newly created runs from deduplicated runs.
Changes:
- Adds
TriggeredRun.is_new. - Maps HTTP 201/200 responses to creation status.
- Adds coverage for deduplication and query parameters.
| File | Summary |
|---|---|
libs/hackbot-client/tests/test_client.py |
Tests new and deduplicated triggers. |
libs/hackbot-client/hackbot_client/models.py |
Defines the triggered-run model. |
libs/hackbot-client/hackbot_client/client.py |
Maps API responses to is_new. |
libs/hackbot-client/hackbot_client/__init__.py |
Exports TriggeredRun. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ayoubdiourin7
approved these changes
Sep 21, 2026
`dedupe_key` made `trigger_run` answer two different things with the same body: the run this request started, or the run that already held the key. The API distinguishes them by status code alone, `201` against `200`, and `RunRef.model_validate` throws that away, so a caller that needs to react to one and not the other has no way to. Which callers need to depends on what the key is keying. A retried webhook delivery does not care, and neither does a push that fans out. A Slack button does: someone is waiting on an answer, and "a run is already underway, here it is" is a different message from silence. `TriggeredRun` subclasses `RunRef` and adds `is_new`, so the three existing callers keep reading `run_id` off the return value unchanged. `is_new` belongs on this type rather than on `RunRef` because it is a property of the request, not of the run: the same run is `is_new` to the request that started it and not to every later request carrying its key. Named for the predicate it is, rather than `created`, which sits one underscore from the `created_at` on a run row.
suhaibmujahid
force-pushed
the
hackbot-client-triggered-run
branch
from
September 21, 2026 18:22
ead3fcf to
a7b9f96
Compare
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 #6891
Stack created with GitHub Stacks CLI • Give Feedback 💬