Skip to content

Make the trigger identify a new run from a deduplicated one - #6893

Merged
suhaibmujahid merged 1 commit into
masterfrom
hackbot-client-triggered-run
Sep 21, 2026
Merged

suhaibmujahid merged 1 commit into
masterfrom
hackbot-client-triggered-run

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Resolves #6891


Stack created with GitHub Stacks CLIGive Feedback 💬

@suhaibmujahid
suhaibmujahid requested a review from a team as a code owner September 21, 2026 05:08
Copilot AI lite review requested due to automatic review settings September 21, 2026 05:08
@suhaibmujahid
suhaibmujahid added this pull request to stack #6900 September 21, 2026 05:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

`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
suhaibmujahid force-pushed the hackbot-client-triggered-run branch from ead3fcf to a7b9f96 Compare September 21, 2026 18:22
@suhaibmujahid
suhaibmujahid merged commit 55148a6 into master Sep 21, 2026
9 checks passed
@suhaibmujahid
suhaibmujahid deleted the hackbot-client-triggered-run branch September 21, 2026 20:30
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.

Support identifying new runs from deduplicated ones through Hackbot client

3 participants