feat: gate managed Turn host starts by owner cadence - #4929
Open
huangruiteng wants to merge 3 commits into
Open
huangruiteng wants to merge 3 commits into
huangruiteng wants to merge 3 commits into
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
This branch has not been deployed
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.
An owner can set a 24-hour automatic execution floor, yet a managed
turn run-oncehost failure or invalid result could start a new model immediately on retry. This change reserves a start atomically in the existing quota policy store before each new managed host attempt. An early retry returns the next eligible time without invoking the host, writing back a result, or spending a quota slot; cached settlement still replays without another reservation.The store upgrades M1 policy files in place to v2 and retains start records across restart. Goal floors apply per agent, and an automation-specific floor requires a stable
--automation-id. An explicit--manual-interval-bypass-reasonbypasses only the interval and records the manual start. The CLI renders the interval wait and next eligible time. The English and Chinese RFCs now distinguish this managed Turn candidate from the still-unqualified Codex App timer-to-hook path and other launchers.Validation: 140 Python Turn/cadence tests; six TypeScript cadence tests covering exact due time, concurrency, restart, scope isolation, manual bypass and M1 migration; focused final CLI/retry tests; TypeScript typecheck, Ruff, public-boundary scan, and exact-head change-quality receipt
cqr_a7e80b9285d5ac8e1ad9passed. The risk-based premerge gate passed all 19 checks with no manual holds. The scoped mypy command has existing errors on main (87) and this branch (84), with no new normalized errors. No live model call or existing automation change was made.This PR changes the managed CLI entry point and quota/Turn readback. The Codex App schedule recommendation remains the M1 behavior; App pre-model hook coverage and the packaged settings editor are separate acceptance work. No frontend code changes are needed for this managed CLI slice.