Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9b28e74
Add products and credit spending code
milosmns Feb 16, 2026
8bf8d8d
Update API docs
milosmns Feb 16, 2026
69603aa
Add a DB migration for credit spending
milosmns Feb 16, 2026
a6b7545
RELEASE 5.0.0: Users can finally purchase credits and use them direct…
milosmns Feb 16, 2026
d0af82c
Fix credit balance propagation
milosmns Feb 16, 2026
aeb0084
Bump version
milosmns Feb 16, 2026
e4c05f5
Update python version
milosmns Feb 17, 2026
a8530fb
Update CI/CD wokrflows for the new python version
milosmns Feb 17, 2026
75bfda8
Bump version
milosmns Feb 17, 2026
d07d2e0
Update usage records to make payer non-nullable
milosmns Feb 17, 2026
f540426
Update data migrations for non-nullable payer ID
milosmns Feb 17, 2026
73d92a8
Configure lint rules via TOML
milosmns Feb 17, 2026
2019069
Reformat based on the new rules
milosmns Feb 17, 2026
117ca6b
Change formatting lint rules
milosmns Feb 17, 2026
e485643
Reformat imports based on the new rules
milosmns Feb 17, 2026
ca53551
Add a product list endpoint for purchasing
milosmns Feb 17, 2026
db15960
Update CI workflow caches
milosmns Feb 19, 2026
1b27e88
Bump version
milosmns Feb 17, 2026
bf94740
Migrate to the new GitHub image repository
milosmns Feb 19, 2026
fa360ef
Bump version
milosmns Feb 19, 2026
34b0842
Upgrading CI permissions for comment posting
milosmns Feb 19, 2026
7fdd924
Bump version
milosmns Feb 19, 2026
8df337d
Update docker ignores to include product config files
milosmns Feb 19, 2026
b723f4f
Bump version
milosmns Feb 19, 2026
4a0e895
Preserve credit balance across messages and merges
milosmns Feb 19, 2026
7bd6d0b
Bump version
milosmns Feb 19, 2026
c895d43
Rework markdown escaping for messages and releases
milosmns Feb 19, 2026
54e59e9
Bump version
milosmns Feb 19, 2026
12d5dbe
Handle tool failures gracefully in usage records
milosmns Feb 19, 2026
027e701
Update API docs
milosmns Feb 19, 2026
b83da25
Adding a data migration for the failed tool call flags
milosmns Feb 19, 2026
29004e1
Rename API docs file to match contents
milosmns Feb 19, 2026
e319327
Bump version
milosmns Feb 19, 2026
25ae25f
Fix nullability in API docs
milosmns Feb 19, 2026
8c52209
Bump version
milosmns Feb 19, 2026
550860d
Remove sponsorship flag from the auth tokens
milosmns Feb 21, 2026
15eee8c
Fix for settings link
milosmns Feb 21, 2026
6ee25e9
Update API docs
milosmns Feb 21, 2026
cd2976d
API docs fix
milosmns Feb 21, 2026
e444161
Bump version
milosmns Feb 21, 2026
b851706
Cleanup
milosmns Feb 21, 2026
0b2d165
Bump version
milosmns Feb 21, 2026
fd8195b
Add a purchase notification for credit-based products
milosmns Feb 21, 2026
72d5858
Bump version
milosmns Feb 21, 2026
2553f7a
Fix purchase announcements
milosmns Feb 22, 2026
c8bba0d
Add the latest models
milosmns Feb 22, 2026
898699c
Bump version
milosmns Feb 22, 2026
0a914e9
Update AI coding rules
milosmns Feb 22, 2026
bc5e9af
Refactor error handling to include error codes
milosmns Feb 23, 2026
7e9ca96
Update API docs to include error structures
milosmns Feb 23, 2026
a8f8fcd
Bump version
milosmns Feb 23, 2026
1a7a8d9
Add new image models
milosmns Feb 27, 2026
8b1e920
Bump version
milosmns Feb 27, 2026
07ce506
Remove Grok (broken in Replicate)
milosmns Feb 27, 2026
061a7e3
Bump version
milosmns Feb 27, 2026
bd4ef33
Add generic coding agent rules
milosmns Mar 1, 2026
bf3b9a2
Add policies, onboarding control and waitlists
milosmns Mar 5, 2026
6620ffe
Add a database migration for onboarding flags
milosmns Mar 5, 2026
daad985
Update API docs for onboarding flags
milosmns Mar 5, 2026
ae3ce6c
Bump version
milosmns Mar 5, 2026
cde3999
Update build scripts to remove custom scripts
milosmns Mar 5, 2026
47f7547
Update AI coding rules
milosmns Mar 5, 2026
09ec577
Bump version
milosmns Mar 5, 2026
bcec3b8
Increase fetch depth in CI pipelines
milosmns Mar 6, 2026
20cad4f
Bump version
milosmns Mar 6, 2026
829e921
Add GPT 5.4 family of models
milosmns Mar 7, 2026
b9239fe
Bump version
milosmns Mar 7, 2026
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
4 changes: 4 additions & 0 deletions .agent/rules/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Always start with modifying the main code. When done, look for tests and update

