Skip to content

Give Drukbox a valid Idempotency-Key for every run id - #840

Merged
czpython merged 1 commit into
czpython:mainfrom
stefanfoulis:stefanfoulis/provisioning-key-charset
Oct 6, 2026
Merged

czpython merged 1 commit into
czpython:mainfrom
stefanfoulis:stefanfoulis/provisioning-key-charset

Conversation

@stefanfoulis

Copy link
Copy Markdown
Contributor

Fixes #839.

provisioning_key() keeps a key that Drukbox accepts unchanged. Any other key (a DBOS schedule run id carries +00:00; an id can be longer than 255) becomes its accepted characters plus the first 16 hex digits of its sha256: two run ids never share a key, and a retry of the same run builds the same key and finds its box.

Tests

  • tests/test_provisioning_key.py: a real schedule run id, keys that differ only in a refused character, an accepted key unchanged, a key over 255 characters.
  • Live: sandbox_client.ephemeral(idempotency_key=provisioning_key("sched-…-trigger-2026-10-05T19:26:34.645715+00:00", "probe")) created and released a box; before, the same id got 422.

DBOS 3 names a scheduled run sched-<name>-<timestamp>, and the timestamp
carries +00:00. Drukbox accepts only [A-Za-z0-9_-:.] up to 255 characters,
so every scheduled run that needs a sandbox failed before its box existed.
A refused key now becomes its accepted characters plus a hash of the whole
key; an accepted key is unchanged.
@stefanfoulis
stefanfoulis requested a review from czpython as a code owner October 5, 2026 19:31

@czpython czpython left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good catch, thanks!

@czpython
czpython merged commit ae50705 into czpython:main Oct 6, 2026
4 checks passed
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.

Scheduled runs fail: DBOS run ids carry '+', which Drukbox refuses in the Idempotency-Key

2 participants