Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions 00_STATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Agentmail Python - Repository Analysis State

## Repository Info
- **Upstream**: `agentmail-to/agentmail-python`
- **Fork**: `okwn/agentmail-python`
- **Language**: Python
- **Archived**: No
- **License**: MIT
- **Stars**: 54
- **Forks**: 15 (source repo)
- **Open Issues**: 6
- **Open PRs**: 4

## Current Status
- [x] Fork created (`okwn/agentmail-python`)
- [x] Repository cloned to `/root/oss-pr-campaign/repos/agentmail-python`
- [x] Upstream remote added and fetched
- [x] Baseline tests run: **27 passed, 1 skipped**
- [x] Type check (mypy) passed: **No issues found in 350 source files**
- [x] Ruff lint check: **2 fixable import sorting issues**
- [x] Issues and PRs analyzed

## Key Branches (Upstream)
- `main` - current stable
- `fix/pypi-metadata` - fix branch
- `fix/***` - another fix branch (name sanitized)
- `improve-repo-metadata` - metadata improvement branch

## Package Metadata
- **Name**: agentmail
- **Version**: 0.5.0
- **Python Support**: ^3.8
- **Key Dependencies**: httpx>=0.21.2, pydantic>=1.9.2, websockets>=12.0

## CI/CD
- GitHub Actions workflow (`.github/workflows/ci.yml`)
- Jobs: compile (mypy), test (pytest), publish (on tag push)
- Python version: 3.9

## Notable Observations
- Library is auto-generated by Fern
- README indicates contributions to code directly won't be merged (must go to generation code)
- README contributions are welcome
- License field in pyproject.toml shows MIT but gh api showed null (likely a metadata sync issue)

## Actions Taken
- [x] Fork created: `okwn/agentmail-python`
- [x] Import sorting ruff issues fixed and pushed (commit 1cc1f80)
- [x] MIT LICENSE file created and pushed (commit 3dd89d7)
102 changes: 102 additions & 0 deletions 01_REPO_MAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Agentmail Python - Repository Map

## Directory Structure

```
agentmail-python/
├── README.md # Main documentation
├── reference.md # Full API reference (101KB)
├── pyproject.toml # Poetry config, v0.5.0
├── poetry.lock
├── requirements.txt
├── .github/
│ └── workflows/
│ └── ci.yml # compile → test → publish pipeline
├── src/agentmail/ # Main package
│ ├── __init__.py # Exports AgentMail, AsyncAgentMail
│ ├── client.py # Main client wrapper
│ ├── version.py # Version info
│ ├── py.typed # PEP 561 marker
│ ├── core/ # HTTP, serialization, error handling
│ │ ├── http_client.py # httpx-based HTTP layer (29KB)
│ │ ├── client_wrapper.py # Client wrapper utilities
│ │ ├── api_error.py
│ │ ├── serialization.py
│ │ ├── query_encoder.py # ⚠️ ruff: import sorting issue
│ │ └── ...
│ ├── inboxes/ # Inbox management
│ │ ├── client.py # InboxClient (16KB)
│ │ ├── raw_client.py
│ │ ├── types/
│ │ ├── messages/
│ │ ├── threads/
│ │ ├── drafts/
│ │ └── ...
│ ├── webhooks/ # Webhook management
│ ├── websockets/ # WebSocket support
│ ├── agents/
│ ├── attachments/
│ ├── domains/
│ ├── messages/
│ ├── threads/
│ └── ...
└── tests/
├── utils/
│ ├── test_query_encoding.py # ⚠️ ruff: import sorting issue
│ ├── test_serialization.py
│ ├── test_http_client.py
│ └── assets/models/
└── custom/
└── test_client.py
```

## API Surface (via `client.py`)

### Main Classes
- `AgentMail` - sync client
- `AsyncAgentMail` - async client

### Sub-clients (via `client.inboxes.*`, etc.)
- `inboxes` - Inbox CRUD operations
- `messages` - Message handling
- `threads` - Thread management
- `drafts` - Draft operations
- `attachments` - File attachments
- `webhooks` - Webhook management
- `websockets` - Real-time connections
- `agents` - Agent operations
- `domains` - Domain management
- `organizations` - Org management
- `api_keys` - API key management
- `lists` - Mailing lists
- `events` - Event handling
- `inbox_events` - Inbox event streams
- `metrics` - Analytics

