Dhanji R. Prasanna
b73dfacb7a
refactor(g3-core): extract provider_registration and session modules
Extract two focused modules from the monolithic lib.rs (3372 lines):
1. provider_registration.rs (233 lines)
- Consolidates duplicated provider registration patterns
- Single determine_providers_to_register() function for mode-based selection
- Unified register_providers() async function for all provider types
- Includes unit tests for registration logic
2. session.rs (394 lines)
- Session ID generation (generate_session_id)
- Context window persistence (save_context_window, write_context_window_summary)
- Error logging (log_error_to_session)
- Utility functions (format_token_count, token_indicator)
- Session restoration helper (restore_from_session_log)
- Includes comprehensive unit tests
Also fixes:
- Removed redundant tool_executed assignment that triggered unused warning
- Removed unused Message import in session.rs
Results:
- lib.rs reduced from 3372 to 2976 lines (-396 lines, -11.7%)
- All tests pass, no warnings
- Behavior preserved (pure mechanical extraction)
Agent: fowler
2026-01-07 10:20:28 +11:00
..
2026-01-07 09:59:15 +11:00
2025-12-22 16:27:35 +11:00
2026-01-03 17:38:25 +11:00
2025-12-22 16:45:17 +11:00
2026-01-07 10:20:28 +11:00
2025-12-22 16:27:35 +11:00
2025-12-22 16:27:35 +11:00
2025-12-25 18:47:22 +11:00
2026-01-07 09:23:34 +11:00