118 Commits

Author SHA1 Message Date
leex279
b4b534b544 Add comprehensive API response validation in discoverModels
Enhanced validation to catch malformed responses early:
- Validate total_count is non-negative number
- Verify total_count matches embedding_models.length
- Validate first model has required fields (id, provider, dimensions)
- Check dimensions are positive numbers
- Validate provider names are from expected set
- Provide specific error messages for each validation failure

Prevents caching invalid data and provides better debugging information.

Addresses CodeRabbit nitpick comment on PR #852

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 00:06:43 +01:00
leex279
7f10527a3d Add robust cache validation with type guards in openrouterService
Implemented comprehensive validation to prevent crashes from corrupted cache:
- Created isCacheEntry() type guard to validate cache structure
- Parse JSON into unknown type (TypeScript strict mode compliant)
- Validate timestamp is number and data has OpenRouterModelListResponse shape
- Validate each model has all required fields with correct types
- Remove corrupted cache entries to avoid repeated failures
- No 'any' types used, full strict mode compliance

Prevents crashes from malformed cache data while maintaining type safety.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 00:03:43 +01:00
leex279
4d2851cb2f Address CodeRabbit review: Improve openrouterService robustness
1. Lazy initialization of baseUrl via getBaseUrl() method
   - Allows API URL to be updated at runtime without stale URL issues

2. Runtime validation of API response structure
   - Validates embedding_models array exists before caching
   - Prevents invalid responses from being cached

Addresses CodeRabbit nitpick comments on PR #852

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:38:01 +01:00
leex279
f32f0c36dd Fix embedding provider grid to fit all providers in one line
Changed grid-cols-3 to grid-cols-4 for embedding provider selection
so all 4 embedding-capable providers (OpenAI, Google, OpenRouter, Ollama)
fit on one line, matching the chat provider layout.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:28:30 +01:00
leex279
44bbcfcafb Add OpenRouter embeddings support
Implements OpenRouter as an embedding provider option, enabling access to multiple
embedding models (OpenAI, Google Gemini, Qwen3, Mistral) through a single API key.

Backend changes:
- Add validate_openrouter_api_key() for API key validation (sk-or-v1- format)
- Add OpenRouterErrorAdapter for error sanitization
- Add openrouter to valid providers in llm_provider_service
- Create openrouter_discovery_service with hardcoded model list
- Create /api/openrouter/models endpoint for model discovery
- Register OpenRouter router in FastAPI main app

Frontend changes:
- Create openrouterService.ts for model discovery API client
- Add OpenRouter to RAGSettings.tsx provider options
- Configure default models with provider prefix (openai/text-embedding-3-small)
- Add OpenRouter to embedding-capable providers list

Documentation:
- Update .env.example with OPENROUTER_API_KEY documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:06:31 +01:00
sean-eskerium
068018a6a3 Update work order table to show branch name, and the commit operations count bug that is showing commits of the whole main branch vs. the work order changes. 2025-10-31 22:42:00 -04:00
sean-eskerium
a292ce2dfb Code review updates and moving the prp-review step to before the Commit. 2025-10-31 22:21:40 -04:00
sean-eskerium
ea88d754d4 code review cleanup 2025-10-31 10:32:14 -04:00
sean-eskerium
7eabeebe5f Updates to UI consistency, and after the event is completed, a message to view the details since the execution history was completed, since the full logs don't persist. 2025-10-26 09:35:47 -04:00
sean-eskerium
54a17c07d6 Implement State Management with Zustand, SSE, and remove polling. 2025-10-25 23:12:09 -04:00
sean-eskerium
28aa3ac76d Refactor the UI is working, work in progress. Zustand next to work better with SSE. 2025-10-25 21:50:12 -04:00
sean-eskerium
4025f88ee9 Updates to get Docker working and adding Claude OAUTH token variable, and finish of the style guide mockup. 2025-10-25 16:29:53 -04:00
sean-eskerium
95791456cd Merge remote-tracking branch 'origin/feat/agent_work_orders' into ui/agent-work-order 2025-10-25 14:32:33 -04:00
sean-eskerium
68afb2c584 Updates to style guid awo 2025-10-25 14:31:52 -04:00
sean-eskerium
62868705ca Layout changes, before bringing in the awo branch 2025-10-25 14:23:47 -04:00
Rasmus Widing
acf1fcc21d feat: add real-time logs and stats for agent work orders
- Add WorkOrderLogsPanel with SSE streaming support
- Add RealTimeStats component for live metrics
- Add useWorkOrderLogs hook for SSE log streaming
- Add useLogStats hook for real-time statistics
- Update WorkOrderDetailView to display logs panel
- Add comprehensive tests for new components
- Configure Vite test environment
2025-10-24 00:54:50 +03:00
sean-eskerium
5b98adc1e4 Fixes after running UI consistency 2025-10-23 09:38:21 -04:00
sean-eskerium
ef8f725da7 UI for Agent Work Orders 2025-10-23 09:32:49 -04:00
Rasmus Widing
f07cefd1a1 feat: add agent work orders microservice with hybrid deployment 2025-10-23 12:46:57 +03:00
leex279
957d8b94fb fix: Update tests for requests.Session mock and cleanup URL validation
- Fix test mocks to use requests.Session for _check_url_exists
- Add url parameter to create_mock_response to prevent MagicMock issues
- Update all test scenarios to mock both requests.get and session.get
- Remove redundant UNSAFE_PROTOCOLS check in URL validation
- Fix test assertions to match new priority order (llms.txt > llms-full.txt)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:43:12 +02:00
leex279
13796abbe8 feat: Improve discovery system with SSRF protection and optimize file detection
## Backend Improvements

