[Agent] Issue #391: add processonuncaughtexception and proce #396

Open
pook wants to merge 49 commits from agent-task/391 into main
Owner

Closes #391

Changes

feat: issue #391 add-processonuncaughtexception-and-proce (agent task liancebot391)

Acceptance Criteria

Add process.on('uncaughtException') and process.on('unhandledRejection') handlers at the application entry point. Log the error with structured JSON including stack trace, timestamp, and request context if available. For unhandled rejections, log and continue (with monitoring alert). For uncaught exceptions, log and trigger graceful shutdown (close Prisma connections, close HTTP server, then process.exit(1)). This prevents silent crashes and ensures errors are observable in production logs. Reference: contractpilot has equivalent issue #335.


Generated by CEO Planner (priority: 3)

Tokens: 14 in / 3790 out

Closes #391 ## Changes feat: issue #391 add-processonuncaughtexception-and-proce (agent task liancebot391) ## Acceptance Criteria Add process.on('uncaughtException') and process.on('unhandledRejection') handlers at the application entry point. Log the error with structured JSON including stack trace, timestamp, and request context if available. For unhandled rejections, log and continue (with monitoring alert). For uncaught exceptions, log and trigger graceful shutdown (close Prisma connections, close HTTP server, then process.exit(1)). This prevents silent crashes and ensures errors are observable in production logs. Reference: contractpilot has equivalent issue #335. --- *Generated by CEO Planner (priority: 3)* Tokens: 14 in / 3790 out
feat: issue #391 add-processonuncaughtexception-and-proce (agent task liancebot391)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
34a2bf41a0
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 agent-task/391:agent-task/391
git switch agent-task/391
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!396
No description provided.