Merged
Conversation
Collaborator
locnguyen1986
commented
Nov 17, 2025
- Add responses with queue tasks and webhook
- Add db migrations for both media and response feature
- Structure the configurations
- Formalize all e2e tests
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements OpenAI-compatible background response processing for the Response API, standardizes database configuration naming, and adds comprehensive SQL-based migrations for both response-api and media-api services.
Key Changes:
- Adds background task processing with PostgreSQL-backed queue and worker pool
- Implements webhook notifications for async task completion
- Migrates from GORM AutoMigrate to golang-migrate/migrate for structured SQL migrations
- Standardizes database DSN environment variables to
DB_POSTGRESQL_WRITE_DSN - Standardizes S3 credentials to AWS naming convention (
MEDIA_S3_ACCESS_KEY_ID,MEDIA_S3_SECRET_ACCESS_KEY) - Adds comprehensive Postman test suite with 18 test scenarios for background mode
Reviewed Changes
Copilot reviewed 50 out of 55 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/automation/responses-postman-scripts.json | Added 8 new test suites (726 lines) for background mode, webhooks, cancellation, and complex scenarios |
| services/response-api/migrations/*.sql | New SQL migrations for responses, conversations, conversation_items, and tool_executions tables with proper schema namespacing |
| services/response-api/internal/worker/*.go | Worker pool implementation with configurable concurrency and task timeout |
| services/response-api/internal/webhook/*.go | HTTP webhook service with retry logic and structured payloads |
| services/response-api/internal/domain/response/service.go | Split Create into createSync/createAsync with ExecuteBackground method for workers |
| services/response-api/internal/infrastructure/queue/*.go | PostgreSQL queue using FOR UPDATE SKIP LOCKED for reliable task distribution |
| services/response-api/internal/infrastructure/database/migrate.go | Replaced GORM AutoMigrate with golang-migrate for versioned migrations |
| services/response-api/internal/infrastructure/llmprovider/client.go | Extended timeout to 900s, added API key header support, content serialization helper |
| services/response-api/internal/config/config.go | Added 7 new config options for background workers and webhooks |
| services/media-api/migrations/*.sql | New SQL migration for media_objects table with schema namespacing |
| services/template-api/internal/config/config.go | Standardized to DB_POSTGRESQL_WRITE_DSN |
| pkg/config/types.go | Renamed S3 env vars to AWS standard naming |
| kong/*.yml | Increased response-api timeouts to 900s (15 minutes) |
| docs/guides/background-mode.md | New 419-line comprehensive guide for background mode |
| docs/api/response-api/README.md | Added 413 lines documenting background mode API usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.