### Discovery Service
- Fix SSRF protection: Use requests.Session() for max_redirects parameter
- Add comprehensive IP validation (_is_safe_ip, _resolve_and_validate_hostname)
- Add hostname DNS resolution validation before requests
- Fix llms.txt link following to crawl ALL same-domain pages (not just llms.txt files)
- Remove unused file variants: llms.md, llms.markdown, sitemap_index.xml, sitemap-index.xml
- Optimize DISCOVERY_PRIORITY based on real-world usage research
- Update priority: llms.txt > llms-full.txt > sitemap.xml > robots.txt

### URL Handler
- Fix .well-known path to be case-sensitive per RFC 8615
- Remove llms.md, llms.markdown, llms.mdx from variant detection
- Simplify link collection patterns to only .txt files (most common)
- Update llms_variants list to only include spec-compliant files

### Crawling Service
- Add tldextract for proper root domain extraction (handles .co.uk, .com.au, etc.)
- Replace naive domain extraction with robust get_root_domain() function
- Add tldextract>=5.0.0 to dependencies

## Frontend Improvements

### Type Safety
- Extend ActiveOperation type with discovery fields (discovered_file, discovered_file_type, linked_files)
- Remove all type casting (operation as any) from CrawlingProgress component
- Add proper TypeScript types for discovery information

### Security
- Create URL validation utility (urlValidation.ts)
- Only render clickable links for validated HTTP/HTTPS URLs
- Reject unsafe protocols (javascript:, data:, vbscript:, file:)
- Display invalid URLs as plain text instead of links

## Testing
- Update test mocks to include history and url attributes for redirect checking
- Fix .well-known case sensitivity tests (must be lowercase per RFC 8615)
- Update discovery priority tests to match new order
- Remove tests for deprecated file variants

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:31:08 +02:00
leex279
cdf4323534 feat: Implement llms.txt link following with discovery priority fix
Implements complete llms.txt link following functionality that crawls
linked llms.txt files on the same domain/subdomain, along with critical
bug fixes for discovery priority and variant detection.

Backend Core Functionality:
- Add _is_same_domain_or_subdomain method for subdomain matching
- Fix is_llms_variant to detect .txt files in /llms/ directories
- Implement llms.txt link extraction and following logic
- Add two-phase discovery: prioritize ALL llms.txt before sitemaps
- Enhanced progress reporting with discovery metadata

Critical Bug Fixes:
- Discovery priority: Fixed sitemap.xml being found before llms.txt
- is_llms_variant: Now matches /llms/guides.txt, /llms/swift.txt, etc.
- These were blocking bugs preventing link following from working

Frontend UI:
- Add discovery and linked files display to CrawlingProgress component
- Update progress types to include discoveredFile, linkedFiles fields
- Add new crawl types: llms_txt_with_linked_files, discovery_*
- Add "discovery" to ProgressStatus enum and active statuses

Testing:
- 8 subdomain matching unit tests (test_crawling_service_subdomain.py)
- 7 integration tests for link following (test_llms_txt_link_following.py)
- All 15 tests passing
- Validated against real Supabase llms.txt structure (1 main + 8 linked)

