Files
temporal-ai-agent/docs/contributing.md
Dan Davison 4102f9aeca uv migration
2025-07-29 18:06:58 -04:00

4.1 KiB

Contributing to the Temporal AI Agent Project

This document provides guidelines for contributing to temporal-ai-agent. All setup and installation instructions can be found in setup.md.

Getting Started

Code Style & Formatting

We use black for code formatting and isort for import sorting to maintain a consistent codebase.

  • Format code:
    uv run black .
    uv run isort .
    
    Please format your code before committing.

Linting & Type Checking

We use mypy for static type checking.

  • Run type checks:
    uv run mypy --check-untyped-defs --namespace-packages .
    
    Ensure all linting and type checks pass before submitting a pull request.

Testing

Comprehensive testing is crucial for this project. We use pytest and Temporal's testing framework.

  • Install test dependencies:
    uv sync
    
  • Run all tests:
    uv run pytest
    
  • Run tests with time-skipping (recommended for faster execution, especially in CI):
    uv run pytest --workflow-environment=time-skipping
    

For detailed information on test categories, running specific tests, test environments, coverage, and troubleshooting, please refer to:

Ensure all tests pass before submitting a pull request.

Making Changes

Adding New Tools or Goals

If you're looking to extend the agent's capabilities:

  1. Create your tool implementation in the tools/ directory.
  2. Register your tool and associate it with relevant goals. For detailed instructions, please see:

General Code Changes

  • Follow the existing code style and patterns.
  • Ensure any new code is well-documented with comments.
  • Write new tests for new functionality or bug fixes.
  • Update existing tests if necessary.

Submitting Contributions

Pull Requests

When you're ready to submit your changes:

  1. Push your branch to the remote repository.
  2. Open a Pull Request (PR) against the main branch.
  3. Describe your changes: Clearly explain what you changed and why. Reference any related issues.
  4. Ensure tests pass: All CI checks, including tests and linters, must pass. The command uv run pytest --workflow-environment=time-skipping is a good one to run locally.
  5. Request review: Request a review from one or more maintainers.

Reporting Bugs

If you encounter a bug, please:

  1. Search existing issues: Check if the bug has already been reported.
  2. Open a new issue: If not, create a new issue.
    • Provide a clear and descriptive title.
    • Include steps to reproduce the bug.
    • Describe the expected behavior and what actually happened.
    • Provide details about your environment (OS, Python version, Temporal server version, etc.).
    • Include any relevant logs or screenshots.

Suggesting Enhancements

We welcome suggestions for new features or improvements!

  1. Search existing issues/discussions: See if your idea has already been discussed.
  2. Open a new issue:
    • Use a clear and descriptive title.
    • Provide a detailed explanation of the enhancement and its benefits.
    • Explain the use case or problem it solves.
    • Include any potential implementation ideas if you have them.

Key Resources