All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Model Selector: Implemented a dropdown menu in the UI, allowing users to choose between
gemini-2.5-proandgemini-2.5-flashmodels for their conversation. - Selectable Chat Text: All chat messages, including the welcome screen, are now selectable, making it easy to copy code snippets and responses.
- Enhanced Welcome Message: The initial welcome screen now includes a more detailed message with a privacy notice and clearer getting-started instructions.
- Project Structure Refactoring: Reorganized the project's file structure to improve clarity and maintainability.
- The legacy
ask_srcdirectory has been removed. - All backend modules (
services.py,chat_utils.py) have been consolidated into a new, cleanersrcdirectory. - The main application entry point was renamed from
flet_ask.pytoask.py, simplifying the project's root. - All internal imports were updated to reflect the new file paths.
- The legacy
- UI Responsiveness: Resolved an issue where the UI would freeze for a moment when a message was sent. The application now yields to the UI thread to render the user's message before making the blocking API call.
- Complete Frontend and Architectural Rewrite: The entire application frontend has been migrated from PyQt5 to Flet. This is a ground-up rewrite aimed at modernizing the codebase, improving maintainability, and enabling simple cross-platform builds.
- Modernized Concurrency Model: Replaced the previous multi-threaded worker architecture (
ChatWorker,TokenCountWorker, etc.) and PyQt's signal/slot system with a nativeasyncioimplementation. This simplifies the code, eliminates complex threading logic, and improves efficiency.- Blocking operations (like API calls and file I/O) are now handled non-blockingly using
asyncio.to_thread. - Real-time features like the token counter's debouncing are now elegantly handled with
asyncio.sleep, removing the need forQTimer.
- Blocking operations (like API calls and file I/O) are now handled non-blockingly using
- New Code Architecture: Introduced a clean, three-tier architecture to separate concerns:
- State Management (
AppState): A central class holds all application state, making data flow predictable. - Service Layer (
app_services.py): All backend logic (API calls, file operations, context management) is encapsulated in asynchronous services (ChatService,ContextService, etc.). - UI Components: The UI is broken down into logical Flet components (
ChatView,InputBar) for better organization and reusability.
- State Management (
- UI Rendering: Replaced
QWebEngineViewwith Flet's nativeft.Markdowncontrol for robust, built-in rendering of chat messages and code blocks.
- PyQt5 and PyQtWebEngine Dependencies: Removed all PyQt-related libraries from
requirements.txt, significantly reducing the project's dependency footprint. - Obsolete UI and Worker Code: Deleted the legacy PyQt UI file (
ask_src/ui.py), the original entry point (ask.py), and the PyQt-specific worker patterns. The new application entry point is the refactoredflet_ask.py.
- Syntax Highlighting Engine: Replaced the server-side
Pygmentslibrary with the client-sidehighlight.jslibrary for rendering syntax-highlighted code blocks. This change leveragesQWebEngineViewto delegate highlighting to JavaScript, resulting in significantly more robust and accurate code formatting in the chat display. - UI Rendering Logic: Refactored
ask_src/ui.pyandask_src/worker.pyto remove thecodehiliteMarkdown extension and instead loadhighlight.jsassets and trigger the highlighting script within theQWebEngineView.
PygmentsDependency: RemovedPygmentsfromrequirements.txtand deleted the obsoletepygments_default.cssfile, simplifying the project's dependencies.
- "Reload Context" Button: Introduced a "Reload Context" button in the UI. This allows users to re-scan the project's codebase on demand, updating the AI's knowledge with the latest file changes without losing the current conversation history.
ContextReloadWorker: Implemented a new background worker inask_src/worker.pyto handle the context reloading process asynchronously. This ensures the UI remains responsive while a new chat session is prepared with the updated context and existing conversation history.- Welcome Screen: Added an initial welcome message that is displayed on application startup. It provides guidance and example prompts for new users and is replaced by the conversation once the first message is sent.
- Chat Rendering Engine: Replaced the
QTextBrowserwidget withQWebEngineViewfor displaying chat messages. This change significantly improves the rendering quality and accuracy of Markdown and syntax-highlighted code blocks by leveraging a full web engine. - UI Logic: Refactored
ask_src/ui.pyto supportQWebEngineView, which involved embedding styled content within a full HTML structure and handling UI interactions like scrolling via JavaScript.
- Conversation Summarization: Implemented an intelligent system to automatically summarize conversations using the LLM. This provides long-term memory while significantly reducing the token count sent to the model, making context management more efficient and cost-effective.
SummaryWorker: Introduced a new background thread inask_src/worker.pyto handle conversation summarization asynchronously. This ensures the UI remains responsive while summaries are being generated after a conversation is saved.- Startup Summarization: Added logic to
ask.pythat automatically detects and summarizes any previously unsummarized conversation files when the application starts. This ensures all history is processed into efficient summaries before the chat session begins. .gitignoreIntegration: Theget_codebasefunction now respects.gitignorerules by using thegit check-ignorecommand, leading to a more accurate and relevant codebase context.reconstruct_markdown_history: A new helper function inchat_utils.pyto convert saved conversation data back into a full markdown string, which is necessary for the summarization process.
- Context Management: The system prompt (
create_system_prompt) now loads concise conversation summaries instead of full conversation histories, optimizing token usage and improving performance. - Application Startup Flow: Refactored
ask.pyto configure the API client once at startup and pass it to all necessary components. The startup sequence now completes all pending summarization tasks before launching the main UI. - Conversation Saving: The
save_conversation_mdmethod inui.pynow triggers theSummaryWorkerto create a summary file after successfully saving the full conversation markdown.
- Conversation Counter: Corrected an issue where the conversation counter could be miscalculated. It now accurately determines the next conversation number by checking for both
conversation_N.mdandconversation_N_summary.mdfiles. - Path Exclusion: Improved the logic for excluding the conversation directory from codebase analysis, making it more robust, especially when custom conversation paths are used.
- Refined
README.mdfor greater conciseness and accuracy, updating information on features and getting started. - Updated the referenced LLM model name (
gemini-2.5-flash-preview-04-17) and its context window size (up to 1M tokens) inREADME.mdto reflect the model used inchat_utils.py. - Updated main prompt for better context and clarity.
- Resolved an issue when the conversation were not saved properly after the LLM complete the output.
- Command-line option
--conversation-path(or-c) toask.pyfor specifying a custom directory for conversation history, providing users with control over conversation storage location. .gitignorehandling for conversation folder: Implemented logic to ensure conversation loading works correctly even when the conversation folder (default or custom) is ignored by Git, preserving conversation history while respecting.gitignorefor codebase analysis.- Diff Detection in AI Responses: Implemented logic in
diff_detector.pyto automatically detect code diff blocks within the AI's responses, identifying potential code modifications suggested by the AI. - File Path Extraction from Diff Blocks: Enhanced diff detection to extract file paths from the headers of detected diff blocks, enabling identification of target files for code changes.
- File Path Validation: Implemented validation logic to check if extracted file paths from diff blocks correspond to existing files within the analyzed project, preventing application of diffs to invalid or non-existent files.
- Unit Tests for Diff Detection: Added comprehensive unit tests in
tests/test_diff_detector.pyfor thedetect_diff_blocksfunction, ensuring the robustness and correctness of diff detection and file path extraction logic. - Test for Conversation Folder Handling: Added integration tests in
tests/test_conversation_folder.pyto verify correct conversation folder handling, including.gitignorescenarios and custom conversation paths.
- Refactored
detect_diff_blocksfunction indiff_detector.pyto return a list of dictionaries, each containing diff block content and extracted file path, improving the structure of diff block information. - Updated
ChatWorkerinworker.pyto utilize the newdetect_diff_blocksfunction for processing AI responses and logging detected diff blocks with file path information to the console. - Modified
ask.pyandui.pyto accept and pass theconversation_pathcommand-line argument, enabling users to specify custom conversation folders. - Updated
ROADMAP.mdto reflect the implemented features and highlight next priorities, providing an up-to-date project development plan.
- Implemented background token counting using
TokenCountWorkerto prevent UI freezes during text input, ensuring a smoother user experience. - Added
TokenCountSignalsfor signal-based communication between theTokenCountWorkerthread and theMainWindowUI thread, enabling thread-safe updates of the token count display. - Introduced a visual "Tokens: [count]" label in the UI, positioned above the input text area, to display real-time token counts to the user.
- Implemented debouncing for token count updates using
QTimer, reducing the frequency of token counting calculations and further improving UI responsiveness, especially during rapid typing. - Added a
ROADMAP.mdfile to the project root, outlining the project's short-term, medium-term, and long-term development vision and planned features. - Included an MIT License to the project, adding a
LICENSEfile in the root directory and a "License" section toREADME.md, clarifying the open-source licensing terms. - Added a comparison table with GitHub Copilot to
README.md, highlighting the key differentiators and complementary nature of InsightCoder. - Added a "Beyond Code: Analyzing Any Git Repository" section to
README.md, emphasizing that InsightCoder can analyze any Git repository, including documentation, books, and other non-code projects.
- Refactored token counting logic: Moved the token counting functionality from the
update_token_count_displaymethod inMainWindow(ui.py) into the dedicatedTokenCountWorkerclass (token_worker.py), promoting code modularity and separation of concerns. - Updated
ui.pyto utilizeTokenCountWorkerfor asynchronous token counting, ensuring non-blocking UI operations. - Modified
ui.pyto include new methodsstart_token_count_timerandset_token_count_labelfor managing the debounced token counting and updating the UI label via signals and slots. - Improved UI responsiveness and smoothness during text input and token count updates by offloading the potentially time-consuming token counting process to a background thread, preventing UI freezes.
- Streamlined the "Contributing" section in
README.mdto be more concise and focused on bug reports, aligning with the project's current self-development stage.
- Resolved UI freezing issue that occurred during text input due to synchronous token counting in the main UI thread, significantly enhancing the user experience.
- Command-line argument
--project-path(or-p) toask.pyfor specifying the project directory to analyze. - Documentation in
README.mdon how to use the--project-pathargument.
- Window title dynamically updates to display the name of the project directory being analyzed (e.g., "[Project Name] Codebase Chat").
- System prompt for the LLM is now more generic, focusing on codebase analysis rather than being specific to "InsightCoder" project identity.
MainWindowinui.pynow acceptsproject_pathas an argument for cleaner code and dynamic title setting.- Updated
ask.pyandchat_utils.pyto handle and pass theproject_pathargument correctly.
- Addressed the issue of the project analyzing only its own codebase by implementing
--project-pathfunctionality. - Resolved the confusion of "InsightCoder" project identity when analyzing external codebases by making the system prompt and window title more context-aware.
This is the initial release of InsightCoder as a standalone open-source project, extracted from the Anagnorisis project.
- Initial codebase for InsightCoder, providing AI-powered codebase analysis.
- Interactive chat interface using PyQt5.
- Integration with Google Gemini API for natural language code queries.
- Markdown formatted output with syntax highlighting in responses.
requirements.txtfile for easy installation of dependencies.- Basic
README.mddocumentation to get users started. - Saving conversation history to
.mdfiles.
- Project renamed from internal tool to InsightCoder for open-source release.
- System prompt and UI updated to reflect the standalone InsightCoder identity.
- Conversation files are now saved in the
project_info/conversationsdirectory.
- Grooveshark related notes from
README.md. - Anagnorisis specific branding and references throughout the codebase.