Skip to content

feat(api): autoclosed DB sessions + fights selectinload + webhooks pagination - #68

Merged
Roddygithub merged 4 commits into
mainfrom
feat/api-hardening
Jul 24, 2026
Merged

Roddygithub merged 4 commits into
mainfrom
feat/api-hardening

Conversation

@Roddygithub

Copy link
Copy Markdown
Owner

Summary

  • `get_session` now commits on successful yield and rolls back on exception (so DB writes from route handlers persist without explicit `db.commit()`).
  • `GET /api/v1/fights` now eagerly loads `agents` + `skills` via `selectinload` (closes the list endpoint N+1).
  • `GET /api/v1/webhooks` accepts `limit` (1-1000) + `offset` parameters for operator pagination.
  • OpenAPI `schema.d.ts` regenerated to reflect the new query params.

Commits

  1. `feat(api): auto-commit get_sessions on success, rollback on exception`
  2. `feat(api): preload agents + skills on GET /fights (closes list N+1)`
  3. `feat(api): add limit/offset pagination to GET /webhooks`
  4. `chore(web): regen OpenAPI schema.d.ts for webhooks pagination`

Test plan

  • `cd apps/api && uv run pytest tests/ -x -q`
  • `cd web && pnpm typecheck`
  • `cd web && pnpm generate:api` (drift gate)

roddy added 4 commits July 24, 2026 17:07
Signed-off-by: Roddy GitHub <roddy@users.noreply.github.com>
Signed-off-by: Roddy GitHub <roddy@users.noreply.github.com>
Signed-off-by: Roddy GitHub <roddy@users.noreply.github.com>
Signed-off-by: Roddy GitHub <roddy@users.noreply.github.com>
@Roddygithub
Roddygithub merged commit 751cf2b into main Jul 24, 2026
11 checks passed
@Roddygithub
Roddygithub deleted the feat/api-hardening branch July 24, 2026 16:47
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.

2 participants