Skip to content

fix: harden multimodal context overflow handling#101

Merged
leehack merged 1 commit intomainfrom
fix/multimodal-context-safety
Apr 2, 2026
Merged

fix: harden multimodal context overflow handling#101
leehack merged 1 commit intomainfrom
fix/multimodal-context-safety

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented Apr 2, 2026

Summary

  • fail native multimodal prompt-evaluation overflow paths before sampling so chat/app flows surface Dart errors instead of hitting a native assert
  • downscale staged chat-app image picks to a 384px max edge across Android, iOS, macOS, and Web to reduce multimodal context pressure on follow-up turns
  • document the multimodal tuning guidance and keep a local-only macOS Qwen3.5 repro harness alongside CI-safe provider coverage for the new overflow message

Testing

  • dart analyze lib/src/backends/llama_cpp/llama_cpp_service.dart test/e2e/tooling/qwen35_multimodal_macos_repro_e2e_test.dart
  • flutter analyze lib/providers/chat_provider.dart test/unit_test.dart
  • flutter test test/unit_test.dart

Fail native multimodal prompt overflows before sampling and shrink staged chat-app images so follow-up turns stay within context more often.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.27273% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.77%. Comparing base (ab12d17) to head (4820da2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/backends/llama_cpp/llama_cpp_service.dart 27.27% 8 Missing ⚠️

❌ Your patch status has failed because the patch coverage (27.27%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
- Coverage   76.86%   76.77%   -0.10%     
==========================================
  Files          67       67              
  Lines        8394     8399       +5     
==========================================
- Hits         6452     6448       -4     
- Misses       1942     1951       +9     
Flag Coverage Δ
unittests 76.77% <27.27%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leehack leehack merged commit ad68d36 into main Apr 2, 2026
6 checks passed
@leehack leehack deleted the fix/multimodal-context-safety branch April 2, 2026 17:55
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.

2 participants