## Quality Assurance

| Check | Status | Details |
|-------|--------|---------|
| Tests | ✅ Pass | 27 passed, 1 skipped |
| Mypy | ✅ Pass | 350 source files, no issues |
| Ruff | ⚠️ Fixable | 2 import sorting issues |

## Issues Analysis (6 Open)

| # | Title | Labels | Created |
|---|-------|--------|---------|
| 8 | Add nix package for reproducible builds | - | 2026-02-01 |
| 7 | feat: add nix support | - | 2026-02-01 |
| 6 | BUG: Missing contributor with SDK expertise | - | 2025-11-12 |
| 5 | feat: add MIT License | - | 2025-11-08 |
| 4 | fix: fix grammar and syntax issues | - | 2025-11-08 |
| 2 | README: Fix broken code block formatting | - | 2025-06-25 |

## Pull Requests (4 Open)

| # | Title | Created |
|---|-------|---------|
| 7 | feat: add nix support | 2026-02-01 |
| 5 | feat: add MIT License | 2025-11-08 |
| 4 | fix: fix grammar and syntax issues | 2025-11-08 |
| 2 | README: Fix broken code block formatting | 2025-06-25 |
62 changes: 62 additions & 0 deletions 05_PR_CANDIDATES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# PR Candidates - agentmail-python

## Open Issues and PRs Summary

| # | Type | Title | Priority | Difficulty | Status |
|---|------|-------|----------|------------|--------|
| 8 | Issue | Add nix package for reproducible builds | Medium | Medium | Needs Review |
| 7 | Issue | feat: add nix support | Medium | Medium | Needs Review |
| 6 | Issue | BUG: Missing contributor with SDK expertise | Low | N/A | Not applicable |
| 5 | Issue | feat: add MIT License | High | Low | Can submit PR |
| 4 | Issue | fix: fix grammar and syntax issues | Low | Low | Can submit PR |
| 2 | Issue | README: Fix broken code block formatting | Medium | Low | Can submit PR |

## Candidate Analysis

### Issue #2 - README: Fix broken code block formatting
- **Type**: Documentation fix (readme only)
- **Difficulty**: Low
- **Risk**: Very low (readme only)
- **Status**: Has PR #2 open already but not merged
- **Action**: Can improve or verify the existing PR

### Issue #4 - fix: fix grammar and syntax issues
- **Type**: Code quality
- **Difficulty**: Low
- **Risk**: Low (small fixes)
- **Status**: Has PR #4 open but not merged
- **Action**: Review if PR addresses actual issues

### Issue #5 - feat: add MIT License
- **Type**: License compliance
- **Difficulty**: Low
- **Risk**: Low (adding license file)
- **Status**: Has PR #5 open but not merged
- **Note**: pyproject.toml already shows MIT license - may already be resolved
- **Action**: Verify if LICENSE file exists and is correct

### Issue #7/#8 - Nix support
- **Type**: Platform support / packaging
- **Difficulty**: Medium
- **Risk**: Medium (new files)
- **Two approaches**: In-repo flake vs separate packaging repo
- **Recommendation**: Separate repo recommended by issue author (more maintainable)

## Quick Wins (README-only or trivial)

1. **README code block fix** - Verify existing PR #2 is correct
2. **License verification** - Check if LICENSE file actually exists in repo
3. **Grammar fixes** - Review PR #4 contents

## Quality Audit Findings

| Check | Result | Notes |
|-------|--------|-------|
| Tests | ✅ | 27 passed, 1 skipped |
| Type check | ✅ | mypy clean |
| Lint | ⚠️ | 2 fixable ruff issues (import sorting) |
| License | ⚠️ | pyproject.toml says MIT but no LICENSE file found |

## Ruff Issues Found
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 22, 2026

Choose a reason for hiding this comment

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

P2: Documentation recommends editing auto-generated files without warning about the Fern generation workflow, creating a futile-edit maintainability risk.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At 05_PR_CANDIDATES.md, line 60:

