17 Commits

Author SHA1 Message Date
머니페니
0c4c22be5a feat: add AutoMerge with E2E-conditional merge logic 2026-03-20 18:40:52 +09:00
머니페니
db6e9b4a41 feat: add TaskHistory for completed task audit logging
Implements SQLite-based task history tracking with metrics (cost, duration, tokens).
- TaskHistory class with record() and get_recent() methods
- Tracks task_id, thread_id, issue_number, repo_name, source, status
- Records duration_seconds, tokens_input, tokens_output, cost_usd, error_message
- 4 passing tests covering completed/failed recording, ordering, empty state
2026-03-20 18:40:47 +09:00
머니페니
a58bbca9b7 test: add webhook-to-dispatcher integration test 2026-03-20 18:25:33 +09:00
머니페니
d35efae12e feat: add health check endpoints for Gitea, Discord, and queue
Adds three new monitoring endpoints:
- GET /health/gitea — Verifies Gitea API connectivity
- GET /health/discord — Reports Discord bot connection status
- GET /health/queue — Returns pending task count

All endpoints return JSON with status field. The Gitea endpoint
includes the API status code on success or error message on failure.
Discord endpoint returns "not_configured", "connecting", or "ok" with
bot username. Queue endpoint includes pending_tasks count.

Tests use mock lifespan to avoid initializing task queue, message
store, dispatcher, and discord handler during testing.
2026-03-20 18:24:07 +09:00
머니페니
da9caca791 feat: add Dispatcher for background task processing 2026-03-20 18:20:29 +09:00
머니페니
5a471907fa feat: add Discord Bot Gateway handler with mention parsing
Implements discord.py Bot Gateway to receive @agent mentions and enqueue tasks.
Includes deterministic thread ID generation and message parsing for issue numbers,
repo names, and freeform requests. Supports message queuing for running threads.

Files:
- agent/integrations/discord_handler.py: DiscordHandler class with event handling
- tests/test_discord_handler.py: 4 tests for parsing and thread ID generation

All tests pass (95 total).
2026-03-20 18:18:43 +09:00
머니페니
8c274b4be2 feat: complete Gitea webhook event parsing and task dispatch
- Add parse_gitea_event() function to parse issue comments, labels, and PR review requests
- Detect @agent mentions in issue comments and strip them from message
- Implement rate limiting with slowapi (10 requests/minute)
- Integrate with PersistentTaskQueue and MessageStore
- Queue messages if task is already running for the same thread
- Add 6 comprehensive tests for event parsing and signature verification
2026-03-20 18:15:07 +09:00
머니페니
9242badeff feat: add MessageStore and update check_message_queue middleware
- Implement SQLite-based MessageStore for follow-up messages
- Replace LangGraph store with MessageStore in check_message_queue middleware
- Preserve all multimodal content parsing logic
- Add comprehensive tests for MessageStore (4 tests, all passing)
- All 85 tests pass
2026-03-20 18:11:15 +09:00
머니페니
0136823462 feat: add PersistentTaskQueue with SQLite backend
Implements Task 1 of Phase 3: SQLite-based persistent task queue with:
- FIFO ordering (created_at ASC)
- Concurrency limit (default 1 running task)
- State machine: pending → running → completed|failed|timeout
- Methods: enqueue, dequeue, mark_completed, mark_failed, get_pending, has_running_task
- Thread-aware task tracking
- Singleton pattern with lazy initialization

All 8 tests passing.
2026-03-20 18:04:57 +09:00
머니페니
816415dd24 feat: complete PR creation via GiteaClient in commit_and_open_pr and open_pr 2026-03-20 17:44:45 +09:00
머니페니
af7bd2cdc3 feat: add prompt loading pipeline and path validator
- Add read_repo_instructions() to read both AGENTS.md and CLAUDE.md
- Add path_validator.validate_paths() for writable/blocked path enforcement
- Add 10 passing tests (test_prompt_loading.py, test_path_validator.py)
- All 71 tests pass
2026-03-20 17:42:34 +09:00
머니페니
e8983d8534 feat: implement gitea_comment and discord_reply tools 2026-03-20 17:39:45 +09:00
머니페니
b2ad726fc4 feat: implement GiteaClient with Gitea REST API v1
Implemented full async Gitea REST API v1 client using httpx with the following methods:
- create_pull_request: Create PRs with title, head, base, and body
- merge_pull_request: Merge PRs with configurable merge type
- create_issue_comment: Post comments on issues/PRs
- get_issue: Fetch issue/PR details
- get_issue_comments: Retrieve all comments for an issue/PR
- create_branch: Create new branches from existing ones

Added lazy singleton pattern with get_gitea_client() factory function that reads GITEA_URL and GITEA_TOKEN from environment.

All methods properly call raise_for_status() and return JSON responses. Comprehensive test suite with 8 tests covering all methods plus error handling.
2026-03-20 16:11:52 +09:00
머니페니
5d44c2e7e2 feat: implement DockerSandbox with docker-py container management
Implement DockerSandbox extending deepagents' BaseSandbox to manage Docker
containers via docker-py. This completes Task 1 of Phase 2.

Key implementation details:
- Extends BaseSandbox which auto-implements file I/O (read/write/ls/grep)
  by delegating to execute()
- Synchronous execute() method called via loop.run_in_executor() by server.py
- Container lifecycle management (create/connect/close)
- Upload/download file support via tar archives
- Configurable resource limits (memory, CPU, PIDs)
- Timeout support with proper exit code handling
- Environment variable configuration via create_sandbox() factory

Tests:
- 6 new tests covering container creation, command execution, and cleanup
- All 46 tests passing (40 existing + 6 new)
2026-03-20 16:07:27 +09:00
머니페니
a9e0115824 feat: add config module with pydantic-settings 2026-03-20 14:55:02 +09:00
머니페니
33db8eb7b0 chore: remove Linear, Slack, GitHub, and cloud sandbox code 2026-03-20 14:41:20 +09:00
머니페니
b79a6c2549 chore: initial copy from open-swe 2026-03-20 14:38:07 +09:00