Files Modified:
Backend:
- crawling_service.py: Core link following logic (lines 744-788, 862-920)
- url_handler.py: Fixed variant detection (lines 633-665)
- discovery_service.py: Two-phase discovery (lines 137-214)
- 2 new comprehensive test files

Frontend:
- progress/types/progress.ts: Updated types with new fields
- progress/components/CrawlingProgress.tsx: Added UI sections

Real-world testing: Crawling supabase.com/docs now discovers
/docs/llms.txt and automatically follows 8 linked llms.txt files,
indexing complete documentation from all files.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 22:05:15 +02:00
Rasmus Widing
8f3e8bc220 fix: add trailing slashes to agent work orders endpoints
- add trailing slashes to prevent FastAPI mount() 307 redirects
- add defensive null check for repository_url in detail view
- fixes ERR_NAME_NOT_RESOLVED when browser follows redirect to archon-server
2025-10-17 09:53:53 +03:00
Rasmus Widing
edf3a51fa5 fix: resolve agent work orders api routing and defensive coding
- add trailing slashes to agent-work-orders endpoints to prevent FastAPI mount() redirects
- add defensive null check for repository_url in detail view
- fix backend routes to use relative paths with app.mount()
- resolves ERR_NAME_NOT_RESOLVED when accessing agent work orders
2025-10-17 09:52:58 +03:00
Developer
ef4262681f Code rabbit issues fix again 2025-10-10 21:54:04 -04:00
Developer
913f47ba62 code rabbit feedback 2025-10-10 18:40:25 -04:00
Developer
20c57acb00 Code rabbit feedback 2025-10-10 18:30:12 -04:00
Developer
8ff39fa1d5 Merge branch 'main' into refactor/projects-ui
Merged in PR #776 (refactor/knowledge-ui) from main.
No conflicts - different features.
2025-10-10 17:08:05 -04:00
sean-eskerium
e22c6c3836 fix code rabbit suggestions. 2025-10-10 14:42:01 -04:00
sean-eskerium
a860b27848 Refactor the UI and add Documents back. 2025-10-10 14:24:09 -04:00
sean-eskerium
691adccc12 Refactoring the UI for consistent styling 2025-10-10 03:36:35 -04:00
sean-eskerium
88cb8d7f03 Update archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-09 21:17:00 -04:00
sean-eskerium
f0030699a8 Update archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-09 21:15:14 -04:00
sean-eskerium
59f4568fda another round of code rabbit feedback 2025-10-09 21:05:12 -04:00
sean-eskerium
ad82f6e9f6 Another round of Coderabbit feedback. 2025-10-09 20:40:47 -04:00
sean-eskerium
c3f42504ea code rabbit updates 2025-10-09 20:19:51 -04:00
sean-eskerium
02533dc37c Fixing Code Rabbit suggestions. 2025-10-09 16:23:32 -04:00
sean-eskerium
daf915c083 Fixes from biome and consistency review. 2025-10-09 14:26:37 -04:00
sean-eskerium
4e6116fa2f Fix consistency and biome formatting issues 2025-10-09 13:49:12 -04:00
sean-eskerium
db538a5f46 Remove dead code 2025-10-09 12:14:36 -04:00
sean-eskerium
5c7924f43d Merge main into feature/ui-style-guide
- Resolved package-lock.json conflict
- Kept Tailwind 4.1.2 upgrade from feature branch
- Merged main's updates (react-icons, file reorganization, new features)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 11:53:27 -04:00
sean-eskerium
bebe4c1037 candidate for release 2025-10-09 11:49:03 -04:00
sean-eskerium
2e68403db0 update styles of the primitives. 2025-10-09 09:51:50 -04:00
sean-eskerium
80992ca975 Epgrade to Tailwind 4 2025-10-09 09:31:47 -04:00
sean-eskerium
70b6e70a95 trying to make the ui reviews programmatic 2025-10-09 07:59:54 -04:00
sean-eskerium
4cb7c46d6e fixing document browser and updating primitive tab styles. 2025-10-09 00:15:29 -04:00
sean-eskerium
17ca62ceb4 refining 2025-10-08 23:43:43 -04:00
sean-eskerium
5b839a1465 command for UI review, and settings to use primitives. 2025-10-08 18:38:12 -04:00
sean-eskerium
0727245c9d Udate the projects layout. And style guide. 2025-10-08 17:37:29 -04:00
sean-eskerium
6e86fd0d9b updates to style guide components 2025-10-08 13:50:04 -04:00