Repository navigation
Classify validator-rejected dialog answers as model output - #296
Merged
Merged
Conversation
…col faults The session engine typed answers that our sanitizer emptied, that skipped a requested image tool, or that failed outbound validation as provider_protocol_error. The terminal routing event then blamed a healthy provider. Report these exits, and the Gemini adapter's empty final text, as model_output_rejected, matching the shared message classifier. Undecodable bodies stay protocol faults. Fixes #277
(cherry picked from commit 3bf77dc)
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.
Problem
Two dialog session-engine exits reported
provider_protocol_errorwhen the provider answered and our own validation rejected the answer:dialog_turn/session.rs, sanitize branch);dialog_turn/session.rs, outbound branch).The job-retry exhaustion event then repeated that class, so the admin report and the maintenance controller blamed a healthy provider. Production attribution for #277: all 11 job exhaustions labelled
provider_protocol_errorsince 2026-10-20 carry the ledger reasonsanitized_empty_exhausted(9 × "dialog answer became empty after sanitization", 2 × "did not execute the explicitly requested image tool"); none came from an endpoint decode failure.The Gemini adapter had the same disagreement: it typed "empty final text" as a protocol error, while the shared message classifier maps that phrase to
model_output_rejected.Change
FailureReason::ModelOutputRejected.ModelOutputRejected. Undecodable bodies, missing candidates and missing content stayProviderProtocolError.Behaviour is otherwise unchanged. These exits never reach the routed walker, so they never charged a circuit breaker; the whole turn is still requeued with the same attempt cap and turn budget. Only the reported class changes, and
is_admin_actionable_eventdoes not depend on it.Tests
dialog_worker_fails_when_answer_sanitizes_to_empty_after_attempts_exhausted, the raw-empty and the undeliverable-answer exhaustion tests now also assert that the terminalall_attempts_exhaustedrouting event carrieslast_retryable_reason = model_output_rejected.gemini_empty_text_is_a_model_output_rejection_and_a_bad_body_a_protocol_faultcovers both Gemini empty-text paths and keeps an undecodable body asprovider_protocol_error.Local checks:
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test -p openplotva-llm,cargo test -p openplotva-app.Fixes #277