Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 2, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.

@cursor
Copy link

cursor bot commented Jan 2, 2026

PR Summary

Introduces assistant chat session persistence and overhauls vendor risk assessment data flow with UI updates.

  • Adds AssistantChatModule with JWT-scoped endpoints GET/PUT/DELETE v1/assistant-chat/history using Upstash Redis (fallback in-memory) and 7‑day TTL; OpenAPI updated
  • Chat client: scopes to org, sends X-Organization-Id, hydrates/saves/clears history via new API, and guards org membership in /api/chat
  • Vendor risk assessment: moves data to GlobalVendors (new JSON/version/timestamp fields, migrations), dedupes by domain, increments versions with advisory locks, monthly Trigger schedule, and “ensure vs research” triggering (default no research)
  • Creates/updates a high‑priority Verify risk assessment task (replacing generation placeholder), adjusts polling and skeleton row; removes old generated-task components
  • Vendor UI: new header with cert icons/links, tabs (Overview/Review), risk assessment view/timeline, loading skeletons, and edit sheet entry
  • PDF: skip watermarking encrypted PDFs; improve policy/PDF text cleaning and preserve unknown chars
  • Task management: await audit logs for creation/assignment; minor badge style tweak

Written by Cursor Bugbot for commit d786d79. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 2, 2026

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

2 Skipped Deployments
Project Deployment Review Updated (UTC)
app (staging) Skipped Skipped Jan 2, 2026 8:53pm
portal (staging) Skipped Skipped Jan 2, 2026 8:53pm

@CLAassistant
Copy link

CLAassistant commented Jan 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Marfuen
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@graphite-app
Copy link

graphite-app bot commented Jan 2, 2026

Graphite Automations

"Auto-assign PRs to Author" took an action on this PR • (01/02/26)

1 reviewer was added to this PR based on Mariano Fuentes's automation.

* feat(vendor): implement vendor risk assessment features and UI components

* feat(vendor): enhance vendor risk assessment logic and domain extraction

* refactor(vendor): remove distinct constraint for website in risk assessment

* refactor(vendor): replace ShieldCheck icon with Shield icon in assessment view

* refactor(vendor): remove backfill vendor risk assessment tasks and enhance task handling

---------

Co-authored-by: Tofik Hasanov <[email protected]>
taskItemId: params.taskItemId,
});
return await run();
}
Copy link

Choose a reason for hiding this comment

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

Advisory lock catches all errors causing double execution

The withAdvisoryLock function's error handling structure is flawed. The outer catch block catches errors from both lock acquisition AND the run() callback. If a database operation inside run() throws (e.g., constraint violation), the error is caught, the misleading message "Advisory lock unavailable" is logged, and run() executes a second time without lock protection. Since run() performs database updates and version increments, this causes double writes and incorrect version numbers (e.g., v1v3 instead of v1v2). The catch should only handle lock acquisition failures, not errors from the critical section.

Fix in Cursor Fix in Web

website: {
contains: domain,
},
},
Copy link

Choose a reason for hiding this comment

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

Domain substring matching causes wrong vendor data association

The GlobalVendors lookup uses website: { contains: domain } which performs substring matching and can match unrelated vendors. For example, searching for domain "a.com" would incorrectly match "nota.com", "data.com", or "mega.company". Similarly, "stripe.com" would match any website containing that substring. This causes risk assessment data to be incorrectly read from or written to the wrong vendor records. The pattern is used consistently across multiple files for both reads and writes.

Additional Locations (2)

Fix in Cursor Fix in Web

// Mark as ready for normal UX: clickable + full renderer
await db.taskItem.update({
where: { id: taskItemId },
const data = parseRiskAssessmentJson(description);
Copy link

Choose a reason for hiding this comment

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

Research with null website saves empty data to GlobalVendors

The batch trigger includes vendors without valid websites (line 207: if (!domain) return true), passing vendorWebsite: null in the payload with withResearch: true. If the vendor's website is later updated before the task runs, the task passes the early-return checks (using current DB website) but research evaluates to null because payload.vendorWebsite is still null. The code then calls buildRiskAssessmentDescription with null research, creating empty data that gets saved to GlobalVendors, overwriting any existing risk assessment data for that website.

Additional Locations (1)

Fix in Cursor Fix in Web

* feat(api): add assistant chat history management endpoints

* refactor(api): extract user context validation into a separate method

---------

Co-authored-by: Tofik Hasanov <[email protected]>
data: {
status: VendorStatus.in_progress,
},
});
Copy link

Choose a reason for hiding this comment

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

Vendor status stuck in generating state on task failure

The vendor status is set to VendorStatus.in_progress early in the task execution, but is only set to assessed on successful completion. If the task fails after setting in_progress (e.g., Firecrawl research fails, network errors) and exhausts all retry attempts, there's no failure handler to reset the status. The vendor remains permanently stuck in in_progress state, displaying "generating" in the UI with no automatic recovery mechanism.

Additional Locations (1)

Fix in Cursor Fix in Web

@vercel vercel bot temporarily deployed to staging – portal January 2, 2026 20:35 Inactive
@vercel vercel bot temporarily deployed to staging – app January 2, 2026 20:35 Inactive
@vercel vercel bot temporarily deployed to staging – portal January 2, 2026 20:53 Inactive
@vercel vercel bot temporarily deployed to staging – app January 2, 2026 20:53 Inactive
<div className="flex-1 space-y-6 min-w-0">
{isGeneratedTask ? (
<GeneratedTaskItemMainContent taskItem={taskItem} />
) : (
Copy link

Choose a reason for hiding this comment

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

Old structured risk assessment tasks will display raw JSON

The specialized renderer for existing "Risk Assessment" tasks with structured JSON descriptions (containing kind: "vendorRiskAssessmentV1") was removed. These tasks are now passed to CustomTaskItemMainContent, which uses parseDescription to process the description. Since the structured JSON has neither type: "doc" nor is an array, parseDescription wraps the entire JSON string as plain text via wrapPlainText(desc). Users with existing risk assessment tasks will see raw JSON displayed instead of the formatted risk assessment view with certifications, timeline, and security assessment details.

Additional Locations (1)

Fix in Cursor Fix in Web

@Marfuen Marfuen merged commit 8a3c766 into release Jan 2, 2026
14 of 15 checks passed
@claudfuen
Copy link
Contributor

🎉 This PR is included in version 1.72.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants