Repository navigation
policy_fn: make verdict timeouts configurable - #296
Merged
Merged
Conversation
Held policy verdicts always expired after five seconds, leaving too little time for interactive human approval. Group callbacks and verdict timeouts in PolicyFn across Rust, Python and Go. Keep the five-second default and allow an unlimited wait. Pass the timeout alongside the callback through the C API and update the examples and documentation for the new configuration. Use CancellationToken to cancel pending verdicts on sandbox shutdown. Discard expired and queued callbacks, expose cancellation to active callbacks, and join the worker before releasing callback data. Allow long approvals during startup without the old five-second ceiling. Add coverage for deadlines, unlimited waits, cancellation and SDK configuration. Final validation is delegated to GitHub CI because local disk space is low. Fixes #288 Signed-off-by: Cong Wang <cwang@multikernel.io>
congwang-mk
force-pushed
the
approval-timeout-288
branch
from
October 13, 2026 17:16
585d7f7 to
81df7f9
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.
Held policy verdicts currently expire after five seconds, which is too short for interactive human approval. This change makes the timeout configurable, including an unlimited wait, while preserving the five-second default.
Callback configuration now lives in
PolicyFnin Rust, Python and Go. The C setter receives the callback and timeout together. This deliberately changes the SDK API without compatibility aliases before 1.0.Shutdown cancels pending verdicts through
CancellationToken, discards queued callbacks and joins the callback worker before releasing its data. Active callbacks can check cancellation cooperatively. Startup also allows approvals that exceed the previous five-second ceiling.Validation:
Fixes #288