Repository navigation
Conversation
…ures
The note went to every LlamaModelException before output, so a context
overflow reported later by the stream ("C API 1.0 stream failed") got it
too. The v1 conversation now marks a failed send call with
LiteRtLmSendFailureException and only that type gets the note; stream
failures and LiteRtLmV1CopyLossException pass through unchanged.
Refs #1868, #1874
leehack
marked this pull request as ready for review
November 10, 2026 02:05
Contributor
|
Chat app preview for Space: https://huggingface.co/spaces/leehack/llamadart-chat-pr-1875 |
leehack
added a commit
that referenced
this pull request
Nov 10, 2026
leehack
added a commit
that referenced
this pull request
Nov 10, 2026
Owner
Author
|
Landed on main via batch integration PR #1895 (rebase merge, main |
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.
Summary
ModelParams.chatTemplatenote, as the legacy runtime already did._generateChatcaught onlyStateError.conversation_send_message_stream, where template failures surface) asLiteRtLmSendFailureException(aLlamaModelException), and only that type gets the note, keeping its type anddetails. Failures the stream reports later (C API 1.0 stream failed, such as a context overflow) andLiteRtLmV1CopyLossExceptionpass through unchanged, as do otherLlamaExceptions.Fixes #1868. Refs #1874.
Production-readiness scope
Completeness checklist
detailspreserved; anotherLlamaExceptionunchanged; v1 conversation tests assert the send-call failure type and that stream failures are not marked.PR type guidance
litert_lm_service_test.dart; native platforms only.Test Plan
dart run tool/prepare_workspace.dartdart format --output=none --set-exit-if-changed .dart analyzedart test -p vm -j 1 --exclude-tags local-only(CI)dart test -p chrome --exclude-tags local-only(CI)coverage-libN/A: the new branch is covered by the unit tests above; main enforces the threshold.TMPDIR=$(mktemp -d) dart test -p vm -j 1 test/unit/backends/litert_lm/litert_lm_service_test.dartMutations (each fails the tests): retyping the v1 note as
StateError; catching anyLlamaModelException(note on stream failures); droppingdetails; retyping to plainLlamaModelException; not marking the send failure in the v1 conversation; dropping the catch.Matrix Evidence
static-format-analyzeroot-vmtest/unit/backends/litert_lm1542 testshigh-risk-exact-head-independent-qaReview Notes
df7cf70e2passed with 3 findings, fixed in03d50e48e.High-risk regression review
backendRuntime, fromclassify_high_risk_changes.dart; the change is a diagnostic-only catch clause)Independent audit
Exact head
03d50e48e8f9c40bf1bb56f0116513049a8a26d7againstmainf78cafa97: PASS (delta re-audit after the first pass), 0 blocking, 0 PR-caused P1, 0 threads. Real model (Qwen3-0.6B.litertlm, CPU): a custom template failing at send keeps the note; context overflow gets no note; cancel and normal requests unchanged. 11/12 mutants killed (survivor is unobservable today). Readiness evidence v2: local run exits 2. Non-blocking items tracked on #1861.