[Agent] Issue #497: after pr 485 merge test error handling m #503

Open
pook wants to merge 50 commits from feat/llm-error-handling-tests into main
Owner

Closes #497

Changes

feat: issue #497 after-pr-485-merge-test-error-handling-m (agent task liancebot497)

Acceptance Criteria

After PR #485 merge, test error handling: mock or configure OpenAI to return 429, 500, and timeout errors. Verify /api/generate returns proper error responses (not 500 crashes), retry logic fires with backoff, and no unhandled promise rejections in logs.


Generated by CEO Planner (priority: 2)

Tokens: 489 in / 20121 out

Closes #497 ## Changes feat: issue #497 after-pr-485-merge-test-error-handling-m (agent task liancebot497) ## Acceptance Criteria After PR #485 merge, test error handling: mock or configure OpenAI to return 429, 500, and timeout errors. Verify /api/generate returns proper error responses (not 500 crashes), retry logic fires with backoff, and no unhandled promise rejections in logs. --- *Generated by CEO Planner (priority: 2)* Tokens: 489 in / 20121 out
When OpenAI returns 429, 500, or timeout errors, the generate endpoints now
return meaningful HTTP responses (503/502/504) with retryable hints instead
of generic 500s. LLMServiceError classification is applied after retry
exhaustion in document-generator, recognized by the global error handler.

27 new tests cover: error classification for all OpenAI/network error types,
document-generator integration with mocked LLM failures, and the full
retry + classify pipeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: issue #497 after-pr-485-merge-test-error-handling-m (agent task liancebot497)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
b8d9526b4b
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/ci.yml
  • bun.lock
  • package.json
  • packages/api/src/db/schema.ts
  • packages/api/src/index.ts
  • packages/api/src/middleware/rate-limit.ts
  • packages/api/src/middleware/security-headers.ts
  • packages/api/src/routes/generate-tos.ts
  • packages/api/src/routes/generate.ts
  • packages/api/src/routes/health.ts
  • packages/api/src/routes/questionnaire.ts
  • packages/api/src/services/document-generator.ts
  • packages/api/src/services/llm.ts
  • packages/api/src/templates/index.ts
  • packages/api/tsconfig.json
  • packages/shared/src/types.ts
  • packages/web/src/app/questionnaire/page.tsx
  • packages/web/src/components/documents/DocumentList.tsx
  • packages/web/src/components/questionnaire/ReviewStep.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/llm-error-handling-tests:feat/llm-error-handling-tests
git switch feat/llm-error-handling-tests
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!503
No description provided.