In Python, I want you to use the latest type syntax (`type | None`) instead of `Optional`. I also want you to use a single space (`=`) around the equals sign (`=`) in function argument calls. It's important to use double quotation marks (`"`) instead of single quotations (`'`). And finally, we want to always use trailing commas in multi-line function declarations and calls. There's never a reason to write `unittest.main()` manually, we have a script for running tests. Never use inline imports inside of functions (use file header even in tests), and always use `from ... import ...` syntax at the top of the file.

#### Error Handling

Never use generic `ValueError`, `AssertionError`, or bare `Exception` for raising errors. Always use the structured exceptions from `util.errors` (`ValidationError`, `NotFoundError`, `AuthorizationError`, `ExternalServiceError`, `RateLimitError`, `ConfigurationError`, `InternalError`). Each raise must include an error code from `util.error_codes`. When re-raising from a caught exception, always use `raise ... from e` to preserve the chain. When calling external services (LLMs, image APIs, web fetchers), always guard against empty/null/empty-array responses with `ExternalServiceError`.

#### JavaScript/TypeScript

In JavaScript and TypeScript, use types as much as possible: strict mode will be turned on! If in doubt, follow Java standard formatting. Finally, we also always want trailing commas in multi-line code blocks.
8 changes: 4 additions & 4 deletions .agent/rules/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ trigger: always_on

#### Development Workflow

- Use `./tools/run_dev.sh` for development server (includes hot reload, verbose logging, dev API key)
- Use `./tools/run_lint.sh --fix` for code quality checks with `ruff` (this flag will auto-fix issues it can)
- Use `./tools/run_prod.sh` for production runs
- Use `pipenv install --dev` and `pipenv run python src/main.py --dev` for development server (includes hot reload, verbose logging, dev API key)
- Use `pipenv run pre-commit run --all-files --show-diff-on-failure` for code quality checks
- Use `pipenv install` and `pipenv run python src/main.py` for production runs
- For all other operations like testing, always run inside of `pipenv`

#### Code Quality

- Always run linting before commits: `./tools/run_lint.sh --fix`
- Always run linting before commits: `pipenv run pre-commit run`
- All scripts handle environment setup automatically (PYTHONPATH, .env files)

#### Project Structure
Expand Down
12 changes: 8 additions & 4 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Always start with modifying the main code. When done, look for tests and update

In Python, I want you to use the latest type syntax (`type | None`) instead of `Optional`. I also want you to use a single space (`=`) around the equals sign (`=`) in function argument calls. It's important to use double quotation marks (`"`) instead of single quotations (`'`). And finally, we want to always use trailing commas in multi-line function declarations and calls. There's never a reason to write `unittest.main()` manually, we have a script for running tests. Never use inline imports inside of functions (use file header even in tests), and always use `from ... import ...` syntax at the top of the file.

#### Error Handling

Never use generic `ValueError`, `AssertionError`, or bare `Exception` for raising errors. Always use the structured exceptions from `util.errors` (`ValidationError`, `NotFoundError`, `AuthorizationError`, `ExternalServiceError`, `RateLimitError`, `ConfigurationError`, `InternalError`). Each raise must include an error code from `util.error_codes`. When re-raising from a caught exception, always use `raise ... from e` to preserve the chain. When calling external services (LLMs, image APIs, web fetchers), always guard against empty/null/empty-array responses with `ExternalServiceError`.

#### JavaScript/TypeScript

In JavaScript and TypeScript, use types as much as possible: strict mode will be turned on! If in doubt, follow Java standard formatting. Finally, we also always want trailing commas in multi-line code blocks.
Expand All @@ -30,14 +34,14 @@ In JavaScript and TypeScript, use types as much as possible: strict mode will be

#### Development Workflow

