Prevent malformed retry delays from poisoning Nexus completions - #11617
Conversation
|
For the record the bug report from Codex is as follow
Nexus completion later converts the entire Temporal failure with Evidence:
Impact:
|
b7bb95b to
6ff1547
Compare
…oralio#11617) ## What changed? Validate the retry delay is a valid proto duration. ## Why? Prevent malformed retry delays from poisoning Nexus completions. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [x] added new functional test(s) ## Potential risks Potentially users could have been sending an invalid proto duration, unclear how exactly, and now we would fail their request.
What changed?
Validate the retry delay is a valid proto duration.
Why?
Prevent malformed retry delays from poisoning Nexus completions.
How did you test it?
Potential risks
Potentially users could have been sending an invalid proto duration, unclear how exactly, and now we would fail their request.
Note
Medium Risk
Request validation on the activity-failure path may reject clients that previously sent invalid duration payloads; behavior change is intentional but could surface latent bad callers.
Overview
RespondActivityTaskFailed and RespondActivityTaskFailedById now reject failures whose
ApplicationFailureInfo.NextRetryDelayis not a validgoogle.protobuf.Duration, including nested causes in the failure chain.A new
validateActivityFailureNextRetryDelayshelper runsCheckValid()on any set delay and returns InvalidArgument with a clear message instead of accepting malformed values that could break downstream handling (e.g. Nexus completions).Unit tests cover edge cases (range, sign mismatch, nested invalid delay); functional tests confirm both respond-by-token and respond-by-ID paths leave the activity RUNNING when validation fails and still allow a valid failure afterward.
Reviewed by Cursor Bugbot for commit b7bb95b. Bugbot is set up for automated code reviews on this repo. Configure here.