Skip to content

Star History Chart#410

Merged
coleam00 merged 1 commit intocoleam00:mainfrom
armand0e:feat/star-chart
Aug 21, 2025
Merged

Star History Chart#410
coleam00 merged 1 commit intocoleam00:mainfrom
armand0e:feat/star-chart

Conversation

@armand0e
Copy link
Copy Markdown

@armand0e armand0e commented Aug 21, 2025

Pull Request

Summary

added this a chart showing the repository's star history (at the end of the README, above the License disclosure)

Changes Made

README.md (+8 Lines):

## 📈 Progress

<p align="center">
  <a href="https://star-history.com/#coleam00/Archon&Date">
    <img src="https://api.star-history.com/svg?repos=coleam00/Archon&type=Date" width="500" alt="Star History Chart">
  </a>
</p>

Summary by CodeRabbit

  • Documentation
    • Added a new “Progress” section to the README featuring a centered Star History chart for the Archon repository.
    • Embeds an inline SVG chart (500px width) with descriptive alt text and links to Star History for more details.
    • No functional or interface changes to the product; existing notes (including hot-reload) remain unchanged.

added star history at end of readme
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 21, 2025

Walkthrough

Added a "Progress" section to README.md that embeds a centered Star History chart for the repository via an inline SVG from the Star History API. No source code or public interfaces were changed.

Changes

Cohort / File(s) Summary of Changes
Documentation update
README.md
Added a "Progress" section with a centered Star History chart (inline SVG, type=Date, width=500, alt text set). No functional code changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nibble notes in README fields,
A chart of stars my carrot yields. ✨🥕
No code to tweak, no tests to run,
Just shining dots beneath the sun—
Hop hop, progress neatly sealed!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
README.md (2)

295-297: Make the chart responsive and theme-aware (dark/light).

Use a element with a dark-theme source and drop the fixed width so it scales on mobile. This mirrors Star History’s own README approach.

   <a href="https://star-history.com/#coleam00/Archon&Date">
-    <img src="https://api.star-history.com/svg?repos=coleam00/Archon&type=Date" width="500" alt="Star History Chart">
+    <picture>
+      <source
+        media="(prefers-color-scheme: dark)"
+        srcset="https://api.star-history.com/svg?repos=coleam00/Archon&type=Date&theme=dark"
+      />
+      <source
+        media="(prefers-color-scheme: light)"
+        srcset="https://api.star-history.com/svg?repos=coleam00/Archon&type=Date"
+      />
+      <img
+        alt="Star History Chart"
+        src="https://api.star-history.com/svg?repos=coleam00/Archon&type=Date"
+        style="max-width: 100%; height: auto;"
+      />
+    </picture>
   </a>

Reference for theme-aware embed. (github.com)


294-298: Reliability and privacy nits.

  • The external SVG occasionally experiences outages (e.g., Mar 28, 2025; restored Mar 29, 2025). Consider documenting a fallback (e.g., keep the link as-is but add a brief “Open chart” text below, or include a periodically updated static PNG in the repo).
  • Optionally add referrerpolicy="no-referrer" to the to reduce referrer leakage when GitHub allows it; if GitHub strips it, no harm.

Outage note for context. (star-history.com)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8b29d20 and a117dd0.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~292-~292: There might be a mistake here.
Context: ...g when you make changes. ## 📈 Progress

Star History Chart

## 📄 License Archon Community License (ACL...

(QB_NEW_EN)

🔇 Additional comments (1)
README.md (1)

292-299: Nice addition — the chart section reads well and matches the repo.

  • The embed URL uses the correct API and type parameter (type=Date) and the link pattern https://star-history.com/#owner/repo&Date is consistent with upstream examples.
    See: API embed example and parameters, and README examples from the Star History project. (star-history.com, github.com)

@coleam00
Copy link
Copy Markdown
Owner

Ah yeah I've been meaning to add this - thanks @armand0e!

@coleam00 coleam00 merged commit 16bde51 into coleam00:main Aug 21, 2025
1 check passed
djankies pushed a commit to djankies/Archon that referenced this pull request Aug 21, 2025
added star history at end of readme
mionemedia added a commit to mionemedia/Archon that referenced this pull request Jan 16, 2026
* Add Supabase key validation and simplify frontend state management

- Add backend validation to detect and warn about anon vs service keys
- Prevent startup with incorrect Supabase key configuration
- Consolidate frontend state management following KISS principles
- Remove duplicate state tracking and sessionStorage polling
- Add clear error display when backend fails to start
- Improve .env.example documentation with detailed key selection guide
- Add comprehensive test coverage for validation logic
- Remove unused test results checking to eliminate 404 errors

The implementation now warns users about key misconfiguration while
maintaining backward compatibility. Frontend state is simplified with
MainLayout as the single source of truth for backend status.

* Fix critical issues from code review

- Use python-jose (already in dependencies) instead of PyJWT for JWT decoding
- Make unknown Supabase key roles fail fast per alpha principles
- Skip all JWT validations (not just signature) when checking role
- Update tests to expect failure for unknown roles

Fixes:
- No need to add PyJWT dependency - python-jose provides JWT functionality
- Unknown key types now raise ConfigurationError instead of warning
- JWT decode properly skips all validations to only check role claim

* Remove unnecessary startup delay script from frontend Dockerfile

- Rolled back to match main branch Dockerfile
- Removed 3-second sleep script that was added for backend readiness
- Container now runs npm directly without intermediate script
- Tested and verified all services start correctly without the delay

