Skip to content

fix: harden the Reply Drafter — foreground gate, model integrity, line endings#2276

Merged
enaboapps merged 1 commit into
mainfrom
fix/reply-drafter-review-fixes-2275
May 22, 2026
Merged

fix: harden the Reply Drafter — foreground gate, model integrity, line endings#2276
enaboapps merged 1 commit into
mainfrom
fix/reply-drafter-review-fixes-2275

Conversation

@enaboapps
Copy link
Copy Markdown
Collaborator

Summary

Addresses the three items from the v2.25.0 code review.

  • External switches #1 — AICore foreground gate. ReplyDrafterViewModel no longer drafts from init; ReplyDrafterActivity.onResume() calls viewModel.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.
  • Implement press, and hold switch actions #2 — model integrity. AiModelConfig.EXPECTED_SHA256 is set to the hosted artifact's hash, so ModelDownloader.verifyChecksum() actually verifies the ~3 GB download instead of trusting the byte count alone.
  • Hud #3 — line endings. app/build.gradle.kts renormalized 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.
  • On the S26 (AICore): the Reply Drafter drafts via Gemini Nano with no BACKGROUND_USE_BLOCKED.
  • A corrupted/truncated model download is rejected by the checksum.

Closes #2275

…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.
@enaboapps enaboapps added this to the v2.25.0-beta.7 milestone May 22, 2026
@enaboapps enaboapps merged commit d717536 into main May 22, 2026
@enaboapps enaboapps deleted the fix/reply-drafter-review-fixes-2275 branch May 22, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden the Reply Drafter: AICore foreground gate, model integrity, build-file line endings

2 participants