Skip to content

fix(chat): return 403 for inactive chats without writing an execution log - #8024

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-inactive-no-prelog
Sep 19, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-inactive-no-prelog

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • POST /api/chat/[identifier] on a disabled chat now returns 403 right after the chat lookup, the same as GET
  • Previously that branch loaded the workflow, started a LoggingSession and wrote a failed workflow_execution_logs row per request, before chat auth and before the execution rate limits, so anonymous callers could grow the log table and fill the owner's logs with fake failed runs at will
  • A request that never reached execution no longer produces an execution log; the warn log line stays for operators
  • Rate limits stay where they are: moving the chat-execute buckets above auth would let unauthenticated callers drain a password/email chat's execution budget (existing test asserts auth-only POSTs are not metered)

Type of Change

  • Bug fix

Testing

  • Added a POST test for an inactive chat: 403, a single DB read, no LoggingSession start/complete, no auth check; confirmed it fails against the old route
  • app/api/chat/** tests pass (134), lint, check:audits, docs-manifest:check, and type-check pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 19, 2026 7:36pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge and consistently treats inactive chats as rejected before execution admission.

Summary

The PR moves inactive-chat POST handling to a clean pre-admission 403 path.

  • Removes the workflow lookup and failed execution-log write for inactive chats.
  • Preserves the operator warning and existing response semantics.
  • Adds coverage verifying one database read and no authentication or logging work.

Reviews (1) · Last reviewed commit: "fix(chat): return 403 for inactive chats..."

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 96ab25e into staging Sep 19, 2026
35 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/chat-inactive-no-prelog branch September 19, 2026 19:46

This branch was previously deployed

1 inactive deployment
Preview 63e36de8 Deployed Sep 19, 2026 by vercel[bot]
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.

1 participant