- Use `./tools/run_dev.sh` for development server (includes hot reload, verbose logging, dev API key)
- Use `./tools/run_lint.sh --fix` for code quality checks with `ruff` (this flag will auto-fix issues it can)
- Use `./tools/run_prod.sh` for production runs
- Use `pipenv install --dev` and `pipenv run python src/main.py --dev` for development server (includes hot reload, verbose logging, dev API key)
- Use `pipenv run pre-commit run --all-files --show-diff-on-failure` for code quality checks
- Use `pipenv install` and `pipenv run python src/main.py` for production runs
- For all other operations like testing, always run inside of `pipenv`

#### Code Quality

- Always run linting before commits: `./tools/run_lint.sh --fix`
- Always run linting before commits: `pipenv run pre-commit run`
- All scripts handle environment setup automatically (PYTHONPATH, .env files)

#### Project Structure
Expand Down
4 changes: 4 additions & 0 deletions .cursor/rules/style.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Always start with modifying the main code. When done, look for tests and update

In Python, I want you to use the latest type syntax (`type | None`) instead of `Optional`. I also want you to use a single space (`=`) around the equals sign (`=`) in function argument calls. It's important to use double quotation marks (`"`) instead of single quotations (`'`). And finally, we want to always use trailing commas in multi-line function declarations and calls. There's never a reason to write `unittest.main()` manually, we have a script for running tests. Never use inline imports inside of functions (use file header even in tests), and always use `from ... import ...` syntax at the top of the file.

#### Error Handling

Never use generic `ValueError`, `AssertionError`, or bare `Exception` for raising errors. Always use the structured exceptions from `util.errors` (`ValidationError`, `NotFoundError`, `AuthorizationError`, `ExternalServiceError`, `RateLimitError`, `ConfigurationError`, `InternalError`). Each raise must include an error code from `util.error_codes`. When re-raising from a caught exception, always use `raise ... from e` to preserve the chain. When calling external services (LLMs, image APIs, web fetchers), always guard against empty/null/empty-array responses with `ExternalServiceError`.

#### JavaScript/TypeScript

In JavaScript and TypeScript, use types as much as possible: strict mode will be turned on! If in doubt, follow Java standard formatting. Finally, we also always want trailing commas in multi-line code blocks.
8 changes: 4 additions & 4 deletions .cursor/rules/tooling.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ alwaysApply: true

#### Development Workflow

- Use `./tools/run_dev.sh` for development server (includes hot reload, verbose logging, dev API key)
- Use `./tools/run_lint.sh --fix` for code quality checks with `ruff` (this flag will auto-fix issues it can)
- Use `./tools/run_prod.sh` for production runs
- Use `pipenv install --dev` and `pipenv run python src/main.py --dev` for development server (includes hot reload, verbose logging, dev API key)
- Use `pipenv run pre-commit run --all-files --show-diff-on-failure` for code quality checks
- Use `pipenv install` and `pipenv run python src/main.py` for production runs
- For all other operations like testing, always run inside of `pipenv`

#### Code Quality

- Always run linting before commits: `./tools/run_lint.sh --fix`
- Always run linting before commits: `pipenv run pre-commit run`
- All scripts handle environment setup automatically (PYTHONPATH, .env files)

#### Project Structure
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
!alembic.ini
!.env
!pyproject.toml
!config/
!.github/ISSUE_TEMPLATE/
40 changes: 21 additions & 19 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,39 @@ jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login != 'dependabot[bot]'
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
fetch-depth: 200

- name: Print build name
run: echo "$GITHUB_ACTOR is building '$GITHUB_REPOSITORY' (commit $GITHUB_SHA)"

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12.12"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-dependency-cache

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.6"
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-dependency-cache

- name: Install dependencies
run: |
pip install --no-cache-dir pipenv
pipenv install --dev

- name: Lint checks
run: ./tools/run_lint.sh
run: pipenv run pre-commit run --all-files --show-diff-on-failure

- name: Test the service
env:
Expand All @@ -47,27 +52,24 @@ jobs:
- name: Build Docker image
run: docker build . --file Dockerfile --tag the-agent

- name: Auth for GitHub's Docker repository
env:
USER: ${{ secrets.PACKAGES_USER }}
TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: echo $TOKEN | docker login docker.pkg.github.com --username $USER --password-stdin
- name: Auth for GitHub's Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin

- name: Tag Docker image
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Tagging images with version '$VERSION'..."
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".beta
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_beta
docker tag the-agent ghcr.io/$GITHUB_REPOSITORY:"$VERSION".beta
docker tag the-agent ghcr.io/$GITHUB_REPOSITORY:latest_beta
docker tag the-agent appifyhub/the-agent:"$VERSION".beta
docker tag the-agent appifyhub/the-agent:latest_beta

- name: Publish Docker images to GitHub
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Publishing images with version '$VERSION'..."
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".beta
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_beta
docker push ghcr.io/$GITHUB_REPOSITORY:"$VERSION".beta
docker push ghcr.io/$GITHUB_REPOSITORY:latest_beta

- name: Publish Docker images to DockerHub
id: docker_publish
Expand Down Expand Up @@ -155,10 +157,10 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"release_output_b64\": \"$RELEASE_OUTPUT_B64\"}" \
-s || true)
SHOULD_RETRY=$(echo "$SUMMARY_RESPONSE" | grep -o '"should_retry"[[:space:]]*:[[:space:]]*[^,}]*' | head -n1 | sed 's/.*:[[:space:]]*\([^,}]*\).*/\1/')
SHOULD_RETRY=$(echo "$SUMMARY_RESPONSE" | jq -r '.should_retry // false')
if [[ "$SHOULD_RETRY" != "true" ]]; then
echo "Notification successful (should_retry = $SHOULD_RETRY)"
SUMMARY=$(echo "$SUMMARY_RESPONSE" | grep -o '"summary"[[:space:]]*:[[:space:]]*"[^"]*"' | head -n1 | sed 's/.*: *"\([^"]*\)".*/\1/')
SUMMARY=$(echo "$SUMMARY_RESPONSE" | jq -r '.summary // ""')
SUMMARY_B64=$(printf "%s" "$SUMMARY" | base64 -w 0)
echo "summary_b64=$SUMMARY_B64" >> $GITHUB_OUTPUT
exit 0
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/dependabot-main-pr-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-dependency-cache

- name: Remove the locked and verified labels if present
uses: actions-ecosystem/action-remove-labels@v1
continue-on-error: true
Expand All @@ -48,9 +40,18 @@ jobs:
Verified

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12.6"
python-version: "3.12.12"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-dependency-cache

- name: Install and lock dependencies
run: |
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/dependabot-main-pr-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-dependency-cache

- name: Remove the verified label if present
uses: actions-ecosystem/action-remove-labels@v1
continue-on-error: true
Expand All @@ -49,9 +41,18 @@ jobs:
labels: Verified

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12.6"
python-version: "3.12.12"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-dependency-cache

- name: Install dependencies
run: |
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login != 'dependabot[bot]'
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -16,26 +20,27 @@ jobs:
- name: Print build name
run: echo "$GITHUB_ACTOR is building PR#$PR_NUMBER in '$GITHUB_REPOSITORY' (commit $GITHUB_SHA)"

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12.12"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-dependency-cache

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.6"
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-dependency-cache

- name: Install dependencies
run: |
pip install --no-cache-dir pipenv
pipenv install --dev

- name: Lint checks
run: ./tools/run_lint.sh
run: pipenv run pre-commit run --all-files --show-diff-on-failure

- name: Test the service
env:
Expand All @@ -46,20 +51,17 @@ jobs:
- name: Build Docker image
run: docker build . --file Dockerfile --tag the-agent

- name: Auth for GitHub's Docker repository
env:
USER: ${{ secrets.PACKAGES_USER }}
TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: echo $TOKEN | docker login docker.pkg.github.com --username $USER --password-stdin
- name: Auth for GitHub's Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin

- name: Tag Docker image
env:
PR_NUMBER: ${{ github.event.number }}
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Tagging images with version '$VERSION'..."
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".pr_$PR_NUMBER
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_pr
docker tag the-agent ghcr.io/$GITHUB_REPOSITORY:"$VERSION".pr_$PR_NUMBER
docker tag the-agent ghcr.io/$GITHUB_REPOSITORY:latest_pr
docker tag the-agent appifyhub/the-agent:"$VERSION".pr_$PR_NUMBER
docker tag the-agent appifyhub/the-agent:latest_pr

Expand All @@ -69,8 +71,8 @@ jobs:
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Publishing images with version '$VERSION'..."
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".pr_$PR_NUMBER
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_pr
docker push ghcr.io/$GITHUB_REPOSITORY:"$VERSION".pr_$PR_NUMBER
docker push ghcr.io/$GITHUB_REPOSITORY:latest_pr

- name: Publish Docker images to DockerHub
id: docker_publish
Expand Down
Loading
Loading