fix: update all model versions to Claude 4.5 and connect insights to frontend settings (#1082)

* Version 2.7.4 (#1040)

* ci: add Azure auth test workflow

* fix(worktree): handle "already up to date" case correctly (ACS-226) (#961)

* fix(worktree): handle "already up to date" case correctly (ACS-226)

When git merge returns non-zero for "Already up to date", the merge
code incorrectly treated this as a conflict and aborted. Now checks
git output to distinguish between:
- "Already up to date" - treat as success (nothing to merge)
- Actual conflicts - abort as before
- Other errors - show actual error message

Also added comprehensive tests for edge cases:
- Already up to date with no_commit=True
- Already up to date with delete_after=True
- Actual merge conflict detection
- Merge conflict with no_commit=True

* test: strengthen merge conflict abort verification

Improve assertions in conflict detection tests to explicitly verify:
- MERGE_HEAD does not exist after merge abort
- git status returns clean (no staged/unstaged changes)

This is more robust than just checking for absence of "CONFLICT"
string, as git status --porcelain uses status codes, not literal words.

* test: add git command success assertions and branch deletion verification

- Add explicit returncode assertions for all subprocess.run git add/commit calls
- Add branch deletion verification in test_merge_worktree_already_up_to_date_with_delete_after
- Ensures tests fail early if git commands fail rather than continuing silently

---------

Co-authored-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* fix(terminal): add collision detection for terminal drag and drop reordering (#985)

* fix(terminal): add collision detection for terminal drag and drop reordering

Add closestCenter collision detection to DndContext to fix terminal
drag and drop swapping not detecting valid drop targets. The default
rectIntersection algorithm required too much overlap for grid layouts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): handle file drops when closestCenter returns sortable ID

Address PR review feedback:
- Fix file drop handling to work when closestCenter collision detection
  returns the sortable ID instead of the droppable ID
- Add terminals to useCallback dependency array to prevent stale state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ACS-181): enable auto-switch on 401 auth errors & OAuth-only profiles (#900)

* fix(ACS-181): enable auto-switch for OAuth-only profiles

Add OAuth token check at the start of isProfileAuthenticated() so that
profiles with only an oauthToken (no configDir) are recognized as
authenticated. This allows the profile scorer to consider OAuth-only
profiles as valid alternatives for proactive auto-switching.

Previously, isProfileAuthenticated() immediately returned false if
configDir was missing, causing OAuth-only profiles to receive a -500
penalty in the scorer and never be selected for auto-switch.

Fixes: ACS-181

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Black Circle Sentinel <mludlow000@icloud.com>

* fix(ACS-181): detect 'out of extra usage' rate limit messages

The previous patterns only matched "Limit reached · resets ..." but
Claude Code also shows "You're out of extra usage · resets ..." which
wasn't being detected. This prevented auto-switch from triggering.

Added new patterns to both output-parser.ts (terminal) and
rate-limit-detector.ts (agent processes) to detect:
- "out of extra usage · resets ..."
- "You're out of extra usage · resets ..."

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ACS-181): add real-time rate limit detection and debug logging

- Add real-time rate limit detection in agent-process.ts processLog()
  so rate limits are detected immediately as output appears, not just
  when the process exits
- Add clear warning message when auto-switch is disabled in settings
- Add debug logging to profile-scorer.ts to trace profile evaluation
- Add debug logging to rate-limit-detector.ts to trace pattern matching

This enables immediate detection and auto-switch when rate limits occur
during task execution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): enable auto-switch on 401 auth errors

- Propagate 401/403 errors from fetchUsageViaAPI to checkUsageAndSwap in UsageMonitor to trigger proactive profile swapping.
- Fix usage monitor race condition by ensuring it waits for ClaudeProfileManager initialization.
- Fix isProfileAuthenticated to correctly validate OAuth-only profiles.

* fix(ACS-181): address PR review feedback

- Revert unrelated files (rate-limit-detector, output-parser, agent-process) to upstream state
- Gate profile-scorer logging behind DEBUG flag
- Fix usage-monitor type safety and correct catch block syntax
- Fix misleading indentation in index.ts app updater block

* fix(frontend): enforce eslint compliance for logs in profile-scorer

- Replace all console.log with console.warn (per linter rules)
- Strictly gate all debug logs behind isDebug check to prevent production noise

* fix(ACS-181): add swap loop protection for auth failures

- Add authFailedProfiles Map to track profiles with recent auth failures
- Implement 5-minute cooldown before retrying failed profiles
- Exclude failed profiles from swap candidates to prevent infinite loops
- Gate TRACE logs behind DEBUG flag to reduce production noise
- Change console.log to console.warn for ESLint compliance

---------

Signed-off-by: Black Circle Sentinel <mludlow000@icloud.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat(frontend): add Claude Code version rollback feature (#983)

* feat(frontend): add Claude Code version rollback feature

Add ability for users to switch to any of the last 20 Claude Code CLI versions
directly from the Claude Code popup in the sidebar.

Changes:
- Add IPC channels for fetching available versions and installing specific version
- Add backend handlers to fetch versions from npm registry (with 1-hour cache)
- Add version selector dropdown in ClaudeCodeStatusBadge component
- Add warning dialog before switching versions (warns about closing sessions)
- Add i18n support for English and French translations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address PR review feedback for Claude Code version rollback

- Add validation after semver filtering to handle empty version list
- Add error state and UI feedback for installation/version switch failures
- Extract magic number 5000ms to VERSION_RECHECK_DELAY_MS constant
- Bind Select value prop to selectedVersion state
- Normalize version comparison to handle 'v' prefix consistently
- Use normalized version comparison in SelectItem disabled check

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(security): inherit security profiles in worktrees and validate shell -c commands (#971)

* fix(security): inherit security profiles in worktrees and validate shell -c commands

- Add inherited_from field to SecurityProfile to mark profiles copied from parent projects
- Skip hash-based re-analysis for inherited profiles (fixes worktrees losing npm/npx etc.)
- Add shell_validators.py to validate commands inside bash/sh/zsh -c strings
- Register shell validators to close security bypass via bash -c "arbitrary_command"
- Add 13 new tests for inherited profiles and shell -c validation

Fixes worktree security config not being inherited, which caused agents to be
blocked from running npm/npx commands in isolated workspaces.

* docs: update README download links to v2.7.3 (#976)

- Update all stable download links from 2.7.2 to 2.7.3
- Add Flatpak download link (new in 2.7.3)

* fix(security): close shell -c bypass vectors and validate inherited profiles

- Fix combined shell flags bypass (-xc, -ec, -ic) in _extract_c_argument()
  Shell allows combining flags like `bash -xc 'cmd'` which bypassed -c detection
- Add recursive validation for nested shell invocations
  Prevents bypass via `bash -c "bash -c 'evil_cmd'"`
- Validate inherited_from path in should_reanalyze() with defense-in-depth
  - Must exist and be a directory
  - Must be an ancestor of current project
  - Must contain valid security profile
- Add comprehensive test coverage for all security fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: fix import ordering in test_security.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: format shell_validators.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat(frontend): add searchable branch combobox to worktree creation dialog (#979)

* feat(frontend): add searchable branch combobox to worktree creation dialog

- Replace limited Select dropdown with searchable Combobox for branch selection
- Add new Combobox UI component with search filtering and scroll support
- Remove 15-branch limit - now shows all branches with search
- Improve worktree name validation to allow dots and underscores
- Better sanitization: spaces become hyphens, preserve valid characters
- Add i18n keys for branch search UI in English and French

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): address PR review feedback for worktree dialog

- Extract sanitizeWorktreeName utility function to avoid duplication
- Replace invalid chars with hyphens instead of removing them (feat/new → feat-new)
- Trim trailing hyphens and dots from sanitized names
- Add validation to forbid '..' in names (invalid for Git branch names)
- Refactor branchOptions to use map/spread instead of forEach/push
- Add ARIA accessibility: listboxId, aria-controls, role="listbox"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): align worktree name validation with backend regex

- Fix frontend validation to match backend WORKTREE_NAME_REGEX (no dots,
  must end with alphanumeric)
- Update sanitizeWorktreeName to exclude dots from allowed characters
- Update i18n messages (en/fr) to remove mention of dots
- Add displayName to Combobox component for React DevTools
- Export Combobox from UI component index.ts
- Add aria-label to Combobox listbox for accessibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): address PR review accessibility and cleanup issues

- Add forwardRef pattern to Combobox for consistency with other UI components
- Add keyboard navigation (ArrowUp/Down, Enter, Escape, Home, End)
- Add aria-activedescendant for screen reader focus tracking
- Add unique option IDs for ARIA compliance
- Add cleanup for async branch fetching to prevent state updates on unmounted component

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): sync worktree config to renderer on terminal restoration (#982)

* fix(frontend): sync worktree config to renderer on terminal restoration

When terminals are restored after app restart, the worktree config
was not being synced to the renderer, causing the worktree label
to not appear. This adds a new IPC channel to send worktree config
during restoration and a listener in useTerminalEvents to update
the terminal store.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(frontend): always sync worktreeConfig to handle deleted worktrees

Addresses PR review feedback: send worktreeConfig IPC message
unconditionally so the renderer can clear stale worktree labels
when a worktree is deleted while the app is closed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(merge): include files with content changes even when semantic analysis is empty (#986)

* fix(merge): include files with content changes even when semantic analysis is empty

The merge system was discarding files that had real code changes but no
detected semantic changes. This happened because:

1. The semantic analyzer only detects imports and function additions/removals
2. Files with only function body modifications returned semantic_changes=[]
3. The filter used Python truthiness (empty list = False), excluding these files
4. This caused merges to fail with "0 files to merge" despite real changes

The fix uses content hash comparison as a fallback check. If the file content
actually changed (hash_before != hash_after), include it for merge regardless
of whether the semantic analyzer could parse the specific change types.

This fixes merging for:
- Files with function body modifications (most common case)
- Unsupported file types (Rust, Go, etc.) where semantic analysis returns empty
- Any file where the analyzer fails to detect the specific change pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(merge): add TaskSnapshot.has_modifications property and handle DIRECT_COPY

Address PR review feedback:

1. DRY improvement: Add `has_modifications` property to TaskSnapshot
   - Centralizes the modification detection logic
   - Checks semantic_changes first, falls back to content hash comparison
   - Handles both complete tasks and in-progress tasks safely

2. Fix for files with empty semantic_changes (Cursor issue #2):
   - Add DIRECT_COPY MergeDecision for files that were modified but
     couldn't be semantically analyzed (body changes, unsupported languages)
   - MergePipeline returns DIRECT_COPY when has_modifications=True but
     semantic_changes=[] (single task case)
   - Orchestrator handles DIRECT_COPY by reading file directly from worktree
   - This prevents silent data loss where apply_single_task_changes would
     return baseline content unchanged

3. Update _update_stats to count DIRECT_COPY as auto-merged

The combination ensures:
- Files ARE detected for merge (has_modifications check)
- Files ARE properly merged (DIRECT_COPY reads from worktree)
- No silent data loss (worktree content used instead of baseline)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(merge): handle DIRECT_COPY in merge_tasks() and log missing files

- Add DIRECT_COPY handling to merge_tasks() for multi-task merges
  (was only handled in merge_task() for single-task merges)
- Add warning logging when worktree file doesn't exist during DIRECT_COPY
  in both merge_task() and merge_tasks()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(merge): remove unnecessary f-string prefixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(merge): properly fail DIRECT_COPY when worktree file missing

- Extract _read_worktree_file_for_direct_copy() helper to DRY up logic
- Set decision to FAILED when worktree file not found (was silent success)
- Add warning when worktree_path is None in merge_tasks
- Use `is not None` check for merged_content to allow empty files
- Fix has_modifications for new files with empty hash_before
- Add debug_error() to merge_tasks exception handling for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style(merge): fix ruff formatting for long line

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): detect Claude exit and reset label when user closes Claude (#990)

* fix(terminal): detect Claude exit and reset label when user closes Claude

Previously, the "Claude" label on terminals would persist even after the
user closed Claude (via /exit, Ctrl+D, etc.) because the system only
reset isClaudeMode when the entire terminal process exited.

This change adds robust Claude exit detection by:
- Adding shell prompt patterns to detect when Claude exits and returns
  to shell (output-parser.ts)
- Adding new IPC channel TERMINAL_CLAUDE_EXIT for exit notifications
- Adding handleClaudeExit() to reset terminal state in main process
- Adding onClaudeExit callback in terminal event handler
- Adding onTerminalClaudeExit listener in preload API
- Handling exit event in renderer to update terminal store

Now when a user closes Claude within a terminal, the label is removed
immediately while the terminal continues running.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): add line-start anchors to exit detection regex patterns

Address PR review findings:
- Add ^ anchors to CLAUDE_EXIT_PATTERNS to prevent false positive exit
  detection when Claude outputs paths, array access, or Unicode arrows
- Add comprehensive unit tests for detectClaudeExit and related functions
- Remove duplicate debugLog call in handleClaudeExit (keep console.warn)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): prevent false exit detection for emails and race condition

- Update user@host regex to require path indicator after colon,
  preventing emails like user@example.com: from triggering exit detection
- Add test cases for emails at line start to ensure they don't match
- Add guard in onTerminalClaudeExit to prevent setting status to 'running'
  if terminal has already exited (fixes potential race condition)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(app-update): persist downloaded update state for Install button visibility (#992)

* fix(app-update): persist downloaded update state for Install button visibility

When updates auto-download in background, users miss the update-downloaded
event if not on Settings page. This causes "Install and Restart" button
to never appear.

Changes:
- Add downloadedUpdateInfo state in app-updater.ts to persist downloaded info
- Add APP_UPDATE_GET_DOWNLOADED IPC handler to query downloaded state
- Add getDownloadedAppUpdate API method in preload
- Update AdvancedSettings to check for already-downloaded updates on mount

Now when user opens Settings after background download, the component
queries persisted state and shows "Install and Restart" correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(app-update): resolve race condition and type safety issues

- Fix race condition where checkForAppUpdates() could overwrite downloaded
  update info with null, causing 'Unknown' version display
- Add proper type guard for releaseNotes (can be string | array | null)
  instead of unsafe type assertion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(app-update): clear downloaded update state on channel change and add useEffect cleanup

- Clear downloadedUpdateInfo when update channel changes to prevent showing
  Install button for updates from a different channel (e.g., beta update
  showing after switching to stable channel)
- Add isCancelled flag to useEffect async operations in AdvancedSettings
  to prevent React state updates on unmounted components

Addresses CodeRabbit review findings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(backend): add Sentry integration and fix broken pipe errors (#991)

* fix(backend): add Sentry integration and fix broken pipe errors

- Add sentry-sdk to Python backend for error tracking
- Create safe_print() utility to handle BrokenPipeError gracefully
- Initialize Sentry in CLI, GitHub runner, and spec runner entry points
- Use same SENTRY_DSN environment variable as Electron frontend
- Apply privacy path masking (usernames removed from stack traces)

Fixes "Review Failed: [Errno 32] Broken pipe" error in PR review

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(backend): address PR review findings for Sentry integration

- Fix ruff linting errors (unused imports, import sorting)
- Add path masking to set_context() and set_tag() for privacy
- Add defensive path masking to capture_exception() kwargs
- Add debug logging for bare except clauses in sentry.py
- Add top-level error handler in cli/main.py with Sentry capture
- Add error handling with Sentry capture in spec_runner.py
- Move safe_print to core/io_utils.py for broader reuse
- Migrate GitLab runner files to use safe_print()
- Add fallback import pattern in sdk_utils.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: apply ruff formatting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(backend): address CodeRabbit review findings for Sentry and io_utils

- Add path masking to capture_message() kwargs for privacy consistency
- Add recursion depth limit (50) to _mask_object_paths() to prevent stack overflow
- Add WSL path masking support (/mnt/[a-z]/Users/...)
- Add consistent ImportError debug logging across Sentry wrapper functions
- Add ValueError handling in safe_print() for closed stdout scenarios
- Improve reset_pipe_state() documentation with usage warnings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: improve Claude CLI detection and add installation selector (#1004)

* fix: improve Claude CLI detection and add installation selector

This PR addresses the "Claude Code not found" error when starting tasks by
improving CLI path detection across all platforms.

Backend changes:
- Add cross-platform `find_claude_cli()` function in `client.py` that checks:
  - CLAUDE_CLI_PATH environment variable for user override
  - System PATH via shutil.which()
  - Homebrew paths on macOS
  - NVM paths for Node.js version manager installations
  - Platform-specific standard locations (Windows: AppData, Program Files; Unix: .local/bin)
- Pass detected `cli_path` to ClaudeAgentOptions in both `create_client()` and `create_simple_client()`
- Improve Windows .cmd/.bat file execution using proper cmd.exe flags (/d, /s, /c)
  and correct quoting for paths with spaces

Frontend changes:
- Add IPC handlers for scanning all Claude CLI installations and switching active path
- Update ClaudeCodeStatusBadge to show current CLI path and allow selection when
  multiple installations are detected
- Add `writeSettingsFile()` to settings-utils for persisting CLI path selection
- Add translation keys for new UI elements (English and French)

Closes #1001

* fix: address PR review findings for Claude CLI detection

Addresses all 8 findings from Auto Claude PR Review:

Security improvements:
- Add path sanitization (_is_secure_path) to backend CLI validation
  to prevent command injection via malicious paths
- Add isSecurePath validation in frontend IPC handler before CLI execution
- Normalize paths with path.resolve() before execution

Architecture improvements:
- Refactor scanClaudeInstallations to use getClaudeDetectionPaths() from
  cli-tool-manager.ts as single source of truth (addresses code duplication)
- Add cross-reference comments between backend _get_claude_detection_paths()
  and frontend getClaudeDetectionPaths() to keep them in sync

Bug fixes:
- Fix path display truncation to use regex /[/\\]/ for cross-platform
  compatibility (Windows uses backslashes)
- Add null check for version in UI rendering (shows "version unknown"
  instead of "vnull")
- Use DEFAULT_APP_SETTINGS merge pattern for settings persistence

Debugging improvements:
- Add error logging in validateClaudeCliAsync catch block for better
  debugging of CLI detection issues

Translation additions:
- Add "versionUnknown" key to English and French navigation.json

* ci(release): move VirusTotal scan to separate post-release workflow (#980)

* ci(release): move VirusTotal scan to separate post-release workflow

VirusTotal scans were blocking release creation, taking 5+ minutes per
file. This change moves the scan to a separate workflow that triggers
after the release is published, allowing releases to be available
immediately.

- Create virustotal-scan.yml workflow triggered on release:published
- Remove blocking VirusTotal step from release.yml
- Scan results are appended to release notes after completion
- Add manual trigger option for rescanning old releases

* fix(ci): address PR review issues in VirusTotal scan workflow

- Add error checking on gh release view to prevent wiping release notes
- Replace || true with proper error handling to distinguish "no assets" from real errors
- Use file-based approach for release notes to avoid shell expansion issues
- Use env var pattern consistently for secret handling
- Remove placeholder text before appending VT results
- Document 32MB threshold with named constant
- Add HTTP status code validation on all curl requests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add concurrency control and remove dead code in VirusTotal workflow

- Add concurrency group to prevent TOCTOU race condition when multiple
  workflow_dispatch runs target the same release tag
- Remove unused analysis_failed variable declaration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): improve error handling in VirusTotal workflow

- Fail workflow when download errors occur but scannable assets exist
- Add explicit timeout handling for analysis polling loop
- Use portable sed approach (works on both GNU and BSD sed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ui): display actual base branch name instead of hardcoded main (#969)

* fix(ui): display actual base branch name instead of hardcoded "main"

The merge conflict UI was showing "Main branch has X new commits"
regardless of the actual base branch. Now it correctly displays
the dynamic branch name (e.g., "develop branch has 40 new commits")
using the baseBranch value from gitConflicts.

* docs: update README download links to v2.7.3 (#976)

- Update all stable download links from 2.7.2 to 2.7.3
- Add Flatpak download link (new in 2.7.3)

* fix(i18n): add translation keys for branch divergence messages

- Add merge section to taskReview.json with pluralized translations
- Update WorkspaceStatus.tsx to use i18n for branch behind message
- Update MergePreviewSummary.tsx to use i18n for branch divergence text
- Add French translations for all new keys

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(i18n): add missing translation keys for branch behind details

- Add branchHasNewCommitsSinceBuild for build started message
- Add filesNeedAIMergeDueToRenames for path-mapped files
- Add fileRenamesDetected for rename detection message
- Add filesRenamedOrMoved for generic rename/move message
- Update WorkspaceStatus.tsx to use all new i18n keys

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(i18n): correct pluralization for rename count in AI merge message

The filesNeedAIMergeDueToRenames translation has two values that need
independent pluralization (fileCount and renameCount). Since i18next
only supports one count parameter, added separate translation keys
for singular/plural renames and select the correct key based on
renameCount value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(i18n): use translation keys for merge button labels with dynamic branch

Replace hardcoded 'Stage to Main' and 'Merge to Main' button labels with
i18n translation keys that interpolate the actual target branch name.
Also adds translations for loading states (Resolving, Staging, Merging).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(github-prs): prevent preloading of PRs currently under review (#1006)

- Updated logic to skip PRs that are currently being reviewed when determining which PRs need preloading.
- Enhanced condition to only fetch existing review data from disk if no review is in progress, ensuring that ongoing reviews are not overwritten by stale data.

* chore: bump version to 2.7.4

* hotfix/sentry-backend-build

* fix(github): resolve circular import issues in context_gatherer and services (#1026)

- Updated import statements in context_gatherer.py to import safe_print from core.io_utils to avoid circular dependencies with the services package.
- Introduced lazy imports in services/__init__.py to prevent circular import issues, detailing the import chain in comments for clarity.
- Added a lazy import handler to load classes on first access, improving module loading efficiency.

* feat(sentry): embed Sentry DSN at build time for packaged apps (#1025)

* feat(sentry): integrate Sentry configuration into Electron build

- Added build-time constants for Sentry DSN and sampling rates in electron.vite.config.ts.
- Enhanced environment variable handling in env-utils.ts to include Sentry settings for subprocesses.
- Implemented getSentryEnvForSubprocess function in sentry.ts to provide Sentry environment variables for Python backends.
- Updated Sentry-related functions to prioritize build-time constants over runtime environment variables for improved reliability.

This integration ensures that Sentry is properly configured for both local development and CI environments.

* fix(sentry): add typeof guards for build-time constants in tests

The __SENTRY_*__ constants are only defined when Vite's define plugin runs
during build. In test environments (vitest), these constants are undefined
and cause ReferenceError. Added typeof guards to safely handle both cases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Fix Duplicate Kanban Task Creation on Rapid Button Clicks (#1021)

* auto-claude: subtask-1-1 - Add convertingIdeas state and guard logic to useIdeation hook

* auto-claude: subtask-1-2 - Update IdeaDetailPanel to accept isConverting prop

* auto-claude: subtask-2-1 - Add idempotency check for linked_task_id in task-c

* auto-claude: subtask-3-1 - Manual testing: Verify rapid clicking creates only one task

- Fixed missing convertingIdeas prop connection in Ideation.tsx
- Added convertingIdeas to destructured hook values
- Added isConverting prop to IdeaDetailPanel component
- Created detailed manual-test-report.md with code review and E2E testing instructions
- All code implementation verified via TypeScript checks (no errors)
- Multi-layer protection confirmed: UI disabled, guard check, backend idempotency
- Manual E2E testing required for final verification

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address PR review findings for duplicate task prevention

- Fix TOCTOU race condition by moving idempotency check inside lock
- Fix React state closure by using ref for synchronous tracking
- Add i18n translations for ideation UI (EN + FR)
- Add error handling with toast notifications for conversion failures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(terminal): add YOLO mode to invoke Claude with --dangerously-skip-permissions (#1016)

* feat(terminal): add YOLO mode to invoke Claude with --dangerously-skip-permissions

Add a toggle in Developer Tools settings that enables "YOLO Mode" which
starts Claude with the --dangerously-skip-permissions flag, bypassing
all safety prompts.

Changes:
- Add dangerouslySkipPermissions setting to AppSettings interface
- Add translation keys for YOLO mode (en/fr)
- Modify claude-integration-handler to accept and append extra flags
- Update terminal-manager and terminal-handlers to read and forward the setting
- Add Switch toggle with warning styling in DevToolsSettings UI

The toggle includes visual warnings (amber colors, AlertTriangle icon) to
clearly indicate this is a dangerous option that bypasses Claude's
permission system.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): address PR review issues for YOLO mode implementation

- Add async readSettingsFileAsync to avoid blocking main process during settings read
- Extract YOLO_MODE_FLAG constant to eliminate duplicate flag strings
- Store dangerouslySkipPermissions on terminal object to persist YOLO mode across profile switches
- Update switchClaudeProfile callback to pass stored YOLO mode setting

These fixes address:
- LOW: Synchronous file I/O in IPC handler
- LOW: Flag string duplicated in invokeClaude and invokeClaudeAsync
- MEDIUM: YOLO mode not persisting when switching Claude profiles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Make worktree isolation prominent in UI (#1020)

* auto-claude: subtask-1-1 - Add i18n translation keys for worktree notice banner and merge tooltip

- Added wizard.worktreeNotice.title and wizard.worktreeNotice.description for task creation banner
- Added review.mergeTooltip for merge button explanation
- Translations added to both en/tasks.json and fr/tasks.json

* auto-claude: subtask-1-2 - Add visible info banner to TaskCreationWizard expl

* auto-claude: subtask-1-3 - Add tooltip to 'Merge with AI' button in WorkspaceStatus

- Import Tooltip components from ui/tooltip
- Wrap merge button with Tooltip, TooltipTrigger, TooltipContent
- Add contextual tooltip text explaining merge operation:
  * With AI: explains worktree merge, removal, and AI conflict resolution
  * Without AI: explains worktree merge and removal
- Follows Radix UI tooltip pattern from reference file

* fix: use i18n key for merge button tooltip in WorkspaceStatus

* fix: clarify merge tooltip - worktree removal is optional (qa-requested)

Fixes misleading tooltip text that implied worktree is automatically removed
during merge. In reality, after merge, users are shown a dialog where they can
choose to keep or remove the worktree. Updated tooltip to reflect this flow.

Changes:
- Updated en/tasks.json: Changed tooltip to clarify worktree removal is optional
- Updated fr/tasks.json: Updated French translation to match

QA Feedback: "Its currently saying on the tooltip that it will 'remove the worktree'
Please validate if this is the actual logic. As per my understanding, there will be
an extra button afterwards that will make sure that the user has access to the work
tree if they want to revert anything. The user has to manually accept to remove the
work tree."

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: use theme-aware colors for worktree info banner

Replace hardcoded blue colors with semantic theme classes to support
dark mode properly. Uses the same pattern as other info banners in
the codebase (bg-info/10, border-info/30, text-info).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(terminal): improve worktree name input UX (#1012)

* fix(terminal): improve worktree name input to not strip trailing characters while typing

- Allow trailing hyphens/underscores during input (only trim on submit)
- Add preview name that shows the final sanitized value for branch preview
- Remove invalid characters instead of replacing with hyphens
- Collapse consecutive underscores in addition to hyphens
- Final sanitization happens on submit to match backend WORKTREE_NAME_REGEX

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): address PR review findings for worktree name validation

- Fix submit button disabled check to use sanitized name instead of raw input
- Simplify trailing trim logic (apply once after all transformations)
- Apply lowercase in handleNameChange to reduce input/preview gap
- Internationalize 'name' fallback using existing translation key

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): improve header responsiveness for multiple terminals

- Hide text labels (Claude, Open in IDE) when ≥4 terminals, show icon only
- Add dynamic max-width to worktree name badge with truncation
- Add tooltips to all icon-only elements for accessibility
- Maintain full functionality while reducing header width requirements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Test User <test@example.com>

* fix(terminal): enhance terminal recreation logic with retry mechanism (#1013)

* fix(terminal): enhance terminal recreation logic with retry mechanism

- Introduced a maximum retry limit and delay for terminal recreation when dimensions are not ready.
- Added cleanup for retry timers on component unmount to prevent memory leaks.
- Improved error handling to report failures after exceeding retry attempts, ensuring better user feedback during terminal setup.

* fix(terminal): address PR review feedback for retry mechanism

- Fix race condition: clear pending retry timer at START of effect
  to prevent multiple timers when dependencies change mid-retry
- Fix isCreatingRef: keep it true during retry window to prevent
  duplicate creation attempts from concurrent effect runs
- Extract duplicated retry logic into scheduleRetryOrFail helper
  (consolidated 5 duplicate instances into 1 reusable function)
- Add handleSuccess/handleError helpers to reduce code duplication
- Reduce file from 295 to 237 lines (~20% reduction)

Addresses review feedback from CodeRabbit, Gemini, and Auto Claude.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat(terminal): add task worktrees section and remove terminal limit (#1033)

* feat(terminal): add task worktrees section and remove terminal limit

- Remove 12 terminal worktree limit (now unlimited)
- Add "Task Worktrees" section in worktree dropdown below terminal worktrees
- Task worktrees (created by kanban) now accessible for manual work
- Update translations for new section labels (EN + FR)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(terminal): address PR review feedback

- Clear taskWorktrees state when project is null or changes
- Parallelize API calls with Promise.all for better performance
- Use consistent path-based filtering for both worktree types
- Add clarifying comment for createdAt timestamp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Test User <test@example.com>

* Add file/screenshot upload to QA feedback interface (#1018)

* auto-claude: subtask-1-1 - Add feedbackImages state and handlers to useTaskDetail

- Add feedbackImages state as ImageAttachment[] for storing feedback images
- Add setFeedbackImages setter for direct state updates
- Add addFeedbackImage handler for adding a single image
- Add addFeedbackImages handler for adding multiple images at once
- Add removeFeedbackImage handler for removing an image by ID
- Add clearFeedbackImages handler for clearing all images
- Import ImageAttachment type from shared/types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* auto-claude: subtask-1-2 - Update IPC interface to support images in submitReview

- Add ImageAttachment import from ./task types
- Update submitReview signature to include optional images parameter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* auto-claude: subtask-1-3 - Update submitReview function in task-store to accept and pass images

* auto-claude: subtask-2-1 - Add paste/drop handlers and image thumbnail displa

- Add paste event handler for screenshot/image clipboard support
- Add drag-over and drag-leave handlers for visual feedback during drag
- Add drop handler for image file drops
- Add image thumbnail display (64x64) with remove button on hover
- Import image utilities from ImageUpload.tsx (generateImageId, blobToBase64, etc.)
- Add i18n support for all new UI text
- Make new props optional for backward compatibility during incremental rollout
- Allow submission with either text feedback or images (not both required)
- Add visual drag feedback with border/background color change

* auto-claude: subtask-2-2 - Update TaskReview to pass image props to QAFeedbackSection

* auto-claude: subtask-2-3 - Update TaskDetailModal to manage image state and pass to TaskReview

- Pass feedbackImages and setFeedbackImages from useTaskDetail hook to TaskReview
- Update handleReject to include images in submitReview call
- Allow submission with images only (no text required)
- Clear images after successful submission

* auto-claude: subtask-3-1 - Add English translations for feedback image UI

* auto-claude: subtask-3-2 - Add French translations for feedback image UI

* fix(security): sanitize image filename to prevent path traversal

- Use path.basename() to strip directory components from filenames
- Validate sanitized filename is not empty, '.', or '..'
- Add defense-in-depth check verifying resolved path stays within target directory
- Fix base64 data URL regex to handle complex MIME types (e.g., svg+xml)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: add MIME type validation and fix SVG file extension

- Add server-side MIME type validation for image uploads (defense in depth)
- Fix SVG file extension: map 'image/svg+xml' to '.svg' instead of '.svg+xml'
- Add MIME-to-extension mapping for all allowed image types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: require mimeType and apply SVG extension fix to drop handler

- Change MIME validation to reject missing mimeType (prevents bypass)
- Add 'image/jpg' to server-side allowlist for consistency
- Apply mimeToExtension mapping to drop handler (was only in paste handler)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Test User <test@example.com>

* fix(auth): await profile manager initialization before auth check (#1010)

* fix(auth): await profile manager initialization before auth check

Fixes race condition where hasValidAuth() was called before the
ClaudeProfileManager finished async initialization from disk.

The getClaudeProfileManager() returns a singleton immediately with
default profile data (no OAuth token). When hasValidAuth() runs
before initialization completes, it returns false even when valid
credentials exist.

Changed all pre-flight auth checks to use
await initializeClaudeProfileManager() which ensures initialization
completes via promise caching.

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* fix(auth): add error handling for profile manager initialization

Prevents unhandled promise rejections when initializeClaudeProfileManager()
throws due to filesystem errors (permissions, disk full, corrupt JSON).

The ipcMain.on handler for TASK_START doesn't await promises, so
unhandled rejections could crash the main process. Wrapped all
await initializeClaudeProfileManager() calls in try-catch blocks.

Found via automated code review.

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* test: mock initializeClaudeProfileManager in subprocess tests

The test mock was only mocking getClaudeProfileManager, but now we
also use initializeClaudeProfileManager which wasn't mocked, causing
test failures.

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* fix(auth): add try-catch for initializeClaudeProfileManager in remaining handlers

Addresses PR review feedback - TASK_UPDATE_STATUS and TASK_RECOVER_STUCK
handlers were missing try-catch blocks for initializeClaudeProfileManager(),
inconsistent with TASK_START handler.

If initialization fails, users now get specific file permissions guidance
instead of generic error messages.

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* refactor(auth): extract profile manager initialization into helper

Extract the repeated initializeClaudeProfileManager() + try/catch pattern
into a helper function ensureProfileManagerInitialized() that returns
a discriminated union for type-safe error handling.

This reduces code duplication across TASK_START, TASK_UPDATE_STATUS,
and TASK_RECOVER_STUCK handlers while preserving context-specific
error handling behavior.

The helper returns:
- { success: true, profileManager } on success
- { success: false, error } on failure

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

* fix(auth): improve error details and allow retry after transient failures

Two improvements to profile manager initialization:

1. Include actual error details in failure response for better debugging.
   Previously, only a generic message was returned to users, making it
   hard to diagnose the root cause. Now the error message is appended.

2. Reset cached promise on failure to allow retries after transient errors.
   Previously, if initialize() failed (e.g., EACCES, ENOSPC), the rejected
   promise was cached forever, requiring app restart to recover. Now the
   cached promise is reset on failure, allowing subsequent calls to retry.

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>

---------

Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Co-authored-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>

* fix(frontend): validate Windows claude.cmd reliably in GUI (#1023)

* fix: use absolute cmd.exe for Claude CLI validation

* fix: make cmd.exe validation type-safe for tests

* fix: satisfy frontend typecheck for cli tool tests

Signed-off-by: Umaru <caleb.1331@outlook.com>

* test: mock windows-paths exports for isSecurePath

Signed-off-by: Umaru <caleb.1331@outlook.com>

* test: make cli env tests platform-aware

Signed-off-by: Umaru <caleb.1331@outlook.com>

* test: cover isSecurePath guard in claude detection

Signed-off-by: Umaru <caleb.1331@outlook.com>

* test: align env-utils mocks with shouldUseShell

Signed-off-by: Umaru <caleb.1331@outlook.com>

* test: assert isSecurePath for cmd path

* fix(frontend): handle quoted claude.cmd paths in validation

---------

Signed-off-by: Umaru <caleb.1331@outlook.com>
Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>

* 2.7.4 release

* changelog 2.7.4

---------

Signed-off-by: Black Circle Sentinel <mludlow000@icloud.com>
Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Signed-off-by: Umaru <caleb.1331@outlook.com>
Co-authored-by: StillKnotKnown <192589389+StillKnotKnown@users.noreply.github.com>
Co-authored-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Michael Ludlow <mludlow000@icloud.com>
Co-authored-by: Test User <test@example.com>
Co-authored-by: Umaru <caleb.1331@outlook.com>

* fix(docs): update README download links to v2.7.4

The stable version badge was updated to 2.7.4 but the download links
were still pointing to 2.7.3 artifacts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: update all model versions to Claude 4.5 and connect insights to frontend settings

- Update outdated model versions across entire codebase:
  - claude-sonnet-4-20250514 → claude-sonnet-4-5-20250929
  - claude-opus-4-20250514 → claude-opus-4-5-20251101
  - claude-haiku-3-5-20241022 → claude-haiku-4-5-20251001
  - claude-sonnet-3-5-20241022 removed from pricing table

- Fix insight extractor crash with Haiku + extended thinking:
  - Set thinking_default to "none" for insights agent type
  - Haiku models don't support extended thinking

- Connect Insights Chat to frontend Agent Settings:
  - Add getInsightsFeatureSettings() to read featureModels/featureThinking
  - Merge frontend settings with any explicit modelConfig
  - Follow same pattern as ideation handlers

- Update rate limiter pricing table with current models only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address PR review findings for insights feature

- Fix incorrect comment about Haiku extended thinking support
  (Haiku 4.5 does NOT support extended thinking, only Sonnet 4.5 and Opus 4.5)
- Use standard path import pattern consistent with codebase
- Replace console.error with debugError for consistent logging
- Add pydantic to test requirements (fixes CI test collection error)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: ruff format issue in insights_runner.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address follow-up PR review findings

- Fix HIGH: Make max_thinking_tokens conditional in simple_client.py
  (prevents passing None to SDK, which may cause issues with Haiku)
- Fix MEDIUM: Use nullish coalescing at property level for featureModels.insights
  (handles partial settings objects where insights key may be missing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Signed-off-by: Black Circle Sentinel <mludlow000@icloud.com>
Signed-off-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Signed-off-by: Umaru <caleb.1331@outlook.com>
Co-authored-by: StillKnotKnown <192589389+StillKnotKnown@users.noreply.github.com>
Co-authored-by: StillKnotKnown <stillknotknown@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Michael Ludlow <mludlow000@icloud.com>
Co-authored-by: Test User <test@example.com>
Co-authored-by: Umaru <caleb.1331@outlook.com>
This commit is contained in:
Andy
2026-01-15 21:00:27 +01:00
committed by GitHub
parent b5c0e6312e
commit 58f4f30b21
35 changed files with 227 additions and 156 deletions
+4 -4
View File
@@ -269,9 +269,9 @@ GRAPHITI_ENABLED=true
# OpenRouter Base URL (default: https://openrouter.ai/api/v1)
# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
# OpenRouter LLM Model (default: anthropic/claude-3.5-sonnet)
# Popular choices: anthropic/claude-3.5-sonnet, openai/gpt-4o, google/gemini-2.0-flash
# OPENROUTER_LLM_MODEL=anthropic/claude-3.5-sonnet
# OpenRouter LLM Model (default: anthropic/claude-sonnet-4)
# Popular choices: anthropic/claude-sonnet-4, openai/gpt-4o, google/gemini-2.0-flash
# OPENROUTER_LLM_MODEL=anthropic/claude-sonnet-4
# OpenRouter Embedding Model (default: openai/text-embedding-3-small)
# OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-small
@@ -368,5 +368,5 @@ GRAPHITI_ENABLED=true
# GRAPHITI_LLM_PROVIDER=openrouter
# GRAPHITI_EMBEDDER_PROVIDER=openrouter
# OPENROUTER_API_KEY=sk-or-xxxxxxxx
# OPENROUTER_LLM_MODEL=anthropic/claude-3.5-sonnet
# OPENROUTER_LLM_MODEL=anthropic/claude-sonnet-4
# OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-small
+3 -1
View File
@@ -247,7 +247,9 @@ AGENT_CONFIGS = {
"tools": BASE_READ_TOOLS + WEB_TOOLS,
"mcp_servers": [],
"auto_claude_tools": [],
"thinking_default": "medium",
# Note: Default to "none" because insight_extractor uses Haiku which doesn't support thinking
# If using Sonnet/Opus models, override max_thinking_tokens in create_simple_client()
"thinking_default": "none",
},
"merge_resolver": {
"tools": [], # Text-only analysis
+3 -1
View File
@@ -33,7 +33,9 @@ except ImportError:
from core.auth import ensure_claude_code_oauth_token, get_auth_token
# Default model for insight extraction (fast and cheap)
DEFAULT_EXTRACTION_MODEL = "claude-3-5-haiku-latest"
# Note: Using Haiku 4.5 for fast, cheap extraction. Haiku does not support
# extended thinking, so thinking_default is set to "none" in models.py
DEFAULT_EXTRACTION_MODEL = "claude-haiku-4-5-20251001"
# Maximum diff size to send to the LLM (avoid context limits)
MAX_DIFF_CHARS = 15000
+4 -1
View File
@@ -96,9 +96,12 @@ def create_simple_client(
"max_turns": max_turns,
"cwd": str(cwd.resolve()) if cwd else None,
"env": sdk_env,
"max_thinking_tokens": max_thinking_tokens,
}
# Only add max_thinking_tokens if not None (Haiku doesn't support extended thinking)
if max_thinking_tokens is not None:
options_kwargs["max_thinking_tokens"] = max_thinking_tokens
# Add CLI path if found
if cli_path:
options_kwargs["cli_path"] = cli_path
+2 -2
View File
@@ -146,7 +146,7 @@ class GraphitiConfig:
# OpenRouter settings (multi-provider aggregator)
openrouter_api_key: str = ""
openrouter_base_url: str = "https://openrouter.ai/api/v1"
openrouter_llm_model: str = "anthropic/claude-3.5-sonnet"
openrouter_llm_model: str = "anthropic/claude-sonnet-4"
openrouter_embedding_model: str = "openai/text-embedding-3-small"
# Ollama settings (local)
@@ -210,7 +210,7 @@ class GraphitiConfig:
"OPENROUTER_BASE_URL", "https://openrouter.ai/api/v1"
)
openrouter_llm_model = os.environ.get(
"OPENROUTER_LLM_MODEL", "anthropic/claude-3.5-sonnet"
"OPENROUTER_LLM_MODEL", "anthropic/claude-sonnet-4"
)
openrouter_embedding_model = os.environ.get(
"OPENROUTER_EMBEDDING_MODEL", "openai/text-embedding-3-small"
@@ -35,7 +35,7 @@ def create_openrouter_llm_client(config: "GraphitiConfig") -> Any:
>>> from auto_claude.integrations.graphiti.config import GraphitiConfig
>>> config = GraphitiConfig(
... openrouter_api_key="sk-or-...",
... openrouter_llm_model="anthropic/claude-3.5-sonnet"
... openrouter_llm_model="anthropic/claude-sonnet-4"
... )
>>> client = create_openrouter_llm_client(config)
"""
+2 -2
View File
@@ -154,7 +154,7 @@ Respond with JSON only:
client = create_simple_client(
agent_type="batch_analysis",
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
system_prompt="You are an expert at analyzing GitHub issues and grouping related ones. Respond ONLY with valid JSON. Do NOT use any tools.",
cwd=self.project_dir,
)
@@ -408,7 +408,7 @@ class IssueBatcher:
api_key: str | None = None,
# AI validation settings
validate_batches: bool = True,
validation_model: str = "claude-sonnet-4-20250514",
validation_model: str = "claude-sonnet-4-5-20250929",
validation_thinking_budget: int = 10000, # Medium thinking
):
self.github_dir = github_dir
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
CLAUDE_SDK_AVAILABLE = importlib.util.find_spec("claude_agent_sdk") is not None
# Default model and thinking configuration
DEFAULT_MODEL = "claude-sonnet-4-20250514"
DEFAULT_MODEL = "claude-sonnet-4-5-20250929"
DEFAULT_THINKING_BUDGET = 10000 # Medium thinking
+2 -2
View File
@@ -841,7 +841,7 @@ class GitHubRunnerConfig:
)
# Model settings
model: str = "claude-sonnet-4-20250514"
model: str = "claude-sonnet-4-5-20250929"
thinking_level: str = "medium"
def to_dict(self) -> dict:
@@ -915,6 +915,6 @@ class GitHubRunnerConfig:
review_own_prs=settings.get("review_own_prs", False),
auto_post_reviews=settings.get("auto_post_reviews", False),
allow_fix_commits=settings.get("allow_fix_commits", True),
model=settings.get("model", "claude-sonnet-4-20250514"),
model=settings.get("model", "claude-sonnet-4-5-20250929"),
thinking_level=settings.get("thinking_level", "medium"),
)
+7 -8
View File
@@ -31,7 +31,7 @@ Usage:
limiter.track_ai_cost(
input_tokens=1000,
output_tokens=500,
model="claude-sonnet-4-20250514"
model="claude-sonnet-4-5-20250929"
)
# Manual rate check
@@ -160,13 +160,12 @@ class TokenBucket:
# AI model pricing (per 1M tokens)
AI_PRICING = {
# Claude models (as of 2025)
"claude-sonnet-4-20250514": {"input": 3.00, "output": 15.00},
"claude-opus-4-20250514": {"input": 15.00, "output": 75.00},
"claude-sonnet-3-5-20241022": {"input": 3.00, "output": 15.00},
"claude-haiku-3-5-20241022": {"input": 0.80, "output": 4.00},
# Claude 4.5 models (current)
"claude-sonnet-4-5-20250929": {"input": 3.00, "output": 15.00},
"claude-opus-4-5-20251101": {"input": 15.00, "output": 75.00},
"claude-haiku-4-5-20251001": {"input": 0.80, "output": 4.00},
# Extended thinking models (higher output costs)
"claude-sonnet-4-20250514-thinking": {"input": 3.00, "output": 15.00},
"claude-sonnet-4-5-20250929-thinking": {"input": 3.00, "output": 15.00},
# Default fallback
"default": {"input": 3.00, "output": 15.00},
}
@@ -665,7 +664,7 @@ if __name__ == "__main__":
cost = limiter.track_ai_cost(
input_tokens=1000,
output_tokens=500,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="PR review",
)
print(f" Cost: ${cost:.4f}")
+1 -1
View File
@@ -682,7 +682,7 @@ def main():
parser.add_argument(
"--model",
type=str,
default="claude-sonnet-4-20250514",
default="claude-sonnet-4-5-20250929",
help="AI model to use",
)
parser.add_argument(
@@ -94,7 +94,7 @@ class BatchProcessor:
min_batch_size=1,
max_batch_size=5,
validate_batches=True,
validation_model="claude-sonnet-4-20250514",
validation_model="claude-sonnet-4-5-20250929",
validation_thinking_budget=10000,
)
@@ -220,7 +220,7 @@ class BatchProcessor:
min_batch_size=1,
max_batch_size=5,
validate_batches=True,
validation_model="claude-sonnet-4-20250514",
validation_model="claude-sonnet-4-5-20250929",
validation_thinking_budget=10000,
)
@@ -101,7 +101,7 @@ class TestCostTracker:
cost = CostTracker.calculate_cost(
input_tokens=1_000_000,
output_tokens=1_000_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
# $3 input + $15 output = $18 for 1M each
assert cost == 18.0
@@ -111,7 +111,7 @@ class TestCostTracker:
cost = CostTracker.calculate_cost(
input_tokens=1_000_000,
output_tokens=1_000_000,
model="claude-opus-4-20250514",
model="claude-opus-4-5-20251101",
)
# $15 input + $75 output = $90 for 1M each
assert cost == 90.0
@@ -121,7 +121,7 @@ class TestCostTracker:
cost = CostTracker.calculate_cost(
input_tokens=1_000_000,
output_tokens=1_000_000,
model="claude-haiku-3-5-20241022",
model="claude-haiku-4-5-20251001",
)
# $0.80 input + $4 output = $4.80 for 1M each
assert cost == 4.80
@@ -142,7 +142,7 @@ class TestCostTracker:
cost = tracker.add_operation(
input_tokens=100_000, # $0.30
output_tokens=50_000, # $0.75
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="test",
)
assert 1.0 <= cost <= 1.1
@@ -156,7 +156,7 @@ class TestCostTracker:
tracker.add_operation(
input_tokens=1_000_000, # $3 - exceeds $1 limit
output_tokens=0,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
def test_remaining_budget(self):
@@ -165,7 +165,7 @@ class TestCostTracker:
tracker.add_operation(
input_tokens=100_000,
output_tokens=50_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
remaining = tracker.remaining_budget()
assert 8.9 <= remaining <= 9.1
@@ -176,7 +176,7 @@ class TestCostTracker:
tracker.add_operation(
input_tokens=100_000,
output_tokens=50_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="operation1",
)
report = tracker.usage_report()
@@ -231,7 +231,7 @@ class TestRateLimiter:
cost = limiter.track_ai_cost(
input_tokens=100_000,
output_tokens=50_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="test",
)
assert cost > 0
@@ -244,7 +244,7 @@ class TestRateLimiter:
limiter.track_ai_cost(
input_tokens=1_000_000,
output_tokens=1_000_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
def test_check_cost_available(self):
@@ -352,7 +352,7 @@ class TestRateLimitedDecorator:
limiter.track_ai_cost(
input_tokens=1_000_000,
output_tokens=1_000_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
return "success"
@@ -433,7 +433,7 @@ class TestIntegration:
limiter.track_ai_cost(
input_tokens=5000,
output_tokens=2000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="PR review",
)
@@ -472,7 +472,7 @@ class TestIntegration:
limiter.track_ai_cost(
input_tokens=10_000,
output_tokens=5_000,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
operation_name="PR review",
)
@@ -480,7 +480,7 @@ class TestIntegration:
limiter.track_ai_cost(
input_tokens=5_000,
output_tokens=2_000,
model="claude-haiku-3-5-20241022",
model="claude-haiku-4-5-20251001",
operation_name="Issue triage",
)
@@ -488,7 +488,7 @@ class TestIntegration:
limiter.track_ai_cost(
input_tokens=20_000,
output_tokens=10_000,
model="claude-opus-4-20250514",
model="claude-opus-4-5-20251101",
operation_name="Architecture review",
)
+1 -1
View File
@@ -208,7 +208,7 @@ class GitLabRunnerConfig:
instance_url: str = "https://gitlab.com"
# Model settings
model: str = "claude-sonnet-4-20250514"
model: str = "claude-sonnet-4-5-20250929"
thinking_level: str = "medium"
def to_dict(self) -> dict:
+1 -1
View File
@@ -270,7 +270,7 @@ def main():
parser.add_argument(
"--model",
type=str,
default="claude-sonnet-4-20250514",
default="claude-sonnet-4-5-20250929",
help="AI model to use",
)
parser.add_argument(
+19 -14
View File
@@ -47,7 +47,7 @@ from debug import (
debug_section,
debug_success,
)
from phase_config import resolve_model_id
from phase_config import get_thinking_budget, resolve_model_id
def load_project_context(project_dir: str) -> str:
@@ -178,28 +178,33 @@ async def run_with_sdk(
Current question: {message}"""
# Convert thinking level to token budget
max_thinking_tokens = get_thinking_budget(thinking_level)
debug(
"insights_runner",
"Using model configuration",
model=model,
thinking_level=thinking_level,
max_thinking_tokens=max_thinking_tokens,
)
try:
# Build options dict - only include max_thinking_tokens if not None
options_kwargs = {
"model": resolve_model_id(model), # Resolve via API Profile if configured
"system_prompt": system_prompt,
"allowed_tools": ["Read", "Glob", "Grep"],
"max_turns": 30, # Allow sufficient turns for codebase exploration
"cwd": str(project_path),
}
# Only add thinking tokens if the thinking level is not "none"
if max_thinking_tokens is not None:
options_kwargs["max_thinking_tokens"] = max_thinking_tokens
# Create Claude SDK client with appropriate settings for insights
client = ClaudeSDKClient(
options=ClaudeAgentOptions(
model=resolve_model_id(model), # Resolve via API Profile if configured
system_prompt=system_prompt,
allowed_tools=[
"Read",
"Glob",
"Grep",
],
max_turns=30, # Allow sufficient turns for codebase exploration
cwd=str(project_path),
)
)
client = ClaudeSDKClient(options=ClaudeAgentOptions(**options_kwargs))
# Use async context manager pattern
async with client:
@@ -198,10 +198,10 @@ describe('AgentProcessManager - API Profile Env Injection (Story 2.3)', () => {
it('should inject model env vars when active profile has models configured', async () => {
const mockApiProfileEnv = {
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-3-5-haiku-20241022',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-3-5-opus-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-haiku-4-5-20251001',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-5-20251101'
};
vi.mocked(profileService.getAPIProfileEnv).mockResolvedValue(mockApiProfileEnv);
@@ -210,10 +210,10 @@ describe('AgentProcessManager - API Profile Env Injection (Story 2.3)', () => {
expect(spawnCalls).toHaveLength(1);
expect(spawnCalls[0].options.env).toMatchObject({
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-3-5-haiku-20241022',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-3-5-opus-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-haiku-4-5-20251001',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-5-20251101'
});
});
@@ -122,7 +122,7 @@ function getAutoFixConfig(project: Project): AutoFixConfig {
labels: data.auto_fix_labels ?? ['auto-fix'],
requireHumanApproval: data.require_human_approval ?? true,
botToken: data.bot_token,
model: data.model ?? 'claude-sonnet-4-20250514',
model: data.model ?? 'claude-sonnet-4-5-20250929',
thinkingLevel: data.thinking_level ?? 'medium',
};
} catch {
@@ -133,7 +133,7 @@ function getAutoFixConfig(project: Project): AutoFixConfig {
enabled: false,
labels: ['auto-fix'],
requireHumanApproval: true,
model: 'claude-sonnet-4-20250514',
model: 'claude-sonnet-4-5-20250929',
thinkingLevel: 'medium',
};
}
@@ -87,7 +87,7 @@ function getAutoFixConfig(project: Project): GitLabAutoFixConfig {
enabled: data.auto_fix_enabled ?? false,
labels: data.auto_fix_labels ?? ['auto-fix'],
requireHumanApproval: data.require_human_approval ?? true,
model: data.model ?? 'claude-sonnet-4-20250514',
model: data.model ?? 'claude-sonnet-4-5-20250929',
thinkingLevel: data.thinking_level ?? 'medium',
};
} catch {
@@ -99,7 +99,7 @@ function getAutoFixConfig(project: Project): GitLabAutoFixConfig {
enabled: false,
labels: ['auto-fix'],
requireHumanApproval: true,
model: 'claude-sonnet-4-20250514',
model: 'claude-sonnet-4-5-20250929',
thinkingLevel: 'medium',
};
}
@@ -1,8 +1,16 @@
import { ipcMain } from "electron";
import { ipcMain, app } from "electron";
import type { BrowserWindow } from "electron";
import path from "path";
import { existsSync, readdirSync, mkdirSync, writeFileSync } from "fs";
import { IPC_CHANNELS, getSpecsDir, AUTO_BUILD_PATHS } from "../../shared/constants";
import { existsSync, readdirSync, mkdirSync, writeFileSync, readFileSync } from "fs";
import { debugError } from "../../shared/utils/debug-logger";
import {
IPC_CHANNELS,
getSpecsDir,
AUTO_BUILD_PATHS,
DEFAULT_APP_SETTINGS,
DEFAULT_FEATURE_MODELS,
DEFAULT_FEATURE_THINKING,
} from "../../shared/constants";
import type {
IPCResult,
InsightsSession,
@@ -10,11 +18,46 @@ import type {
InsightsModelConfig,
Task,
TaskMetadata,
AppSettings,
} from "../../shared/types";
import { projectStore } from "../project-store";
import { insightsService } from "../insights-service";
import { safeSendToRenderer } from "./utils";
/**
* Read insights feature settings from the settings file
*/
function getInsightsFeatureSettings(): InsightsModelConfig {
const settingsPath = path.join(app.getPath("userData"), "settings.json");
try {
if (existsSync(settingsPath)) {
const content = readFileSync(settingsPath, "utf-8");
const settings: AppSettings = { ...DEFAULT_APP_SETTINGS, ...JSON.parse(content) };
// Get insights-specific settings from Agent Settings
// Use nullish coalescing at property level to handle partial settings objects
const featureModels = settings.featureModels ?? DEFAULT_FEATURE_MODELS;
const featureThinking = settings.featureThinking ?? DEFAULT_FEATURE_THINKING;
return {
profileId: "balanced", // Default profile for settings-based config
model: featureModels.insights ?? DEFAULT_FEATURE_MODELS.insights,
thinkingLevel: featureThinking.insights ?? DEFAULT_FEATURE_THINKING.insights,
};
}
} catch (error) {
debugError("[Insights Handler] Failed to read feature settings:", error);
}
// Return defaults if settings file doesn't exist or fails to parse
return {
profileId: "balanced", // Default profile for settings-based config
model: DEFAULT_FEATURE_MODELS.insights,
thinkingLevel: DEFAULT_FEATURE_THINKING.insights,
};
}
/**
* Register all insights-related IPC handlers
*/
@@ -50,12 +93,26 @@ export function registerInsightsHandlers(getMainWindow: () => BrowserWindow | nu
return;
}
// Get feature settings from Agent Settings and merge with provided config
const featureSettings = getInsightsFeatureSettings();
const configWithSettings: InsightsModelConfig = {
// Start with feature settings as defaults
...featureSettings,
// Override with any explicitly provided config
...modelConfig,
};
console.log("[Insights Handler] Using model config:", {
model: configWithSettings.model,
thinkingLevel: configWithSettings.thinkingLevel,
});
// Await the async sendMessage to ensure proper error handling and
// that all async operations (like getProcessEnv) complete before
// the handler returns. This fixes race conditions on Windows where
// environment setup wouldn't complete before process spawn.
try {
await insightsService.sendMessage(projectId, project.path, message, modelConfig);
await insightsService.sendMessage(projectId, project.path, message, configWithSettings);
} catch (error) {
// Errors during sendMessage (executor errors) are already emitted via
// the 'error' event, but we catch here to prevent unhandled rejection
@@ -192,7 +192,7 @@ describe('profile-service', () => {
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-test-key',
models: {
default: 'claude-3-5-sonnet-20241022'
default: 'claude-sonnet-4-5-20250929'
}
};
@@ -204,7 +204,7 @@ describe('profile-service', () => {
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-test-key',
models: {
default: 'claude-3-5-sonnet-20241022'
default: 'claude-sonnet-4-5-20250929'
}
});
expect(result.createdAt).toBeGreaterThan(0);
@@ -303,7 +303,7 @@ describe('profile-service', () => {
name: 'New Name',
baseUrl: 'https://new-api.example.com',
apiKey: 'sk-new-api-key-123',
models: { default: 'claude-3-5-sonnet-20241022' }
models: { default: 'claude-sonnet-4-5-20250929' }
};
const result = await updateProfile(input);
@@ -311,7 +311,7 @@ describe('profile-service', () => {
expect(result.name).toBe('New Name');
expect(result.baseUrl).toBe('https://new-api.example.com');
expect(result.apiKey).toBe('sk-new-api-key-123');
expect(result.models).toEqual({ default: 'claude-3-5-sonnet-20241022' });
expect(result.models).toEqual({ default: 'claude-sonnet-4-5-20250929' });
expect(result.updatedAt).toBeGreaterThan(1000000); // updatedAt should be refreshed
expect(result.createdAt).toBe(1000000); // createdAt should remain unchanged
});
@@ -522,10 +522,10 @@ describe('profile-service', () => {
baseUrl: 'https://api.custom.com',
apiKey: 'sk-test-key-12345678',
models: {
default: 'claude-3-5-sonnet-20241022',
haiku: 'claude-3-5-haiku-20241022',
sonnet: 'claude-3-5-sonnet-20241022',
opus: 'claude-3-5-opus-20241022'
default: 'claude-sonnet-4-5-20250929',
haiku: 'claude-haiku-4-5-20251001',
sonnet: 'claude-sonnet-4-5-20250929',
opus: 'claude-opus-4-5-20251101'
},
createdAt: Date.now(),
updatedAt: Date.now()
@@ -543,10 +543,10 @@ describe('profile-service', () => {
expect(result).toEqual({
ANTHROPIC_BASE_URL: 'https://api.custom.com',
ANTHROPIC_AUTH_TOKEN: 'sk-test-key-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-3-5-haiku-20241022',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-3-5-opus-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-haiku-4-5-20251001',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-5-20251101'
});
});
@@ -559,7 +559,7 @@ describe('profile-service', () => {
baseUrl: '',
apiKey: 'sk-test-key-12345678',
models: {
default: 'claude-3-5-sonnet-20241022',
default: 'claude-sonnet-4-5-20250929',
haiku: '',
sonnet: ''
},
@@ -584,7 +584,7 @@ describe('profile-service', () => {
// Non-empty values should be present
expect(result).toEqual({
ANTHROPIC_AUTH_TOKEN: 'sk-test-key-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929'
});
});
@@ -629,7 +629,7 @@ describe('profile-service', () => {
baseUrl: 'https://api.example.com',
apiKey: 'sk-test-key-12345678',
models: {
default: 'claude-3-5-sonnet-20241022'
default: 'claude-sonnet-4-5-20250929'
// Only default model set
},
createdAt: Date.now(),
@@ -648,7 +648,7 @@ describe('profile-service', () => {
expect(result).toEqual({
ANTHROPIC_BASE_URL: 'https://api.example.com',
ANTHROPIC_AUTH_TOKEN: 'sk-test-key-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929'
});
expect(result).not.toHaveProperty('ANTHROPIC_DEFAULT_HAIKU_MODEL');
expect(result).not.toHaveProperty('ANTHROPIC_DEFAULT_SONNET_MODEL');
@@ -671,7 +671,7 @@ describe('profile-service', () => {
name: 'Profile Two',
baseUrl: 'https://api2.example.com',
apiKey: 'sk-key-two-12345678',
models: { default: 'claude-3-5-sonnet-20241022' },
models: { default: 'claude-sonnet-4-5-20250929' },
createdAt: Date.now(),
updatedAt: Date.now()
},
@@ -696,7 +696,7 @@ describe('profile-service', () => {
expect(result).toEqual({
ANTHROPIC_BASE_URL: 'https://api2.example.com',
ANTHROPIC_AUTH_TOKEN: 'sk-key-two-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929'
});
});
@@ -266,7 +266,7 @@ describe('profile-service', () => {
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-test-key',
models: {
default: 'claude-3-5-sonnet-20241022'
default: 'claude-sonnet-4-5-20250929'
}
};
@@ -278,7 +278,7 @@ describe('profile-service', () => {
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-test-key',
models: {
default: 'claude-3-5-sonnet-20241022'
default: 'claude-sonnet-4-5-20250929'
}
});
expect(result.createdAt).toBeGreaterThan(0);
@@ -377,7 +377,7 @@ describe('profile-service', () => {
name: 'New Name',
baseUrl: 'https://new-api.example.com',
apiKey: 'sk-new-api-key-123',
models: { default: 'claude-3-5-sonnet-20241022' }
models: { default: 'claude-sonnet-4-5-20250929' }
};
const result = await updateProfile(input);
@@ -385,7 +385,7 @@ describe('profile-service', () => {
expect(result.name).toBe('New Name');
expect(result.baseUrl).toBe('https://new-api.example.com');
expect(result.apiKey).toBe('sk-new-api-key-123');
expect(result.models).toEqual({ default: 'claude-3-5-sonnet-20241022' });
expect(result.models).toEqual({ default: 'claude-sonnet-4-5-20250929' });
expect(result.updatedAt).toBeGreaterThan(1000000);
expect(result.createdAt).toBe(1000000);
});
@@ -573,10 +573,10 @@ describe('profile-service', () => {
baseUrl: 'https://api.custom.com',
apiKey: 'sk-test-key-12345678',
models: {
default: 'claude-3-5-sonnet-20241022',
haiku: 'claude-3-5-haiku-20241022',
sonnet: 'claude-3-5-sonnet-20241022',
opus: 'claude-3-5-opus-20241022'
default: 'claude-sonnet-4-5-20250929',
haiku: 'claude-haiku-4-5-20251001',
sonnet: 'claude-sonnet-4-5-20250929',
opus: 'claude-opus-4-5-20251101'
},
createdAt: Date.now(),
updatedAt: Date.now()
@@ -594,10 +594,10 @@ describe('profile-service', () => {
expect(result).toEqual({
ANTHROPIC_BASE_URL: 'https://api.custom.com',
ANTHROPIC_AUTH_TOKEN: 'sk-test-key-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-3-5-haiku-20241022',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-3-5-sonnet-20241022',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-3-5-opus-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-haiku-4-5-20251001',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-5-20250929',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-5-20251101'
});
});
@@ -610,7 +610,7 @@ describe('profile-service', () => {
baseUrl: '',
apiKey: 'sk-test-key-12345678',
models: {
default: 'claude-3-5-sonnet-20241022',
default: 'claude-sonnet-4-5-20250929',
haiku: '',
sonnet: ''
},
@@ -632,7 +632,7 @@ describe('profile-service', () => {
expect(result).not.toHaveProperty('ANTHROPIC_DEFAULT_SONNET_MODEL');
expect(result).toEqual({
ANTHROPIC_AUTH_TOKEN: 'sk-test-key-12345678',
ANTHROPIC_MODEL: 'claude-3-5-sonnet-20241022'
ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929'
});
});
});
@@ -746,8 +746,8 @@ describe('profile-service', () => {
it('should return list of models for successful response', async () => {
mockModelsList.mockResolvedValue({
data: [
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5', created_at: '2024-10-22', type: 'model' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5', created_at: '2024-10-22', type: 'model' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5', created_at: '2024-10-22', type: 'model' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5', created_at: '2024-10-22', type: 'model' }
]
});
@@ -755,8 +755,8 @@ describe('profile-service', () => {
expect(result).toEqual({
models: [
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5' }
]
});
});
@@ -53,7 +53,7 @@ const testProfiles: APIProfile[] = [
name: 'Production API',
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-prod-key-1234',
models: { default: 'claude-3-5-sonnet-20241022' },
models: { default: 'claude-sonnet-4-5-20250929' },
createdAt: Date.now(),
updatedAt: Date.now()
},
@@ -127,7 +127,7 @@ export function GraphitiStep({ onNext, onBack, onSkip }: GraphitiStepProps) {
groqApiKey: settings.globalGroqApiKey || '',
openrouterApiKey: settings.globalOpenRouterApiKey || '',
openrouterBaseUrl: 'https://openrouter.ai/api/v1',
openrouterLlmModel: 'anthropic/claude-3.5-sonnet',
openrouterLlmModel: 'anthropic/claude-sonnet-4',
openrouterEmbeddingModel: 'openai/text-embedding-3-small',
huggingfaceApiKey: '',
ollamaBaseUrl: settings.ollamaBaseUrl || 'http://localhost:11434',
@@ -46,21 +46,21 @@ describe('ModelSearchableSelect', () => {
it('should render with initial value', () => {
render(
<ModelSearchableSelect
value="claude-3-5-sonnet-20241022"
value="claude-sonnet-4-5-20250929"
onChange={mockOnChange}
baseUrl="https://api.anthropic.com"
apiKey="sk-test-key-12chars"
/>
);
const input = screen.getByDisplayValue('claude-3-5-sonnet-20241022');
const input = screen.getByDisplayValue('claude-sonnet-4-5-20250929');
expect(input).toBeInTheDocument();
});
it('should fetch models when dropdown opens', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5' }
]);
render(
@@ -111,8 +111,8 @@ describe('ModelSearchableSelect', () => {
it('should display fetched models in dropdown', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5' }
]);
render(
@@ -128,14 +128,14 @@ describe('ModelSearchableSelect', () => {
fireEvent.focus(input);
await waitFor(() => {
expect(screen.getByText('Claude Sonnet 3.5')).toBeInTheDocument();
expect(screen.getByText('claude-3-5-sonnet-20241022')).toBeInTheDocument();
expect(screen.getByText('Claude Sonnet 4.5')).toBeInTheDocument();
expect(screen.getByText('claude-sonnet-4-5-20250929')).toBeInTheDocument();
});
});
it('should render dropdown above the input', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' }
]);
render(
@@ -160,7 +160,7 @@ describe('ModelSearchableSelect', () => {
it('should select model and close dropdown', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' }
]);
render(
@@ -176,11 +176,11 @@ describe('ModelSearchableSelect', () => {
fireEvent.focus(input);
await waitFor(() => {
const modelButton = screen.getByText('Claude Sonnet 3.5');
const modelButton = screen.getByText('Claude Sonnet 4.5');
fireEvent.click(modelButton);
});
expect(mockOnChange).toHaveBeenCalledWith('claude-3-5-sonnet-20241022');
expect(mockOnChange).toHaveBeenCalledWith('claude-sonnet-4-5-20250929');
});
it('should allow manual text input', async () => {
@@ -201,8 +201,8 @@ describe('ModelSearchableSelect', () => {
it('should filter models based on search query', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5' },
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5' },
{ id: 'claude-3-opus-20240229', display_name: 'Claude Opus 3' }
]);
@@ -220,7 +220,7 @@ describe('ModelSearchableSelect', () => {
// Wait for models to load
await waitFor(() => {
expect(screen.getByText('Claude Sonnet 3.5')).toBeInTheDocument();
expect(screen.getByText('Claude Sonnet 4.5')).toBeInTheDocument();
});
// Type search query
@@ -229,8 +229,8 @@ describe('ModelSearchableSelect', () => {
// Should only show Haiku
await waitFor(() => {
expect(screen.getByText('Claude Haiku 3.5')).toBeInTheDocument();
expect(screen.queryByText('Claude Sonnet 3.5')).not.toBeInTheDocument();
expect(screen.getByText('Claude Haiku 4.5')).toBeInTheDocument();
expect(screen.queryByText('Claude Sonnet 4.5')).not.toBeInTheDocument();
expect(screen.queryByText('Claude Opus 3')).not.toBeInTheDocument();
});
});
@@ -281,7 +281,7 @@ describe('ModelSearchableSelect', () => {
it('should show no results message when search does not match', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' }
]);
render(
@@ -297,7 +297,7 @@ describe('ModelSearchableSelect', () => {
fireEvent.focus(input);
await waitFor(() => {
expect(screen.getByText('Claude Sonnet 3.5')).toBeInTheDocument();
expect(screen.getByText('Claude Sonnet 4.5')).toBeInTheDocument();
});
// Search for non-existent model
@@ -326,32 +326,32 @@ describe('ModelSearchableSelect', () => {
it('should highlight selected model', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' },
{ id: 'claude-3-5-haiku-20241022', display_name: 'Claude Haiku 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' },
{ id: 'claude-haiku-4-5-20251001', display_name: 'Claude Haiku 4.5' }
]);
render(
<ModelSearchableSelect
value="claude-3-5-sonnet-20241022"
value="claude-sonnet-4-5-20250929"
onChange={mockOnChange}
baseUrl="https://api.anthropic.com"
apiKey="sk-test-key-12chars"
/>
);
const input = screen.getByDisplayValue('claude-3-5-sonnet-20241022');
const input = screen.getByDisplayValue('claude-sonnet-4-5-20250929');
fireEvent.focus(input);
await waitFor(() => {
// Selected model should have Check icon indicator (via background color)
const sonnetButton = screen.getByText('Claude Sonnet 3.5').closest('button');
const sonnetButton = screen.getByText('Claude Sonnet 4.5').closest('button');
expect(sonnetButton).toHaveClass('bg-accent');
});
});
it('should close dropdown when clicking outside', async () => {
mockDiscoverModels.mockResolvedValue([
{ id: 'claude-3-5-sonnet-20241022', display_name: 'Claude Sonnet 3.5' }
{ id: 'claude-sonnet-4-5-20250929', display_name: 'Claude Sonnet 4.5' }
]);
render(
@@ -370,14 +370,14 @@ describe('ModelSearchableSelect', () => {
fireEvent.focus(input);
await waitFor(() => {
expect(screen.getByText('Claude Sonnet 3.5')).toBeInTheDocument();
expect(screen.getByText('Claude Sonnet 4.5')).toBeInTheDocument();
});
// Click outside
fireEvent.mouseDown(screen.getByTestId('outside-element'));
await waitFor(() => {
expect(screen.queryByText('Claude Sonnet 3.5')).not.toBeInTheDocument();
expect(screen.queryByText('Claude Sonnet 4.5')).not.toBeInTheDocument();
});
});
});
@@ -47,7 +47,7 @@ interface ModelSearchableSelectProps {
* @example
* ```tsx
* <ModelSearchableSelect
* value="claude-3-5-sonnet-20241022"
* value="claude-sonnet-4-5-20250929"
* onChange={(modelId) => setModel(modelId)}
* baseUrl="https://api.anthropic.com"
* apiKey="sk-ant-..."
@@ -31,8 +31,8 @@ describe('ProfileEditDialog - Edit Mode', () => {
baseUrl: 'https://api.example.com',
apiKey: 'sk-ant-api123-test-key-abc123',
models: {
default: 'claude-3-5-sonnet-20241022',
haiku: 'claude-3-5-haiku-20241022'
default: 'claude-sonnet-4-5-20250929',
haiku: 'claude-haiku-4-5-20251001'
},
createdAt: 1700000000000,
updatedAt: 1700000000000
@@ -44,7 +44,7 @@ const testProfiles: APIProfile[] = [
name: 'Production API',
baseUrl: 'https://api.anthropic.com',
apiKey: 'sk-ant-prod-key-1234',
models: { default: 'claude-3-5-sonnet-20241022' },
models: { default: 'claude-sonnet-4-5-20250929' },
createdAt: Date.now(),
updatedAt: Date.now()
},
@@ -104,10 +104,10 @@
"haikuLabel": "Haiku Model (Optional)",
"sonnetLabel": "Sonnet Model (Optional)",
"opusLabel": "Opus Model (Optional)",
"defaultPlaceholder": "e.g., claude-3-5-sonnet-20241022",
"haikuPlaceholder": "e.g., claude-3-5-haiku-20241022",
"sonnetPlaceholder": "e.g., claude-3-5-sonnet-20241022",
"opusPlaceholder": "e.g., claude-3-5-opus-20241022"
"defaultPlaceholder": "e.g., claude-sonnet-4-5-20250929",
"haikuPlaceholder": "e.g., claude-haiku-4-5-20251001",
"sonnetPlaceholder": "e.g., claude-sonnet-4-5-20250929",
"opusPlaceholder": "e.g., claude-opus-4-5-20251101"
},
"empty": {
"title": "No API profiles configured",
@@ -167,7 +167,7 @@
},
"modelSelect": {
"placeholder": "Select a model or type manually",
"placeholderManual": "Enter model name (e.g., claude-3-5-sonnet-20241022)",
"placeholderManual": "Enter model name (e.g., claude-sonnet-4-5-20250929)",
"searchPlaceholder": "Search models...",
"noResults": "No models match your search",
"discoveryNotAvailable": "Model discovery not available. Enter model name manually."
@@ -104,10 +104,10 @@
"haikuLabel": "Modèle Haiku (optionnel)",
"sonnetLabel": "Modèle Sonnet (optionnel)",
"opusLabel": "Modèle Opus (optionnel)",
"defaultPlaceholder": "ex. : claude-3-5-sonnet-20241022",
"haikuPlaceholder": "ex. : claude-3-5-haiku-20241022",
"sonnetPlaceholder": "ex. : claude-3-5-sonnet-20241022",
"opusPlaceholder": "ex. : claude-3-5-opus-20241022"
"defaultPlaceholder": "ex. : claude-sonnet-4-5-20250929",
"haikuPlaceholder": "ex. : claude-haiku-4-5-20251001",
"sonnetPlaceholder": "ex. : claude-sonnet-4-5-20250929",
"opusPlaceholder": "ex. : claude-opus-4-5-20251101"
},
"empty": {
"title": "Aucun profil API configuré",
@@ -167,7 +167,7 @@
},
"modelSelect": {
"placeholder": "Sélectionner un modèle ou saisir manuellement",
"placeholderManual": "Saisir le nom du modèle (ex. : claude-3-5-sonnet-20241022)",
"placeholderManual": "Saisir le nom du modèle (ex. : claude-sonnet-4-5-20250929)",
"searchPlaceholder": "Rechercher des modèles...",
"noResults": "Aucun modèle ne correspond à votre recherche",
"discoveryNotAvailable": "Découverte de modèles indisponible. Saisissez le nom du modèle manuellement."
+1 -1
View File
@@ -72,7 +72,7 @@ export interface TestConnectionResult {
* Model information from /v1/models endpoint
*/
export interface ModelInfo {
id: string; // Model ID (e.g., "claude-sonnet-4-20250514")
id: string; // Model ID (e.g., "claude-sonnet-4-5-20250929")
display_name: string; // Human-readable name (e.g., "Claude Sonnet 4")
}
+1 -1
View File
@@ -214,7 +214,7 @@ export interface GraphitiProviderConfig {
// OpenRouter (multi-provider aggregator)
openrouterApiKey?: string;
openrouterBaseUrl?: string; // Default: https://openrouter.ai/api/v1
openrouterLlmModel?: string; // LLM model selection (e.g., 'anthropic/claude-3.5-sonnet')
openrouterLlmModel?: string; // LLM model selection (e.g., 'anthropic/claude-sonnet-4')
openrouterEmbeddingModel?: string;
// Ollama Embeddings (local, no API key required)
+3
View File
@@ -13,6 +13,9 @@ pytest-mock>=3.0.0
# For testing async code
anyio>=4.0.0
# For testing validation models (required by backend code)
pydantic>=2.0.0
# Code coverage
coverage>=7.0.0
+1 -1
View File
@@ -55,7 +55,7 @@ def mock_github_config():
return GitHubRunnerConfig(
repo="test-owner/test-repo",
token="ghp_test_token_12345",
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
thinking_level="medium",
)
+2 -2
View File
@@ -204,10 +204,10 @@ class TestSpecOrchestratorInit:
orchestrator = SpecOrchestrator(
project_dir=temp_dir,
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
)
assert orchestrator.model == "claude-sonnet-4-20250514"
assert orchestrator.model == "claude-sonnet-4-5-20250929"
class TestCreateSpecDir: