[codex] Add chat ACL attachments and generic tool references#137
Merged
Conversation
- Add image/file attachments for chat providers and UI input paths - Replace local filesystem tools with allowed-root ACL tools for chat/MCP - Harden path handling, symlink rejection, overwrite behavior, and settings migration Verification: - flutter analyze - flutter test test/chat/services/local_file_tools_test.dart test/services/settings_service_test.dart test/chat/cubit/chat_cubit_test.dart test/chat/providers/openai_subscription_provider_test.dart - flutter test
- Add provider-owned context window resolution for Anthropic and OpenAI-compatible models - Query Anthropic model metadata and best-effort OpenAI-compatible model metadata with cached model-family fallback - Trigger chat compaction at 85% of resolved context window using peak prompt tokens Verification: - flutter analyze - flutter test test/chat/providers/model_context_window_test.dart test/chat/cubit/chat_cubit_test.dart test/chat/services/chat_service_rate_limit_test.dart - flutter test
- Replace separate file, image, and paste-image buttons with one attachment button - Keep keyboard image paste and drag/drop attachment support intact - Update input width calculation for the smaller action set Verification: - flutter analyze - flutter test test/chat/cubit/chat_cubit_test.dart test/chat/providers/openai_subscription_provider_test.dart
- Replace animated permission chips with a fixed checkbox table - Use Material spacing increments around allowed-root editors - Keep permission semantics labels on the checkbox controls Verification: - flutter analyze - flutter test test/services/settings_service_test.dart
- Omit roots whose directories are no longer mounted from list_allowed_roots - Keep direct stale root IDs returning root_not_found_on_disk - Add regression coverage for unmounted allowed roots Verification: - flutter test test/chat/services/local_file_tools_test.dart - flutter analyze
- Replace the chat header clear icon with a custom context arc indicator - Show a context details dialog with token usage, message/tool/attachment breakdown, Compact, and Clear actions - Track resolved context window and peak context input in chat state - Color the indicator green/orange/red ahead of the 85% compaction threshold Verification: - flutter analyze - flutter test test/chat/ui/chat_panel_test.dart test/chat/cubit/chat_cubit_test.dart
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
algorithm_infoplus generictool_reference,read_reference, andsearch_referencehandling across chat and MCP toolsWhy
This brings the useful forked AI-chat functionality into the current shape without copying the oversized tool surface. File access is constrained by allowed roots and permissions, large tool responses are paged/searchable by reference, and context accounting now tracks provider metadata and cache-token usage more accurately.
Validation
flutter analyzeflutter test(2679tests passed)