fix: harden the Reply Drafter — foreground gate, model integrity, line endings#2276
Merged
Merged
Conversation
…e endings Addresses code-review feedback on the v2.25.0 changeset. - Start inference from ReplyDrafterActivity.onResume() instead of the view model's init, so it cannot run before the activity is the top foreground app — AICore (Gemini Nano) refuses background inference. - Set AiModelConfig.EXPECTED_SHA256 so ModelDownloader verifies the ~3 GB model download instead of trusting the byte count alone. - Renormalize app/build.gradle.kts to LF to match the rest of the repo, removing ~385 lines of phantom line-ending churn.
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
Addresses the three items from the v2.25.0 code review.
ReplyDrafterViewModelno longer drafts frominit;ReplyDrafterActivity.onResume()callsviewModel.start()(guarded to run once). Inference can no longer fire before the activity is the top foreground app — which is what AICore (Gemini Nano) requires.AiModelConfig.EXPECTED_SHA256is set to the hosted artifact's hash, soModelDownloader.verifyChecksum()actually verifies the ~3 GB download instead of trusting the byte count alone.app/build.gradle.ktsrenormalized CRLF→LF to match the rest of the repo; removes ~385 lines of phantom churn from the v2.25.0 cumulative diff.Test plan
./gradlew compileDebugKotlin testDebugUnitTest— compiles, tests pass.BACKGROUND_USE_BLOCKED.Closes #2275