review-classifier: ask a check once more when its answer isn't valid JSON
An answer that fails to validate is asked for a second time, for that classification only, with a reminder to reply with the JSON object alone. The second ask comes out of the classification's CLASSIFICATION_DEADLINE: it gets what the first ask left, and is skipped when less than 20 seconds remain, so RUN_DEADLINE's bound still holds. A failed ask (runtime error, timeout) is not repeated. If the second answer does not validate either, the row has no answer, as before. Model::ask takes the deadline for the ask; the ACP runtime no longer holds its own. The parser also takes the first fenced block of a reply that has prose around the fence; prose around a bare object is still rejected.
This commit is contained in:
parent
b8897e7c7a
commit
ce7b3e055f
8 changed files with 345 additions and 66 deletions
|
|
@ -23,8 +23,8 @@ pub const QUEUE_GROUP: &str = "review-classifier";
|
|||
/// The most classifications one run carries.
|
||||
pub const MAX_CLASSIFICATIONS: usize = 10;
|
||||
|
||||
/// The longest one classification's model run may take before it is stopped
|
||||
/// and its row carries a timeout.
|
||||
/// The longest one classification may take, its first ask and any second ask
|
||||
/// together, before it is stopped and its row carries a timeout.
|
||||
pub const CLASSIFICATION_DEADLINE: Duration = Duration::from_mins(3);
|
||||
|
||||
/// The longest a whole run may take: every classification at its deadline,
|
||||
|
|
|
|||
Loading…
Reference in a new issue