Skip to content

Feature/implement ai agent#135

Merged
pikann merged 25 commits into
masterfrom
feature/implement-ai-agent
Jun 4, 2026
Merged

Feature/implement ai agent#135
pikann merged 25 commits into
masterfrom
feature/implement-ai-agent

Conversation

@pikann
Copy link
Copy Markdown
Contributor

@pikann pikann commented Jun 4, 2026

Summary

This PR introduces full AI agent support across the platform — a new first-class entity that can participate in project conversations, execute skills via MCP tools, and interact with the codebase autonomously (including committing as a git identity).

What's New

New AI Agent Service

  • Standalone Python service (services/ai-agent/) for agent orchestration
  • Handles conversation management, skill execution, and MCP server integration
  • Components: builder.py, executor.py, prompt.py, repo_tools.py
  • Dockerized for dev and prod environments

Agent API & Backend

  • New agent domain layer: entities, repositories, handlers, and services
  • Agent-specific API key authentication with dedicated auth flow
  • Role-based authorization system — agents resolve permissions from their assigned role
  • Agent ID propagation across API requests and activity tracking
  • Event publishing for agent actions (real-time activity pane support)
  • Database migrations:
    • 000008: Agent table schema
    • 000009: Schema refinement (remove agent types)
    • 000010: Relax event source validation
    • 000011: Git committer identity fields (name + email per agent)

MCP Server — Agent Mode

  • Agent-specific MCP config (API key + agent ID injection)
  • Permission filtering scoped to agent's role
  • Expanded tool matrix: 16 categories, 81 total tools
  • Document tools for project documentation management (read/write/list)

Frontend

  • New agent routes: /projects/:id/agents and /projects/:id/agents/:agentId
  • Agent conversation view at /projects/:id/conversations/:conversationId
  • Step-based Create Agent Dialog with improved UX
  • Activity pane updates to surface agent actions in real time
  • Column collapse state persisted across views
  • agent-api.ts client for agent CRUD operations

Type of Change

  • New feature

Checklist

  • Backend: agent service, API handlers, auth, migrations
  • Frontend: routes, components, API client
  • MCP: agent mode config, document tools, permission matrix
  • Docker/deploy configs updated
  • Lint passing

pikann added 25 commits May 20, 2026 11:08
- Implemented ConversationHandler for managing agent conversations, including listing, retrieving, pausing, resuming, stopping, and sending messages.
- Enhanced response presenter to handle agent-related errors.
- Updated router to include new conversation routes under project scope.
- Modified notification consumer to trigger agent conversations on task assignments.
- Added migration scripts for creating agent types, agents, skills, MCP servers, conversations, and conversation events.
- Removed agent_types table and associated constraints from agents.
- Relaxed event_source check constraint to allow broader values from the OpenHands SDK.
- Enhance `stubAPIKeyAuth` to support agent key identification.
- Add integration tests for agent API key functionalities, including task creation, comment management, and permission scenarios.
- Update response handling for agent-related API calls.
- Introduce new methods in `fakeProjectRepo` for managing agent members.
- Ensure proper handling of agent IDs in API requests, including validation and error responses.
- Modify HTTP response codes for specific error scenarios related to agent operations.
- Updated PacaAPITaskExtendedClient and PacaAPIViewsClient to include X-Agent-ID header if agentId is provided in the configuration.
- Modified main configuration to accept PACA_AGENT_ID from environment variables.
- Enhanced PacaConfig interface to include an optional agentId field.
- Updated various services and repositories to handle agent ID for member resolution and activity tracking.
- Adjusted document and task handlers to capture agent ID during activity recording.
- Updated tests to ensure proper handling of agent ID in member lookups and activity records.
- Updated project member role management to use member ID instead of user ID.
- Added new methods in the member repository and service for updating and removing members by their membership record ID.
- Modified API endpoints and request handlers to reflect changes in member identification.
- Enhanced permission checks and logging for tool access based on agent permissions.
- Updated integration tests to validate new member management functionality.
- Implemented agent session started activity logging in TaskActivityPane.
- Updated ActivityPane to support ReactNode for activity descriptions.
- Enhanced useProjectRealtime to invalidate queries on agent events.
- Added new API functions for pausing, resuming, and stopping conversations.
- Created a new route for conversation details with real-time updates.
- Refactored notification consumer to log agent session activities.
- Updated permissions to include agent events for task-scoped access.
- Improved Vite and Docker configurations for better performance.
…anagement

- Added new tools for listing, reading, writing, deleting, and moving documents in a filesystem-like structure.
- Introduced Zod schemas for input validation of document operations.
- Built a document tree structure to manage folders and documents efficiently.
- Enhanced the AI agent to follow a documentation workflow, ensuring project docs are read before task execution.
- Updated the agent service to trigger conversations when agents are mentioned in task comments.
- Integrated agent permissions and roles management in the project service.
- Refactored authorization checks to accommodate agent-specific permissions.
- Improved test coverage for project and task services, ensuring robust functionality.
@pikann pikann merged commit 0e729eb into master Jun 4, 2026
10 checks passed
@pikann pikann deleted the feature/implement-ai-agent branch June 4, 2026 17:57
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.

1 participant