Skip to content

[codex] Add chat ACL attachments and generic tool references#137

Merged
thorinside merged 14 commits into
mainfrom
codex/chat-acl-context-reference-tools
Jun 23, 2026
Merged

[codex] Add chat ACL attachments and generic tool references#137
thorinside merged 14 commits into
mainfrom
codex/chat-acl-context-reference-tools

Conversation

@thorinside

Copy link
Copy Markdown
Owner

Summary

  • add chat attachment support, allowed file roots, and ACL-backed local file tooling
  • add context status controls, provider-specific context window resolution, and safer compaction behavior
  • add algorithm_info plus generic tool_reference, read_reference, and search_reference handling across chat and MCP tools
  • simplify attachment actions and polish the parameter action button spacing

Why

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 analyze
  • focused chat/MCP harness tests
  • full flutter test (2679 tests passed)

- 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
@thorinside thorinside marked this pull request as ready for review June 23, 2026 20:35
@thorinside thorinside merged commit 44a782f into main Jun 23, 2026
@thorinside thorinside deleted the codex/chat-acl-context-reference-tools branch June 23, 2026 20:37
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.

1 participant