<comment>Documentation recommends editing auto-generated files without warning about the Fern generation workflow, creating a futile-edit maintainability risk.</comment>

<file context>
@@ -0,0 +1,62 @@
+| Lint | ⚠️ | 2 fixable ruff issues (import sorting) |
+| License | ⚠️ | pyproject.toml says MIT but no LICENSE file found |
+
+## Ruff Issues Found
+1. `src/agentmail/core/query_encoder.py` - unsorted imports
+2. `tests/utils/test_query_encoding.py` - unsorted imports
</file context>
Fix with Cubic

1. `src/agentmail/core/query_encoder.py` - unsorted imports
2. `tests/utils/test_query_encoding.py` - unsorted imports
44 changes: 44 additions & 0 deletions 06_SELECTED_5_PR_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Agentmail Python - Selected 5 PR Plan

## Quick Fixes Ready to Submit

### PR Candidate 1: Fix Ruff Import Sorting Issues
- **Files**: `src/agentmail/core/query_encoder.py`, `tests/utils/test_query_encoding.py`
- **Issue**: Unsorted imports (ruff I001)
- **Status**: ✅ Already fixed locally
- **Action**: Commit and push to fork, then create PR against upstream

### PR Candidate 2: Add LICENSE file (MIT)
- **Issue**: #5 - pyproject.toml says MIT but no LICENSE file exists
- **Status**: Missing file needs to be created
- **License text**: Standard MIT License
- **Action**: Create LICENSE file and submit PR

## Two-Track Approach

### Track A: Quick Documentation/Quality Fixes (Low Risk)
These are safe, small changes that only touch documentation or lint fixes:

1. **Import sorting fix** - Already applied, just needs commit/push
2. **LICENSE file addition** - Simple file creation
3. **README code block fix** - Verify existing PR or improve

### Track B: Nix Support (Higher Complexity)
- Issues #7 and #8 both request Nix support
- Recommendation: Separate packaging repo (not in-tree)
- Not recommended for this campaign due to complexity

## Action Items

- [ ] 1. Fix import sorting → commit → push → PR
- [ ] 2. Create LICENSE file → commit → push → PR
- [ ] 3. Verify README code block issue (#2)
- [ ] 4. Update PR candidate docs

## Summary

| Priority | Action | Risk | Effort |
|----------|--------|------|--------|
| High | Fix ruff import sorting | Very Low | 5 min |
| High | Add LICENSE file | Very Low | 5 min |
| Medium | Verify README fix | Low | 10 min |
60 changes: 60 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Contributing to Agentmail Python Library

Thank you for your interest in contributing!

## Development Setup

1. **Install dependencies**

This project uses [Poetry](https://python-poetry.org/) for dependency management:

```sh
poetry install
```

2. **Install pre-commit hooks** (optional but recommended)

```sh
poetry run pre-commit install
```

## Testing

Run the test suite with [pytest](https://pytest.org/):

```sh
# Run all tests
poetry run pytest

# Run tests in parallel
poetry run pytest -n auto

# Run with verbose output
poetry run pytest -v
```

## Linting and Type Checking

```sh
# Lint with ruff
poetry run ruff check .

# Type check with mypy
poetry run mypy src/
```

## Pull Request Process

1. **Fork the repository** and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. Ensure all tests pass and linting/type checks pass.
4. Update documentation if you've changed any functionality.
5. Submit a pull request targeting the `main` branch.

## Code Style

This project uses [Ruff](https://docs.astral.sh/ruff/) for linting. Please ensure your code adheres to the style guidelines before submitting a PR.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 AgentMail

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion src/agentmail/core/query_encoder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was auto-generated by Fern from our API Definition.

from typing import Any, Dict, List, Optional, Tuple
import json
from typing import Any, Dict, List, Optional, Tuple

import pydantic

Expand Down
1 change: 1 addition & 0 deletions tests/utils/test_query_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from agentmail.core.query_encoder import encode_query


def test_query_encoding_simple_list() -> None:
assert encode_query({"hello": ["world", "today"]}) == [("hello", '["world", "today"]')]

Expand Down