* Fix document deletion persistence issue (#278)

- Fixed projectService methods to include project_id parameter in API calls
- Updated deleteDocument() to use correct endpoint: /api/projects/{projectId}/docs/{docId}
- Updated getDocument() and updateDocument() to use correct endpoints with project_id
- Modified DocsTab component to call backend API when deleting documents
- Documents now properly persist deletion after page refresh

The issue was that document deletion was only happening in UI state and never
reached the backend. The service methods were using incorrect API endpoints
that didn't include the required project_id parameter.

* Add comprehensive test coverage for document CRUD operations

- Add Document interface for type safety
- Fix error messages to include projectId context
- Add unit tests for all projectService document methods
- Add integration tests for DocsTab deletion flow
- Update vitest config to include new test files

* MCP server consolidation and simplification

- Consolidated multiple MCP modules into unified project_module
- Removed redundant project, task, document, and version modules
- Identified critical issue with async project creation losing context
- Updated CLAUDE.md with project instructions

This commit captures the current state before refactoring to split
consolidated tools into separate operations for better clarity and
to solve the async project creation context issue.

* Improve MCP tool usability and documentation

- Fix parameter naming confusion in RAG tools (source → source_domain)
- Add clarification that source_domain expects domain names not IDs
- Improve manage_versions documentation with clear examples
- Add better error messages for validation failures
- Enhance manage_document with non-PRP examples
- Add comprehensive documentation to get_project_features
- Fix content parameter type in manage_versions to accept Any type

These changes address usability issues discovered during testing without
breaking existing functionality.

* Refactor MCP server structure and add separate project tools

- Rename src/mcp to src/mcp_server for clarity
- Update all internal imports to use new path
- Create features/projects directory for modular tool organization
- Add separate, simple project tools (create, list, get, delete, update)
- Keep consolidated tools for backward compatibility (via env var)
- Add USE_SEPARATE_PROJECT_TOOLS env var to toggle between approaches

The new separate tools:
- Solve the async project creation context loss issue
- Provide clearer, single-purpose interfaces
- Remove complex PRP examples for simplicity
- Handle project creation polling automatically

* Update bug_report.yml

Changing Archon Alpha to Beta in the issue template

* Update README.md

Added note in the README

* Fix project cards horizontal scrollbar visibility (#295)

Addresses issue #293 by replacing hide-scrollbar with scrollbar-thin
class to ensure users can see and interact with the horizontal scrollbar
when project cards overflow.

* Fix missing feature field in project tasks API response

Resolves issue #282 by adding feature field to task dictionary in
TaskService.list_tasks() method. The project tasks API endpoint was
excluding the feature field while individual task API included it,
causing frontend to default to 'General' instead of showing custom
feature values.

Changes:
- Add feature field to task response in list_tasks method
- Maintains compatibility with existing API consumers
- All 212 tests pass with this change

* Remove consolidated project module in favor of separated tools

The consolidated project module contained all project, task, document,
version, and feature management in a single 922-line file. This has been
replaced with focused, single-purpose tools in separate modules.

* Remove feature flags from Docker configuration

Removed USE_SEPARATE_PROJECT_AND_TASK_TOOLS and PROJECTS_ENABLED
environment variables as the separated tools are now the default.

* Add document and version management tools

Extract document management functionality into focused tools:
- create_document: Create new documents with metadata
- list_documents: List all documents in a project
- get_document: Retrieve specific document details
- update_document: Modify existing documents
- delete_document: Remove documents from projects

Extract version control functionality:
- create_version: Create immutable snapshots
- list_versions: View version history
- get_version: Retrieve specific version content
- restore_version: Rollback to previous versions

Includes improved documentation and error messages based on testing.

* Add task management tools with smart routing

Extract task functionality into focused tools:
- create_task: Create tasks with sources and code examples
- list_tasks: List tasks with project/status filtering
- get_task: Retrieve task details
- update_task: Modify task properties
- delete_task: Archive tasks (soft delete)

Preserves intelligent endpoint routing:
- Project-specific: /api/projects/{id}/tasks
- Status filtering: /api/tasks?status=X
- Assignee filtering: /api/tasks?assignee=X

* Add feature management tool for project capabilities

Extract get_project_features as a standalone tool with enhanced
documentation explaining feature structures and usage patterns.
Features track functional components like auth, api, and database.

* Update project tools to use simplified approach

Remove complex PRP validation logic and focus on core functionality.
Maintains backward compatibility with existing API endpoints.

* Register all separated tools in MCP server

Update MCP server to use the new modular tool structure:
- Projects and tasks from existing modules
- Documents and versions from new modules
- Feature management from standalone module

Remove all feature flag logic as separated tools are now default.

* Update MCP Dockerfile to support new module structure

Create documents directory and ensure all new modules are properly
included in the container build.

* Clean up unused imports in RAG module

Remove import of deleted project_module.

* Fix type errors and remove trailing whitespace

- Add explicit type annotations for params dictionaries to resolve mypy errors
- Remove trailing whitespace from blank lines (W293 ruff warnings)
- Ensure type safety in task_tools.py and document_tools.py

* Add comprehensive unit tests for MCP server features

- Create test structure mirroring features folder organization
- Add tests for document tools (create, list, update, delete)
- Add tests for version tools (create, list, restore, invalid field handling)
- Add tests for task tools (create with sources, list with filters, update, delete)
- Add tests for project tools (create with polling, list, get)
- Add tests for feature tools (get features with various structures)
- Mock HTTP client for all external API calls
- Test both success and error scenarios
- 100% test coverage for critical tool functions

* Updating the Logo for Archon

* Add Stage 1 workflow for external PR info collection

- Collects PR information without requiring secrets
- Triggers on pull_request events and @claude-review-ext comments
- Uploads PR details as artifact for secure processing

* Add Stage 2 secure review workflow for external PRs

- Runs after Stage 1 via workflow_run trigger
- Has access to repository secrets
- Downloads PR artifact and performs review
- Maintains security by never checking out fork code

* Add documentation for external PR review workflows

- Explains the two-stage security model
- Provides usage instructions for contributors and maintainers
- Includes troubleshooting and security considerations

* Fix base branch checkout in Stage 2 workflow

- Extract PR base branch from artifact instead of using workflow branch
- Add step to switch to correct base branch after downloading PR info
- Use PR base branch for diff generation instead of workflow branch

* Fix external PR workflow permissions and error handling

- Grant pull-requests write permission for comment posting
- Add try-catch error handling with continue-on-error
- Ensure workflow continues even if comment posting fails

* Simplify authorization for external PR workflows

- Move authorization check to Stage 1 job condition
- Remove complex authorization job from Stage 2
- Fix duplicate exec declaration error
- Add unauthorized user message handling in Stage 1
- Trust Stage 1's authorization in Stage 2

* Fix exec declaration error in Stage 2 workflow

- Replace async exec with execSync to avoid declaration issues
- Add proper error handling for artifact extraction
- Use childProcess module directly instead of destructuring

* Fix Claude Code Action authentication and context issues

- Remove invalid pr_number parameter
- Add explicit github_token to fix OIDC failure in workflow_run
- Add mode: review for proper review mode
- Create fake event.json to provide PR context
- Set environment variables to simulate PR event

* Remove invalid mode parameter and improve event context

- Remove invalid mode: review parameter
- Update event context to simulate issue_comment
- Add direct_prompt to guide Claude to review the diff
- Update instructions to use Read tool for pr-diff.patch

* Simplify fork PR review to single workflow with pull_request_target

- Remove complex two-stage workflow approach
- Use pull_request_target with security safeguards
- Add first-time contributor check and approval requirement
- Never checkout PR code - only analyze diff
- Mirror full review format from main claude-review workflow
- Manual trigger via @claude-review-fork for maintainers

* Fix Claude checkout issue for forked PRs

- Add environment overrides to prevent PR branch checkout
- Add explicit github_token for authentication
- Add direct_prompt to guide Claude to use diff file
- Override GITHUB_REF and GITHUB_SHA to stay on base branch

* Override event context to prevent PR checkout

- Set GITHUB_EVENT_NAME to workflow_dispatch to avoid PR detection
- Use override_prompt instead of direct_prompt for better control
- Create wrapper script for debugging
- Explicitly tell Claude not to checkout code

* fix: Restructure fork review workflow to avoid PR branch checkout

- Create isolated review context directory to prevent PR detection
- Move diff to changes.patch file in review-context directory
- Add explicit REVIEW_INSTRUCTIONS.md file for guidance
- Use standard 'prompt' parameter instead of 'override_prompt'
- This approach should prevent Claude Action from auto-detecting PR context

* Remove claude-review-fork.yml workflow

The Claude Code Action is not compatible with reviewing PRs from forks.
It always attempts to checkout the PR branch which fails for security reasons.

* Fix: Allow HTTP for local Supabase connections (#323)

- Modified validate_supabase_url() to allow HTTP for local development
- HTTP is now allowed for localhost, 127.0.0.1, host.docker.internal, and 0.0.0.0
- HTTPS is still required for production/non-local environments
- Fixes server startup failure when using local Supabase with Docker

* Update README.md (#332)

Makes it easier to copy paste & run the command in on single shot

* feat(mcp): Add robust error handling and timeout configuration

Critical improvements to MCP server reliability and client experience:

Error Handling:
- Created MCPErrorFormatter for consistent error responses across all tools
- Provides structured errors with type, message, details, and actionable suggestions
- Helps clients (like Claude Code) understand and handle failures gracefully
- Categorizes errors (connection_timeout, validation_error, etc.) for better debugging

Timeout Configuration:
- Centralized timeout config with environment variable support
- Different timeouts for regular operations vs polling operations
- Configurable via MCP_REQUEST_TIMEOUT, MCP_CONNECT_TIMEOUT, etc.
- Prevents indefinite hangs when services are unavailable

Module Registration:
- Distinguishes between ImportError (acceptable) and code errors (must fix)
- SyntaxError/NameError/AttributeError now halt execution immediately
- Prevents broken code from silently failing in production

Polling Safety:
- Fixed project creation polling with exponential backoff
- Handles API unavailability with proper error messages
- Maximum attempts configurable via MCP_MAX_POLLING_ATTEMPTS

Response Normalization:
- Fixed inconsistent response handling in list_tasks
- Validates and normalizes different API response formats
- Clear error messages when response format is unexpected

These changes address critical issues from PR review while maintaining
backward compatibility. All 20 existing tests pass.

* refactor(mcp): Apply consistent error handling to all MCP tools

Comprehensive update to MCP server error handling:

Error Handling Improvements:
- Applied MCPErrorFormatter to all remaining MCP tool files
- Replaced all hardcoded timeout values with configurable timeout system
- Converted all simple string errors to structured error format
- Added proper httpx exception handling with detailed context

Tools Updated:
- document_tools.py: All 5 document management tools
- version_tools.py: All 4 version management tools
- feature_tools.py: Project features tool
- project_tools.py: Remaining 3 project tools (get, list, delete)
- task_tools.py: Remaining 4 task tools (get, list, update, delete)

Test Improvements:
- Removed backward compatibility checks from all tests
- Tests now enforce structured error format (dict not string)
- Any string error response is now considered a bug
- All 20 tests passing with new strict validation

This completes the error handling refactor for all MCP tools,
ensuring consistent client experience and better debugging.

* fix(mcp): Address all priority actions from PR review

Based on latest PR #306 review feedback:

Fixed Issues:
- Replaced last remaining basic error handling with MCPErrorFormatter
  in version_tools.py get_version function
- Added proper error handling for invalid env vars in get_max_polling_attempts
- Improved type hints with TaskUpdateFields TypedDict for better validation
- All tools now consistently use get_default_timeout() (verified with grep)

Test Improvements:
- Added comprehensive tests for MCPErrorFormatter utility (10 tests)
- Added tests for timeout_config utility (13 tests)
- All 43 MCP tests passing with new utilities
- Tests verify structured error format and timeout configuration

Type Safety:
- Created TaskUpdateFields TypedDict to specify exact allowed fields
- Documents valid statuses and assignees in type comments
- Improves IDE support and catches type errors at development time

This completes all priority actions from the review:
✅ Fixed inconsistent timeout usage (was already done)
✅ Fixed error handling inconsistency
✅ Improved type hints for update_fields
✅ Added tests for utility modules

* style: Apply linting fixes and formatting

Applied automated linting and formatting:
- Fixed missing newlines at end of files
- Adjusted line wrapping for better readability
- Fixed multi-line string formatting in tests
- No functional changes, only style improvements

All 43 tests still passing after formatting changes.

* Update docker-compose.yml

Adding host.docker.internal:host-gateway to Docker Compose for the server and agents.

* Update README.md (#410)

added star history at end of readme

* Important updates to CONTRIBUTING.md and README

* fix: Allow HTTP for all private network ranges in Supabase URLs (#417)

* fix: Allow HTTP for all private network ranges in Supabase URLs

- Extend HTTP support to all RFC 1918 private IP ranges
- Class A: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
- Class B: 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
- Class C: 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)
- Also includes link-local (169.254.0.0/16) addresses
- Uses Python's ipaddress module for robust IP validation
- Maintains HTTPS requirement for public/production URLs
- Backwards compatible with existing localhost exceptions

* security: Fix URL validation vulnerabilities

- Replace substring matching with exact hostname matching to prevent bypass attacks
- Exclude unspecified address (0.0.0.0) from allowed HTTP hosts
- Add support for .localhost domains per RFC 6761
- Improve error messages with hostname context for better debugging

Addresses security concerns raised in PR review regarding:
- Malicious domains like 'localhost.attacker.com' bypassing HTTPS requirements
- Unspecified address being incorrectly allowed as valid connection target

---------

Co-authored-by: tazmon95 <tazmon95@users.noreply.github.com>
Co-authored-by: root <root@supatest2.jtpa.net>

* Fix business document categorization bug

- Fixed missing knowledge_type and tags parameters in DocumentStorageService.upload_document()
- Added source_type='file' to document chunk metadata for proper categorization
- Enhanced source metadata creation to include source_type based on source_id pattern
- Fixed metadata spread order in knowledge_item_service to prevent source_type override
- Business documents now correctly show pink color theme and appear in Business Documents section

Fixes issue where business documents were incorrectly stored as technical knowledge
and appeared with blue color theme instead of pink.

* feat: Add Gemini CLI support to MCPPage and IDEGlobalRules

* fix(mcp): Fix update_task signature and MCP instructions

Resolves #420 - Tasks being duplicated instead of updated

Changes:
1. Fixed update_task function signature to use individual optional parameters
   - Changed from TypedDict to explicit parameters (title, status, etc.)
   - Consistent with update_project and update_document patterns
   - Builds update_fields dict internally from provided parameters

2. Updated MCP instructions with correct function names
   - Replaced non-existent manage_task with actual functions
   - Added complete function signatures for all tools
   - Improved workflow documentation with concrete examples

This fixes the issue where AI agents were confused by:
- Wrong function names in instructions (manage_task vs update_task)
- Inconsistent parameter patterns across update functions
- TypedDict magic that wasn't clearly documented

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

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

* test(mcp): Update tests for new update_task signature

- Fixed test_update_task_status to use individual parameters
- Added test_update_task_no_fields for validation testing
- All MCP tests passing (44 tests)

* style(mcp): Clean up whitespace in MCP instructions

- Remove trailing whitespace
- Consistent formatting in instruction text

* Fix crawler timeout for JavaScript-heavy documentation sites

Remove wait_for='body' selector from documentation site crawling config.
The body element exists immediately in HTML, causing unnecessary timeouts
for JavaScript-rendered content. Now relies on domcontentloaded event
and delay_before_return_html for proper JavaScript execution.

* chore: Remove unused imports and fix exception chaining

- Remove unused asyncio imports from batch.py and recursive.py
- Add proper exception chaining with 'from e' to preserve stack traces

* fix: Apply URL transformation before crawling in recursive strategy

- Transform URLs to raw content (e.g., GitHub blob -> raw) before sending to crawler
- Maintain mapping dictionary to preserve original URLs in results
- Align progress callback signatures between batch and recursive strategies
- Add safety guards for missing links attribute
- Remove unused loop counter in batch strategy
- Optimize binary file checks to avoid duplicate calls

This ensures GitHub files are crawled as raw content instead of HTML pages,
fixing the issue where content extraction was degraded due to HTML wrapping.

* Improve development environment with Docker Compose profiles (#435)

* Add improved development environment with backend in Docker and frontend locally

- Created dev.bat script to run backend services in Docker and frontend locally
- Added docker-compose.backend.yml for backend-only Docker setup
- Updated package.json to run frontend on port 3737
- Fixed api.ts to use default port 8181 instead of throwing error
- Script automatically stops production containers to avoid port conflicts
- Provides instant HMR for frontend development

* Refactor development environment setup: replace dev.bat with Makefile for cross-platform support and enhanced commands

* Enhance development environment: add environment variable checks and update test commands for frontend and backend

* Improve development environment with Docker Compose profiles

This commit enhances the development workflow by replacing the separate
docker-compose.backend.yml file with Docker Compose profiles, fixing
critical service discovery issues, and adding comprehensive developer
tooling through an improved Makefile system.

Key improvements:
- Replace docker-compose.backend.yml with cleaner profile approach
- Fix service discovery by maintaining consistent container names
- Fix port mappings (3737:3737 instead of 3737:5173)
- Add make doctor for environment validation
- Fix port configuration and frontend HMR
- Improve error handling with .SHELLFLAGS in Makefile
- Add comprehensive port configuration via environment variables
- Simplify make dev-local to only run essential services
- Add logging directory creation for local development
- Document profile strategy in docker-compose.yml

These changes provide three flexible development modes:
- Hybrid mode (default): Backend in Docker, frontend local with HMR
- Docker mode: Everything in Docker for production-like testing
- Local mode: API server and UI run locally

Co-authored-by: Zak Stam <zaksnet@users.noreply.github.com>

* Fix make stop command to properly handle Docker Compose profiles

The stop command now explicitly specifies all profiles to ensure
all containers are stopped regardless of how they were started.

* Fix README to document correct make commands

- Changed 'make lint' to 'make lint-frontend' and 'make lint-backend'
- Removed non-existent 'make logs-server' command
- Added 'make watch-mcp' and 'make watch-agents' commands
- All documented make commands now match what's available in Makefile

* fix: Address critical issues from code review #435

- Create robust environment validation script (check-env.js) that properly parses .env files
- Fix Docker healthcheck port mismatch (5173 -> 3737)
- Remove hard-coded port flags from package.json to allow environment configuration
- Fix Docker detection logic using /.dockerenv instead of HOSTNAME
- Normalize container names to lowercase (archon-server, archon-mcp, etc.)
- Improve stop-local command with port-based fallback for process killing
- Fix API configuration fallback chain to include VITE_PORT
- Fix Makefile shell variable expansion using runtime evaluation
- Update .PHONY targets with comprehensive list
- Add --profile flags to Docker Compose commands in README
- Add VITE_ARCHON_SERVER_PORT to docker-compose.yml
- Add Node.js 18+ to prerequisites
- Use dynamic ports in Makefile help messages
- Add lint alias combining frontend and backend linting
- Update .env.example documentation
- Scope .gitignore logs entry to /logs/

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

* Fix container name resolution for MCP server

- Add dynamic container name resolution with three-tier strategy
- Support environment variables for custom container names
- Add service discovery labels to docker-compose services
- Update BackendStartupError with correct container name references

* Fix frontend test failures in API configuration tests

- Update environment variable names to use VITE_ prefix that matches production code
- Fix MCP client service tests to use singleton instance export
- Update default behavior tests to expect fallback to port 8181
- All 77 frontend tests now pass

* Fix make stop-local to avoid Docker daemon interference

Replace aggressive kill -9 with targeted process termination:
- Filter processes by command name (node/vite/python/uvicorn) before killing
- Use graceful SIGTERM instead of SIGKILL
- Add process verification to avoid killing Docker-related processes
- Improve logging with descriptive step messages

* refactor: Simplify development workflow based on comprehensive review

- Reduced Makefile from 344 lines (43 targets) to 83 lines (8 essential targets)
- Removed unnecessary environment variables (*_CONTAINER_NAME variables)
- Fixed Windows compatibility by removing Unix-specific commands
- Added security fixes to check-env.js (path validation)
- Simplified MCP container discovery to use fixed container names
- Fixed 'make stop' to properly handle Docker Compose profiles
- Updated documentation to reflect simplified workflow
- Restored original .env.example with comprehensive Supabase key documentation

This addresses all critical issues from code review:
- Cross-platform compatibility ✅
- Security vulnerabilities fixed ✅
- 81% reduction in complexity ✅
- Maintains all essential functionality ✅

All tests pass: Frontend (77/77), Backend (267/267)

* feat: Add granular test and lint commands to Makefile

- Split test command into test-fe and test-be for targeted testing
- Split lint command into lint-fe and lint-be for targeted linting
- Keep original test and lint commands that run both
- Update help text with new commands for better developer experience

* feat: Improve Docker Compose detection and prefer modern syntax

- Prefer 'docker compose' (plugin) over 'docker-compose' (standalone)
- Add better error handling in Makefile with proper exit on failures
- Add Node.js check before running environment scripts
- Pass environment variables correctly to frontend in hybrid mode
- Update all documentation to use modern 'docker compose' syntax
- Auto-detect which Docker Compose version is available

* docs: Update CONTRIBUTING.md to reflect simplified development workflow

- Add Node.js 18+ as prerequisite for hybrid development
- Mark Make as optional throughout the documentation
- Update all docker-compose commands to modern 'docker compose' syntax
- Add Make command alternatives for testing (make test, test-fe, test-be)
- Document make dev for hybrid development mode
- Remove linting requirements until codebase errors are resolved

* fix: Rename frontend service to archon-frontend for consistency

Aligns frontend service naming with other services (archon-server, archon-mcp, archon-agents) for better consistency in Docker image naming patterns.

---------

Co-authored-by: Zak Stam <zakscomputers@hotmail.com>
Co-authored-by: Zak Stam <zaksnet@users.noreply.github.com>

* fixed the creation and saving of docs in the project management area

* Fix logging error in threading service

Fixed TypeError when passing custom fields to Python logger by using the 'extra' parameter instead of direct keyword arguments. This resolves embedding creation failures during crawl operations.

* Apply linting fixes for better code formatting

- Added trailing commas for multi-line function calls
- Improved line breaks for better readability

* Complete logging fixes for all statements in threading service

Applied the extra parameter pattern to all remaining logging statements (11 more) to ensure consistency and prevent runtime errors when any code path is executed. This completes the fix for the entire file.

* Remove deprecated PRP testing scripts and dead code

- Removed python/src/server/testing/ folder containing deprecated test utilities
- These PRP viewer testing tools were used during initial development
- No longer needed as functionality has been integrated into main codebase
- No dependencies or references found in production code

* Remove original_archon folder from main branch

- Removed the original_archon/ directory containing the legacy Archon v1-v6 iterations
- This was the original AI agent builder system before the pivot to the current architecture
- The folder has been preserved in the 'preserve-original-archon' branch for historical reference
- Reduces repository size by ~5.2MB and removes confusion about which codebase is active

* Fix proxy when specifying PROD=true

* Add a test

* Parse before passing to vite

* PR Feedback

* Add titles to action buttons in DocumentCard, DraggableTaskCard, and TaskTableView components.

* feat(ui): add accessibility attributes to action buttons

Add type, aria-label, and aria-hidden attributes to action and icon buttons across task and document components to improve accessibility and assistive technology support.

* Fix Docker Compose default profile and error documentation

- Add 'default' profile to all services so 'docker compose up --build -d' works without --profile flag
- Update BackendStartupError.tsx to include '--profile full' in Docker command examples
- Update docker-compose.yml comments to document the new default behavior

This allows users to run either:
- docker compose up --build -d (uses default profile, starts all services)
- docker compose --profile full up --build -d (explicit profile, same result)
- docker compose --profile backend up --build -d (backend services only)

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

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

* Use generic YOUR_PROFILE placeholder instead of hardcoded 'full' profile

This allows users to choose their preferred profile (backend, full, etc.) rather than
assuming they always want the full profile for error recovery.

* Remove profiles from all services to enable default startup

- Remove profile restrictions from all services so they start with 'docker compose up'
- All services now run by default without requiring --profile flags
- Profile functionality removed - users now use default behavior only
- This enables the requested 'docker compose up --build -d' workflow

* Update error modal to use 'full' profile with helpful note

- Change from generic YOUR_PROFILE to specific 'full' profile
- Add note explaining users can replace 'full' if needed
- Maintains clarity while providing flexibility for different profiles

* Merge UX improvements from PR #443

- Update error modal to show default 'docker compose up --build -d' command
- Add better organized note structure with bullet points
- Include profile-specific fallback example for existing users
- Update README Quick Start to show default command first
- Maintain backward compatibility guidance for profile users

* Fix critical token consumption issue in list endpoints (#488)

- Add include_content parameter to ProjectService.list_projects()
- Add exclude_large_fields parameter to TaskService.list_tasks()
- Add include_content parameter to DocumentService.list_documents()
- Update all MCP tools to use lightweight responses by default
- Fix critical N+1 query problem in ProjectService (was making separate query per project)
- Add response size monitoring and logging for validation
- Add comprehensive unit and integration tests

Results:
- Projects endpoint: 99.3% token reduction (27,055 -> 194 tokens)
- Tasks endpoint: 98.2% token reduction (12,750 -> 226 tokens)
- Documents endpoint: Returns metadata with content_size instead of full content
- Maintains full backward compatibility with default parameters
- Single query optimization eliminates N+1 performance issue

* fix: include_archived flag now works correctly in task listing

- Add include_archived parameter to TaskService.list_tasks()
- Service now conditionally applies archived filter based on parameter
- Add 'archived' field to task DTO for client visibility
- Update API endpoints to pass include_archived down to service
- Remove redundant client-side filtering in API layer
- Fix type hints in integration tests (dict[str, Any] | None)
- Use pytest.skip() instead of return for proper test reporting

These fixes address the functional bug identified by CodeRabbit where
archived tasks couldn't be retrieved even when explicitly requested.

* feat: disable agents service by default using Docker profiles

- Add 'agents' profile to archon-agents service
- Remove archon-agents as dependency from archon-mcp service
- Service now only starts with --profile agents flag
- Prevents startup issues while agents service is under development
- All core functionality continues to work without agents

🤖 Generated with Claude Code

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

* fix: address PR review feedback for agents service disabling

- Fix misleading profile documentation at top of docker-compose.yml
- Add AGENTS_ENABLED flag for cleaner agent service handling
- Make AGENTS_SERVICE_URL configurable via environment variable
- Prevent noisy connection errors when agents service isn't running

This provides a cleaner way to disable the agents service and allows
the application to skip agent wiring when AGENTS_ENABLED=false.

🤖 Generated with Claude Code

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

* Add PRP story task template and reorganize PRP commands (#508)

* Reorganize PRP commands and add story task template

- Move PRP commands to dedicated subdirectories
- Add new agent definitions for codebase analysis and library research
- Create story task PRP template for user story implementation
- Rename prp-base.md to prp_base.md for consistency

* Update .claude/agents/library-researcher.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update .claude/commands/prp-claude-code/prp-story-task-create.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update .claude/commands/prp-claude-code/prp-story-task-create.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update PRPs/templates/prp_story_task.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update PRPs/templates/prp_story_task.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: resolve container startup race condition in agents service (#451) (#503)

* depends on and env var added

Update Vite configuration to enable allowed hosts

- Uncommented the allowedHosts configuration to allow for dynamic host settings based on environment variables.
- This change enhances flexibility for different deployment environments while maintaining the default localhost and specific domain access.

Needs testing to confirm proper functionality with various host configurations.

rm my domain

* Enhance Vite configuration with dynamic allowed hosts support

- Added VITE_ALLOWED_HOSTS environment variable to .env.example and docker-compose.yml for flexible host configuration.
- Updated Vite config to dynamically set allowed hosts, incorporating defaults and custom values from the environment variable.
- This change improves deployment flexibility while maintaining security by defaulting to localhost and specific domains.

Needs testing to confirm proper functionality with various host configurations.

* refactor: remove unnecessary dependency on archon-agents in docker-compose.yml

- Removed the dependency condition for archon-agents from the archon-mcp service to streamline the startup process.
- This change simplifies the service configuration and reduces potential startup issues related to agent service health checks.

Needs testing to ensure that the application functions correctly without the archon-agents dependency.

---------

Co-authored-by: Julian Gegenhuber <office@salzkammercode.at>

* Fix race condition in concurrent crawling with unique source IDs (#472)

* Fix race condition in concurrent crawling with unique source IDs

- Add unique hash-based source_id generation to prevent conflicts
- Separate source identification from display with three fields:
  - source_id: 16-char SHA256 hash for unique identification
  - source_url: Original URL for tracking
  - source_display_name: Human-friendly name for UI
- Add comprehensive test suite validating the fix
- Migrate existing data with backward compatibility

* Fix title generation to use source_display_name for better AI context

- Pass source_display_name to title generation function
- Use display name in AI prompt instead of hash-based source_id
- Results in more specific, meaningful titles for each source

* Skip AI title generation when display name is available

- Use source_display_name directly as title to avoid unnecessary AI calls
- More efficient and predictable than AI-generated titles
- Keep AI generation only as fallback for backward compatibility

* Fix critical issues from code review

- Add missing os import to prevent NameError crash
- Remove unused imports (pytest, Mock, patch, hashlib, urlparse, etc.)
- Fix GitHub API capitalization consistency
- Reuse existing DocumentStorageService instance
- Update test expectations to match corrected capitalization

Addresses CodeRabbit review feedback on PR #472

* Add safety improvements from code review

- Truncate display names to 100 chars when used as titles
- Document hash collision probability (negligible for <1M sources)

Simple, pragmatic fixes per KISS principle

* Fix code extraction to use hash-based source_ids and improve display names

- Fixed critical bug where code extraction was using old domain-based source_ids
- Updated code extraction service to accept source_id as parameter instead of extracting from URL
- Added special handling for llms.txt and sitemap.xml files in display names
- Added comprehensive tests for source_id handling in code extraction
- Removed unused urlparse import from code_extraction_service.py

This fixes the foreign key constraint errors that were preventing code examples
from being stored after the source_id architecture refactor.

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

* Fix critical variable shadowing and source_type determination issues

- Fixed variable shadowing in document_storage_operations.py where source_url parameter
  was being overwritten by document URLs, causing incorrect source_url in database
- Fixed source_type determination to use actual URLs instead of hash-based source_id
- Added comprehensive tests for source URL preservation
- Ensure source_type is correctly set to "file" for file uploads, "url" for web crawls

The variable shadowing bug was causing sitemap sources to have the wrong source_url
(last crawled page instead of sitemap URL). The source_type bug would mark all
sources as "url" even for file uploads due to hash-based IDs not starting with "file_".

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

* Fix URL canonicalization and document metrics calculation

- Implement proper URL canonicalization to prevent duplicate sources
  - Remove trailing slashes (except root)
  - Remove URL fragments
  - Remove tracking parameters (utm_*, gclid, fbclid, etc.)
  - Sort query parameters for consistency
  - Remove default ports (80 for HTTP, 443 for HTTPS)
  - Normalize scheme and domain to lowercase

- Fix avg_chunks_per_doc calculation to avoid division by zero
  - Track processed_docs count separately from total crawl_results
  - Handle all-empty document sets gracefully
  - Show processed/total in logs for better visibility

- Add comprehensive tests for both fixes
  - 10 test cases for URL canonicalization edge cases
  - 4 test cases for document metrics calculation

This prevents database constraint violations when crawling the same
content with URL variations and provides accurate metrics in logs.

* Fix synchronous extract_source_summary blocking async event loop

- Run extract_source_summary in thread pool using asyncio.to_thread
- Prevents blocking the async event loop during AI summary generation
- Preserves exact error handling and fallback behavior
- Variables (source_id, combined_content) properly passed to thread

Added comprehensive tests verifying:
- Function runs in thread without blocking
- Error handling works correctly with fallback
- Multiple sources can be processed
- Thread safety with variable passing

* Fix synchronous update_source_info blocking async event loop

- Run update_source_info in thread pool using asyncio.to_thread
- Prevents blocking the async event loop during database operations
- Preserves exact error handling and fallback behavior
- All kwargs properly passed to thread execution

Added comprehensive tests verifying:
- Function runs in thread without blocking
- Error handling triggers fallback correctly
- All kwargs are preserved when passed to thread
- Existing extract_source_summary tests still pass

* Fix race condition in source creation using upsert

- Replace INSERT with UPSERT for new sources to prevent PRIMARY KEY violations
- Handles concurrent crawls attempting to create the same source
- Maintains existing UPDATE behavior for sources that already exist

Added comprehensive tests verifying:
- Concurrent source creation doesn't fail
- Upsert is used for new sources (not insert)
- Update is still used for existing sources
- Async concurrent operations work correctly
- Race conditions with delays are handled

This prevents database constraint errors when multiple crawls target
the same URL simultaneously.

* Add migration detection UI components

Add MigrationBanner component with clear user instructions for database schema updates. Add useMigrationStatus hook for periodic health check monitoring with graceful error handling.

* Integrate migration banner into main app

Add migration status monitoring and banner display to App.tsx. Shows migration banner when database schema updates are required.

* Enhance backend startup error instructions

Add detailed Docker restart instructions and migration script guidance. Improves user experience when encountering startup failures.

* Add database schema caching to health endpoint

Implement smart caching for schema validation to prevent repeated database queries. Cache successful validations permanently and throttle failures to 30-second intervals. Replace debug prints with proper logging.

* Clean up knowledge API imports and logging

Remove duplicate import statements and redundant logging. Improves code clarity and reduces log noise.

* Remove unused instructions prop from MigrationBanner

Clean up component API by removing instructions prop that was accepted but never rendered. Simplifies the interface and eliminates dead code while keeping the functional hardcoded migration steps.

* Add schema_valid flag to migration_required health response

Add schema_valid: false flag to health endpoint response when database schema migration is required. Improves API consistency without changing existing behavior.

---------

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

* Hotfix - crawls hanging after embedding rate limiting

* Moving Dockerfiles to uv for package installation (#533)

* Moving Dockerfiles to uv for package installation

* Updating uv installation for CI

* Reduced the size of sentence-transformers by making it CPU only, including reranking by default now (#534)

* CI fails now when unit tests for backend fail (#536)

* CI fails now when unit tests for backend fail

* Fixing up a couple unit tests

* Documentation improvements for MCP and README (#540)

* Spacing updates for Make installation in README

* add PRPs/completed/ to gitignore

* add archon-coderabbit-helper slash command

* refactor: Remove Socket.IO and implement HTTP polling architecture (#514)

* refactor: Remove Socket.IO and consolidate task status naming

Major refactoring to simplify the architecture:

1. Socket.IO Removal:
   - Removed all Socket.IO dependencies and code (~4,256 lines)
   - Replaced with HTTP polling for real-time updates
   - Added new polling hooks (usePolling, useDatabaseMutation, etc.)
   - Removed socket services and handlers

2. Status Consolidation:
   - Removed UI/DB status mapping layer
   - Using database values directly (todo, doing, review, done)
   - Removed obsolete status types and mapping functions
   - Updated all components to use database status values

3. Simplified Architecture:
   - Cleaner separation between frontend and backend
   - Reduced complexity in state management
   - More maintainable codebase

🤖 Generated with Claude Code

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

* feat: Add loading states and error handling for UI operations

- Added loading overlay when dragging tasks between columns
- Added loading state when switching between projects
- Added proper error handling with toast notifications
- Removed remaining Socket.IO references
- Improved user feedback during async operations

* docs: Add comprehensive polling architecture documentation

Created developer guide explaining:
- Core polling components and hooks
- ETag caching implementation
- State management patterns
- Migration from Socket.IO
- Performance optimizations
- Developer guidelines and best practices

* fix: Correct method name for fetching tasks

- Fixed projectService.getTasks() to projectService.getTasksByProject()
- Ensures consistent naming throughout the codebase
- Resolves error when refreshing tasks after drag operations

* docs: Add comprehensive API naming conventions guide

Created naming standards documentation covering:
- Service method naming patterns
- API endpoint conventions
- Component and hook naming
- State variable naming
- Type definitions
- Common patterns and anti-patterns
- Migration notes from Socket.IO

* docs: Update CLAUDE.md with polling architecture and naming conventions

- Replaced Socket.IO references with HTTP polling architecture
- Added polling intervals and ETag caching documentation
- Added API naming conventions section
- Corrected task endpoint patterns (use getTasksByProject, not getTasks)
- Added state naming patterns and status values

* refactor: Remove Socket.IO and implement HTTP polling architecture

Complete removal of Socket.IO/WebSocket dependencies in favor of simple HTTP polling:

Frontend changes:
- Remove all WebSocket/Socket.IO references from KnowledgeBasePage
- Implement useCrawlProgressPolling hook for progress tracking
- Fix polling hook to prevent ERR_INSUFFICIENT_RESOURCES errors
- Add proper cleanup and state management for completed crawls
- Persist and restore active crawl progress across page refreshes
- Fix agent chat service to handle disabled agents gracefully

Backend changes:
- Remove python-socketio from requirements
- Convert ProgressTracker to in-memory state management
- Add /api/crawl-progress/{id} endpoint for polling
- Initialize ProgressTracker immediately when operations start
- Remove all Socket.IO event handlers and cleanup commented code
- Simplify agent_chat_api to basic REST endpoints

Bug fixes:
- Fix race condition where progress data wasn't available for polling
- Fix memory leaks from recreating polling callbacks
- Fix crawl progress URL mismatch between frontend and backend
- Add proper error filtering for expected 404s during initialization
- Stop polling when crawl operations complete

This change simplifies the architecture significantly and makes it more robust
by removing the complexity of WebSocket connections.

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

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

* Fix data consistency issue in crawl completion

- Modify add_documents_to_supabase to return actual chunks stored count
- Update crawl orchestration to validate chunks were actually saved to database
- Throw exception when chunks are processed but none stored (e.g., API key failures)
- Ensure UI shows error state instead of false success when storage fails
- Add proper error field to progress updates for frontend display

This prevents misleading "crawl completed" status when backend fails to store data.

* Consolidate API key access to unified LLM provider service pattern

- Fix credential service to properly store encrypted OpenAI API key from environment
- Remove direct environment variable access pattern from source management service
- Update both extract_source_summary and generate_source_title_and_metadata to async
- Convert all LLM operations to use get_llm_client() for multi-provider support
- Fix callers in document_storage_operations.py and storage_services.py to use await
- Improve title generation prompt with better context and examples for user-readable titles
- Consolidate on single pattern that supports OpenAI, Google, Ollama providers

This fixes embedding service failures while maintaining compatibility for future providers.

* Fix async/await consistency in source management services

- Make update_source_info async and await it properly
- Fix generate_source_title_and_metadata async calls
- Improve source title generation with URL-based detection
- Remove unnecessary threading wrapper for async operations

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

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

* fix: correct API response handling in MCP project polling

- Fix polling logic to properly extract projects array from API response
- The API returns {projects: [...]} but polling was trying to iterate directly over response
- This caused 'str' object has no attribute 'get' errors during project creation
- Update both create_project polling and list_projects response handling
- Verified all MCP tools now work correctly including create_project

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

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

* fix: Optimize project switching performance and eliminate task jumping

- Replace race condition-prone polling refetch with direct API calls for immediate task loading (100-200ms vs 1.5-2s)
- Add polling suppression during direct API calls to prevent task jumping from double setTasks() calls
- Clear stale tasks immediately on project switch to prevent wrong data visibility
- Maintain polling for background updates from agents/MCP while optimizing user-initiated actions

Performance improvements:
- Project switches now load tasks in 100-200ms instead of 1.5-2 seconds
- Eliminated visual task jumping during project transitions
- Clean separation: direct calls for user actions, polling for external updates

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

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

* fix: Remove race condition anti-pattern and complete Socket.IO removal

Critical fixes addressing code review findings:

**Race Condition Resolution:**
- Remove fragile isLoadingDirectly flag that could permanently disable polling
- Remove competing polling onSuccess callback that caused task jumping
- Clean separation: direct API calls for user actions, polling for external updates only

**Socket.IO Removal:**
- Replace projectCreationProgressService with useProgressPolling HTTP polling
- Remove all Socket.IO dependencies and references
- Complete migration to HTTP-only architecture

**Performance Optimization:**
- Add ETag support to /projects/{project_id}/tasks endpoint for 70% bandwidth savings
- Remove competing TasksTab onRefresh system that caused multiple API calls
- Single source of truth: polling handles background updates, direct calls for immediate feedback

**Task Management Simplification:**
- Remove onRefresh calls from all TasksTab operations (create, update, delete, move)
- Operations now use optimistic updates with polling fallback
- Eliminates 3-way race condition between polling, direct calls, and onRefresh

Result: Fast project switching (100-200ms), no task jumping, clean polling architecture

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

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

* Remove remaining Socket.IO and WebSocket references

- Remove WebSocket URL configuration from api.ts
- Clean up WebSocket tests and mocks from test files
- Remove websocket parameter from embedding service
- Update MCP project tools tests to match new API response format
- Add example real test for usePolling hook
- Update vitest config to properly include test files

* Add comprehensive unit tests for polling architecture

- Add ETag utilities tests covering generation and checking logic
- Add progress API tests with 304 Not Modified support
- Add progress service tests for operation tracking
- Add projects API polling tests with ETag validation
- Fix projects API to properly handle ETag check independently of response object
- Test coverage for critical polling components following MCP test patterns

* Remove WebSocket functionality from service files

- Remove getWebSocketUrl imports that were causing runtime errors
- Replace WebSocket log streaming with deprecation warnings
- Remove unused WebSocket properties and methods
- Simplify disconnectLogs to no-op functions

These services now use HTTP polling exclusively as part of the
Socket.IO to polling migration.

🤖 Generated with Claude Code

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

* Fix memory leaks in mutation hooks

- Add isMountedRef to track component mount status
- Guard all setState calls with mounted checks
- Prevent callbacks from firing after unmount
- Apply fix to useProjectMutation, useDatabaseMutation, and useAsyncMutation

Addresses Code Rabbit feedback about potential state updates after
component unmount. Simple pragmatic fix without over-engineering
request cancellation.

🤖 Generated with Claude Code

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

* Document ETag implementation and limitations

- Add concise documentation explaining current ETag implementation
- Document that we use simple equality check, not full RFC 7232
- Clarify this works for our browser-to-API use case
- Note limitations for future CDN/proxy support

Addresses Code Rabbit feedback about RFC compliance by documenting
the known limitations of our simplified implementation.

🤖 Generated with Claude Code

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

* Remove all WebSocket event schemas and functionality

- Remove WebSocket event schemas from projectSchemas.ts
- Remove WebSocket event types from types/project.ts
- Remove WebSocket initialization and subscription methods from projectService.ts
- Remove all broadcast event calls throughout the service
- Clean up imports to remove unused types

Complete removal of WebSocket infrastructure in favor of HTTP polling.

🤖 Generated with Claude Code

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

* Fix progress field naming inconsistency

- Change backend API to return 'progress' instead of 'percentage'
- Remove unnecessary mapping in frontend
- Use consistent 'progress' field name throughout
- Update all progress initialization to use 'progress' field

Simple consolidation to one field name instead of mapping between two.

🤖 Generated with Claude Code

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

* Fix tasks polling data not updating UI

- Update tasks state when polling returns new data
- Keep UI in sync with server changes for selected project
- Tasks now live-update from external changes without project switching

The polling was fetching fresh data but never updating the UI state.

🤖 Generated with Claude Code

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

* Fix incorrect project title in pin/unpin toast messages

- Use API response data.title instead of selectedProject?.title
- Shows correct project name when pinning/unpinning any project card
- Toast now accurately reflects which project was actually modified

The issue was the toast would show the wrong project name when pinning
a project that wasn't the currently selected one.

🤖 Generated with Claude Code

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

* Remove over-engineered tempProjects logic

Removed all temporary project tracking during creation:
- Removed tempProjects state and allProjects combining
- Removed handleProjectCreationProgress function
- Removed progress polling for project creation
- Removed ProjectCreationProgressCard rendering
- Simplified createProject to just create and let polling pick it up

This fixes false 'creation failed' errors and simplifies the code significantly.
Project creation now shows a simple toast and relies on polling for updates.

* Optimize task count loading with parallel fetching

Changed loadTaskCountsForAllProjects to use Promise.allSettled for parallel API calls:
- All project task counts now fetched simultaneously instead of sequentially
- Better error isolation - one project failing doesn't affect others
- Significant performance improvement for users with multiple projects
- If 5 projects: from 5×API_TIME to just 1×API_TIME total

* Fix TypeScript timer type for browser compatibility

Replace NodeJS.Timeout with ReturnType<typeof setInterval> in crawlProgressService.
This makes the timer type compatible across both Node.js and browser environments,
fixing TypeScript compilation errors in browser builds.

* Add explicit status mappings for crawl progress states

Map backend statuses to correct UI states:
- 'processing' → 'processing' (use existing UI state)
- 'queued' → 'starting' (pre-crawl state)
- 'cancelled' → 'cancelled' (use existing UI state)

This prevents incorrect UI states and gives users accurate feedback about
crawl operation status.

* Fix TypeScript timer types in pollingService for browser compatibility

Replace NodeJS.Timer with ReturnType<typeof setInterval> in both
TaskPollingService and ProjectPollingService classes. This ensures
compatibility across Node.js and browser environments.

* Remove unused pollingService.ts dead code

This file was created during Socket.IO removal but never actually used.
The application already uses usePolling hooks (useTaskPolling, useProjectPolling)
which have proper ETag support and visibility handling.

Removing dead code to reduce maintenance burden and confusion.

* Fix TypeScript timer type in progressService for browser compatibility

Replace NodeJS.Timer with ReturnType<typeof setInterval> to ensure
compatibility across Node.js and browser environments, consistent with
other timer type fixes throughout the codebase.

* Fix TypeScript timer type in projectCreationProgressService

Replace NodeJS.Timeout with ReturnType<typeof setInterval> in Map type
to ensure browser/DOM build compatibility.

* Add proper error handling to project creation progress polling

Stop infinite polling on fatal errors:
- 404 errors continue polling (resource might not exist yet)
- Other HTTP errors (500, 503, etc.) stop polling and report error
- Network/parsing errors stop polling and report error
- Clear feedback to callbacks on all error types

This prevents wasting resources polling forever on unrecoverable errors
and provides better user feedback when things go wrong.

* Fix documentation accuracy in API conventions and architecture docs

- Fix API_NAMING_CONVENTIONS.md: Changed 'documents' to 'docs' and used
  distinct placeholders ({project_id} and {doc_id}) to match actual API routes
- Fix POLLING_ARCHITECTURE.md: Updated import path to use relative import
  (from ..utils.etag_utils) to match actual code structure
- ARCHITECTURE.md: List formatting was already correct, no changes needed

These changes ensure documentation accurately reflects the actual codebase.

* Fix type annotations in recursive crawling strategy

- Changed max_concurrent from invalid 'int = None' to 'int | None = None'
- Made progress_callback explicitly async: 'Callable[..., Awaitable[None]] | None'
- Added Awaitable import from typing
- Uses modern Python 3.10+ union syntax (project requires Python 3.12)

* Improve error logging in sitemap parsing

- Use logger.exception() instead of logger.error() for automatic stack traces
- Include sitemap URL in all error messages for better debugging
- Remove unused traceback import and manual traceback logging
- Now all exceptions show which sitemap failed with full stack trace

* Remove all Socket.IO remnants from task_service.py

Removed:
- Duplicate broadcast_task_update function definitions
- _broadcast_available flag (always False)
- All Socket.IO broadcast blocks in create_task, update_task, and archive_task
- Socket.IO related logging and error handling
- Unnecessary traceback import within Socket.IO error handler

Task updates are now handled exclusively via HTTP polling as intended.

* Complete WebSocket/Socket.IO cleanup across frontend and backend

- Remove socket.io-client dependency and all related packages
- Remove WebSocket proxy configuration from vite.config.ts
- Clean up WebSocket state management and deprecated methods from services
- Remove VITE_ENABLE_WEBSOCKET environment variable checks
- Update all comments to remove WebSocket/Socket.IO references
- Fix user-facing error messages that mentioned Socket.IO
- Preserve legitimate FastAPI WebSocket endpoints for MCP/test streaming

This completes the refactoring to HTTP polling, removing all Socket.IO
infrastructure while keeping necessary WebSocket functionality.

* Remove MCP log display functionality following KISS principles

- Remove all log display UI from MCPPage (saved ~100 lines)
- Remove log-related API endpoints and WebSocket streaming
- Keep internal log tracking for Docker container monitoring
- Simplify MCPPage to focus on server control and configuration
- Remove unused LogEntry types and streaming methods

Following early beta KISS principles - MCP logs are debug info that
developers can check via terminal/Docker if needed. UI now focuses
on essential functionality only.

* Add Claude Code command for analyzing CodeRabbit suggestions

- Create structured command for CodeRabbit review analysis
- Provides clear format for assessing validity and priority
- Generates 2-5 practical options with tradeoffs
- Emphasizes early beta context and KISS principles
- Includes effort estimation for each option

This command helps quickly triage CodeRabbit suggestions and decide
whether to address them based on project priorities and tradeoffs.

* Add in-flight guard to prevent overlapping fetches in crawl progress polling

Prevents race condition where slow responses could cause multiple concurrent
fetches for the same progressId. Simple boolean flag skips new fetches while
one is active and properly cleans up on stop/disconnect.

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

* Remove unused progressService.ts dead code

File was completely unused with no imports or references anywhere in the
codebase. Other services (crawlProgressService, projectCreationProgressService)
handle their specific progress polling needs directly.

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

* Remove unused project creation progress components

Both ProjectCreationProgressCard.tsx and projectCreationProgressService.ts
were dead code with no references. The service duplicated existing usePolling
functionality unnecessarily. Removed per KISS principles.

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

* Update POLLING_ARCHITECTURE.md to reflect current state

Removed references to deleted files (progressService.ts,
projectCreationProgressService.ts, ProjectCreationProgressCard.tsx).
Updated to document what exists now rather than migration history.

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

* Update API_NAMING_CONVENTIONS.md to reflect current state

Updated progress endpoints to match actual implementation.
Removed migration/historical references and anti-patterns section.
Focused on current best practices and architecture patterns.

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

* Remove unused optimistic updates code and references

Deleted unused useOptimisticUpdates.ts hook that was never imported.
Removed optimistic upda…
coleam00 pushed a commit that referenced this pull request Apr 7, 2026
* Investigate workflow error visibility issues (#260, #263, #264)

Analyze the workflow loader, router, and executor for silent error
handling that leaves users without visibility into failures.

* Surface workflow load errors and router failures to users (#260, #263, #264)

- Add WorkflowLoadError and WorkflowLoadResult types for structured error reporting
- Update parseWorkflow to return structured errors instead of null
- Add per-file try-catch in loadWorkflowsFromDir so one broken file doesn't abort loading
- Update discoverWorkflows to return { workflows, errors } instead of just an array
- Show load errors in /workflow list and /workflow reload commands
- Add error field to WorkflowInvocation for unknown workflow feedback
- Add case-insensitive workflow name matching in router
- Surface router errors to users in orchestrator
- Remove duplicate JSDoc in executor.ts, add @returns documentation
- Update all callers (command-handler, orchestrator, CLI) for new return type
- Add tests for error accumulation, case-insensitive matching, and error info

* Fix double-message on unknown workflow, add orchestrator test, use explicit type

- Return true from tryWorkflowRouting when error is sent to suppress raw AI
  output containing the invalid /invoke-workflow command
- Update orchestrator test to verify error message is sent instead of raw output
- Use explicit WorkflowLoadResult type instead of Awaited<ReturnType<>> in CLI

* docs: Document workflow error visibility improvements

* Address PR review: fix silent failures, add readonly types, improve error visibility

- Fix silent return false when findWorkflow fails after parse (now logs + sends user error)
- Add non-ENOENT directory errors to errors array in loadWorkflowsFromDir
- Add null/empty check for parsed YAML before property access in parseWorkflow
- Surface load errors in /workflow run (command handler + CLI) with specific messages
- Add case-insensitive matching to /workflow run (consistent with router)
- Add readonly modifiers to WorkflowLoadError and WorkflowLoadResult types
- Propagate readonly through router, orchestrator, and command handler
- Fix 3 stale comments: line reference, "returns array", tryWorkflowRouting JSDoc
- Remove changelog-style and obvious inline comments
- Add tests for /workflow list errors, /workflow reload errors, /workflow run load
  errors, case-insensitive matching, empty YAML, non-object YAML, directory errors
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
* Investigate workflow error visibility issues (coleam00#260, coleam00#263, coleam00#264)

Analyze the workflow loader, router, and executor for silent error
handling that leaves users without visibility into failures.

* Surface workflow load errors and router failures to users (coleam00#260, coleam00#263, coleam00#264)

- Add WorkflowLoadError and WorkflowLoadResult types for structured error reporting
- Update parseWorkflow to return structured errors instead of null
- Add per-file try-catch in loadWorkflowsFromDir so one broken file doesn't abort loading
- Update discoverWorkflows to return { workflows, errors } instead of just an array
- Show load errors in /workflow list and /workflow reload commands
- Add error field to WorkflowInvocation for unknown workflow feedback
- Add case-insensitive workflow name matching in router
- Surface router errors to users in orchestrator
- Remove duplicate JSDoc in executor.ts, add @returns documentation
- Update all callers (command-handler, orchestrator, CLI) for new return type
- Add tests for error accumulation, case-insensitive matching, and error info

* Fix double-message on unknown workflow, add orchestrator test, use explicit type

- Return true from tryWorkflowRouting when error is sent to suppress raw AI
  output containing the invalid /invoke-workflow command
- Update orchestrator test to verify error message is sent instead of raw output
- Use explicit WorkflowLoadResult type instead of Awaited<ReturnType<>> in CLI

* docs: Document workflow error visibility improvements

* Address PR review: fix silent failures, add readonly types, improve error visibility

- Fix silent return false when findWorkflow fails after parse (now logs + sends user error)
- Add non-ENOENT directory errors to errors array in loadWorkflowsFromDir
- Add null/empty check for parsed YAML before property access in parseWorkflow
- Surface load errors in /workflow run (command handler + CLI) with specific messages
- Add case-insensitive matching to /workflow run (consistent with router)
- Add readonly modifiers to WorkflowLoadError and WorkflowLoadResult types
- Propagate readonly through router, orchestrator, and command handler
- Fix 3 stale comments: line reference, "returns array", tryWorkflowRouting JSDoc
- Remove changelog-style and obvious inline comments
- Add tests for /workflow list errors, /workflow reload errors, /workflow run load
  errors, case-insensitive matching, empty YAML, non-object YAML, directory errors
joaobmonteiro pushed a commit to joaobmonteiro/Archon that referenced this pull request Apr 26, 2026
* Investigate workflow error visibility issues (coleam00#260, coleam00#263, coleam00#264)

Analyze the workflow loader, router, and executor for silent error
handling that leaves users without visibility into failures.

* Surface workflow load errors and router failures to users (coleam00#260, coleam00#263, coleam00#264)

- Add WorkflowLoadError and WorkflowLoadResult types for structured error reporting
- Update parseWorkflow to return structured errors instead of null
- Add per-file try-catch in loadWorkflowsFromDir so one broken file doesn't abort loading
- Update discoverWorkflows to return { workflows, errors } instead of just an array
- Show load errors in /workflow list and /workflow reload commands
- Add error field to WorkflowInvocation for unknown workflow feedback
- Add case-insensitive workflow name matching in router
- Surface router errors to users in orchestrator
- Remove duplicate JSDoc in executor.ts, add @returns documentation
- Update all callers (command-handler, orchestrator, CLI) for new return type
- Add tests for error accumulation, case-insensitive matching, and error info

* Fix double-message on unknown workflow, add orchestrator test, use explicit type

- Return true from tryWorkflowRouting when error is sent to suppress raw AI
  output containing the invalid /invoke-workflow command
- Update orchestrator test to verify error message is sent instead of raw output
- Use explicit WorkflowLoadResult type instead of Awaited<ReturnType<>> in CLI

* docs: Document workflow error visibility improvements

* Address PR review: fix silent failures, add readonly types, improve error visibility

- Fix silent return false when findWorkflow fails after parse (now logs + sends user error)
- Add non-ENOENT directory errors to errors array in loadWorkflowsFromDir
- Add null/empty check for parsed YAML before property access in parseWorkflow
- Surface load errors in /workflow run (command handler + CLI) with specific messages
- Add case-insensitive matching to /workflow run (consistent with router)
- Add readonly modifiers to WorkflowLoadError and WorkflowLoadResult types
- Propagate readonly through router, orchestrator, and command handler
- Fix 3 stale comments: line reference, "returns array", tryWorkflowRouting JSDoc
- Remove changelog-style and obvious inline comments
- Add tests for /workflow list errors, /workflow reload errors, /workflow run load
  errors, case-insensitive matching, empty YAML, non-object YAML, directory errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants