Check both githubCopilotToken and githubCopilotAccessToken when
validating credentials. This allows the model to work when OAuth
succeeds but fetchCopilotToken fails, since getValidCopilotToken()
can still refresh using the access token.
- Add credentialVersion prop to ModelImporter for detecting key changes
- Clear cached models when credentialVersion changes (not just isReady)
- Pass API key/token as credentialVersion in ApiKeyDialog and GitHubCopilotAuth
- This ensures model list refreshes when rotating keys (non-empty to non-empty)
- Add GitHub Copilot as new LLM provider with OAuth device flow
- Implement GitHubCopilotProvider for token management and API calls
- Implement GitHubCopilotChatModel as LangChain BaseChatModel adapter
- Add GitHubCopilotAuth UI component for OAuth authentication
- Extract reusable ModelImporter component from ApiKeyDialog
Improvements:
- Use authGeneration counter to prevent race conditions on reset
- Add token validation and expires_at type handling (s/ms/string)
- Add MAX_REFRESH_ATTEMPTS to prevent infinite refresh loops
- Add try/catch/finally for robust error handling in ModelImporter
- Clean up AbortController lifecycle in polling operations
- Add ContextCompactor class for map-reduce style context summarization
- Implement auto-compact when context exceeds configurable threshold
- Track note paths for tags/folders in L3 segment metadata for L2 deduplication
- Add loadAndAddChatHistory for streamlined chat history loading
- Store compacted paths in envelope metadata for multi-turn deduplication
- Fix: Only track L3 context paths in compactedPaths (excludes L5 user message files)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: Add comprehensive system prompt management system.
* fix:fixed some bugs
* fix: prevent false negatives in migration content verification
Strip leading newlines before comparing saved vs original content.
Obsidian may insert extra blank line after frontmatter block,
causing stripFrontmatter to leave a leading newline and fail verification.
* feat: add file processing status display in context manage modal.
* fix: preserve think block collapse state across streaming -> history transition.
# Conflicts:
# src/components/chat-components/ChatSingleMessage.tsx
* fix: improve tool call root and think block state handling during streaming transitions
- Add container reference to ToolCallRootRecord for detecting container changes
- Handle container mismatch when streaming component unmounts and history mounts
- Use container.isConnected for stale cleanup instead of timestamp-only approach
- Prevent double toggle on think blocks by handling state in pointerdown
* fix: prevent current project file status from falling through to cached check
For the current project, if a file is not in processing/failed/success
real-time state, it should show "Not started" instead of incorrectly
showing "Processed" based on cached fileContexts entries.
* Refactor model API key handling and improve model filtering.
# Conflicts:
# src/settings/v2/components/ModelAddDialog.tsx
# Conflicts:
# src/components/ui/ModelSelector.tsx
# src/settings/v2/components/ApiKeyDialog.tsx
# Conflicts:
# src/settings/v2/components/ApiKeyDialog.tsx
# src/settings/v2/components/ModelAddDialog.tsx
# src/settings/v2/components/ModelEditDialog.tsx
* Fix local models being filtered out due to API key checks
* Fix circular dependency in modelUtils causing test failures
Changed REQUIRED_MODELS from a top-level constant to a getter function to avoid circular dependency issues during module initialization. This fixes test failures where ChatModels enum was accessed before being fully initialized.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add recent usage sorting for chat history and project list.
# Conflicts:
# src/main.ts
* fix: use in-memory recency for chat history modal sorting.
* refactor: move sort strategy selectors to AdvancedSettings.
* feat: Add Web Viewer bridge for referencing open web tabs in chat.
* refactor: Simplify markdown image extraction parser。
* fix: Prevent web selection from auto-reappearing after removal or new chat.
* fix: Suppress active web tab when web selection exists.
* feat: Add YouTube transcript extraction for Web Viewer tabs.
* feat: Built-in slash prompts for web clippers.
* feat: Improve web selection tracking and simplify context settings
- Merge context settings: combine note/web active content and selection settings
- Add auto-clear for web selection badge when deselected on page
- Make note and web selections mutually exclusive
- Show website favicon in web selection badge
- Add migration logic and tests for settings
* Replace FlexSearch with MiniSearch for improved search functionality and scoring
* Enhance QueryExpander and README for improved recall and ranking clarity
- Update QueryExpander to clearly separate salient and expanded terms for recall and ranking.
- Modify README to reflect changes in the search system's architecture and clarify the distinction between recall and ranking processes.
- Adjust FullTextEngine comments to emphasize BM25's native multi-term scoring capabilities.
* Implement weighted query expansion in FullTextEngine with 90/10 scoring for salient and expanded terms
Added <path> tag to variable_note XML format for {activeNote} and other variable types. Reordered format so path comes before title heading to match note_context structure. Updated all test expectations to reflect the new format.
This change ensures the LLM receives file path information when processing variable notes, enabling better context understanding and file reference capabilities. The consistent format with note_context also improves maintainability.
* Deprecate IntentAnalyzer and replace with model-based tool planning in CopilotPlusChainRunner
* Refine planning prompt to enforce XML-only responses and remove note extraction logic
- Added an optional `confirmation` parameter to the `writeToFile` tool, allowing users to skip the preview UI and apply changes directly to the file.
- Updated the tool's schema to include the new parameter, with a default value of true for confirmation.
- Enhanced the handler logic to manage file writing based on the user's confirmation choice, improving flexibility in file operations.
Improves AWS Bedrock support by adding user guidance for cross-region
inference profiles, addressing issue #2006.
Changes:
- ModelAddDialog: Add helper text and example for Bedrock inference profiles
- ModelEditDialog: Update region field description with shorter text
- CLAUDE.md: Add AWS Bedrock usage documentation with examples
Users are now guided to use cross-region inference profile IDs
(global., us., eu., apac. prefixes) instead of regional model IDs,
which significantly improves reliability and availability.
Fixes: logancyang/obsidian-copilot#2006🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* refactor: Simplify local search guidance handling in AutonomousAgentChainRunner and CopilotPlusChainRunner
- Removed the `appendInlineCitationReminder` function and adjusted the logic in `AutonomousAgentChainRunner` to directly manage local search guidance.
- Updated `CopilotPlusChainRunner` to retain and utilize the most recent local search guidance, ensuring it is positioned correctly adjacent to user queries.
- Modified `buildLocalSearchInnerContent` to accept introductory text instead of guidance, enhancing clarity in the payload structure.
- Removed related tests for the deprecated `appendInlineCitationReminder` function, streamlining the codebase.
* refactor: Enhance localSearch payload structure and guidance handling
- Made localSearch payload self-contained by embedding RAG instructions, documents, and citation guidance directly within the `<localSearch>` block.
- Updated AutonomousAgentChainRunner and CopilotPlusChainRunner to ensure each localSearch call carries its own guidance block, improving citation accuracy in multi-search scenarios.
- Introduced a new utility function to insert guidance before the user query label, ensuring clarity in the payload structure.
- Adjusted related tests to validate the new guidance handling logic.
* docs: Add deprecation guide for IntentAnalyzer and Broca
- Created a comprehensive document outlining the responsibilities of the `IntentAnalyzer` and Broca API within the Copilot Plus intent analysis flow.
- Detailed the current functionalities, known consumers, migration constraints, and a phased migration plan to ensure feature parity and smooth transition.
- Highlighted risks and mitigation strategies associated with the deprecation process, along with open questions for further consideration.
* fix: Prevent infinite rolling animation in ToolCallBanner when result is present
Add defensive check that stops animation when tool result exists, even if isExecuting flag wasn't updated. This fixes race conditions where marker updates fail or are delayed during streaming.
🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
- Introduced `escapeTasksCodeBlocks` to convert ```tasks to ```text, preventing execution in AI responses and ensuring static display of task queries.
- Updated processing logic to utilize the new function, enhancing content safety and display consistency.
* Update bug report template to enhance clarity and requirements
- Changed the required checklist item from a screenshot to a log file generated via the "Copilot: Create Log File" command.
- Made the screenshot of the note and Copilot chat pane optional.
- Clarified the statement regarding bug report requirements for better understanding.
* feat: Implement embedded note processing in ContextProcessor
- Added support for processing embedded notes within markdown content, allowing for structured `<embedded_note>` blocks.
- Introduced new methods for building and formatting embedded note blocks, including error handling for missing notes.
- Enhanced logging to replace console statements with appropriate logging functions for better error tracking.
- Updated the `buildMarkdownContextContent` method to streamline content processing for markdown files.
- Added a new constant `EMBEDDED_NOTE_TAG` to manage embedded note structures.
- Introduced a new utility function `escapeYamlString` to handle escaping of special characters in modelKey values, ensuring valid YAML formatting.
- Updated the `modelKey` assignment in the generated note content to use the new escaping function.
- Added comprehensive tests to verify correct escaping for various special characters, including quotes, backslashes, and pipes, ensuring data integrity during save-load operations.
* feat: Implement model validation and resolution for temperature overrides in ChatModelManager
- Added a new private method `isModelConfigValid` to validate model configurations against API key and entitlement requirements.
- Introduced `resolveModelForTemperatureOverride` to determine the active chat model, ensuring fallback to valid models while respecting user entitlements.
- Updated `getChatModelWithTemperature` to utilize the new model resolution logic for temperature overrides.
- Enhanced error handling for cases where no valid model is found.
* refactor: Remove deprecated chat models from BUILTIN_CHAT_MODELS constant
* feat: Add GROK_4_FAST model to BUILTIN_CHAT_MODELS constant
- Introduced a new chat model, GROK_4_FAST, with capabilities for vision and enabled status, enhancing the available options for users.
* Make inline citation permanent and add image guide for local search
- Removed the `enableInlineCitations` setting from the configuration and related components to simplify citation management.
- Updated citation functions to operate without the setting, ensuring consistent behavior across the codebase.
- Adjusted tests and documentation to reflect the removal of inline citation handling logic.
- Enhanced the `renderCiCMessage` and `processInlineCitations` functions for improved clarity and functionality.
* fix: Update web search tool description for clarity
- Revised the description of the `webSearch` tool to specify that it searches the internet for information only when explicitly requested by the user.
- Enhanced the instructions for using the `webSearch` tool to clarify when it should be utilized, ensuring users understand the intent required for web searches.
- Reintroduced the `createGetTagListTool` import to maintain functionality in the `builtinTools` module.
* fix: Enhance response handling in AgentPrompt integration tests
- Updated the response processing logic in the AgentPrompt integration tests to ensure that `fullResponse` is always a string, accommodating multimodal and array content.
- Implemented a function to extract text parts from arrays and handle various content types, improving the robustness of the tests.
* Remove websearch related prompt from modelAdapter
* fix: Update time query instructions in builtinTools
- Added detailed instructions for handling time queries, including the conversion of city or timezone names to UTC offsets.
- Clarified when to use the timezoneOffset parameter and emphasized the need for user clarification if the offset cannot be determined.
- Introduced a small delay using setTimeout to ensure the React component is fully ready to receive focus events when the chat window is opened. This change addresses potential timing issues with the focus event handling.