Skip to content

fix(POR-22645): reject nil UUID user lookups before Copilot API calls - #1411

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/por-22645-cursor-automated-triage-response-b158
Draft

fix(POR-22645): reject nil UUID user lookups before Copilot API calls#1411
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/por-22645-cursor-automated-triage-response-b158

Conversation

@cursor

@cursor cursor Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add isNilUuid helper for the nil UUID (00000000-0000-0000-0000-000000000000)
  • Guard CopilotAPI#getInternalUser and #getClient to fail fast with APIError instead of calling Copilot with an invalid id
  • Treat nil UUID token internalUserId / clientId as unauthenticated in authenticate
  • Return null from CopilotAPI#me when the token user id is the nil UUID
  • Unit tests for the helper and Copilot guards

Testing Criteria

  • yarn test src/utils/uuid.test.ts src/utils/CopilotAPI.nil-uuid.test.ts — 5 tests pass
  • Verified nil UUID lookups throw APIError and do not invoke Copilot SDK retrieveInternalUser / retrieveClient

Notes

  • Linear: POR-22645
  • Root cause: tasks-app (or upstream token/data) passed the nil UUID into Copilot user lookups, producing platform error not able to get user record: code [parameter_invalid] error [no user found with id: 00000000-0000-0000-0000-000000000000] in Tasks Sentry.
  • Manual follow-up: inspect Sentry event for workspace/token source; query DB for tasks/comments with createdById / initiatorId = nil UUID if errors persist.

Impact & Surface Area of Change

  • src/utils/CopilotAPI.ts — all internal-user and client lookups
  • src/app/api/core/utils/authenticate.ts — request auth boundary
  • Low risk: converts an upstream/platform 400 into a controlled 400/401 without changing happy-path behavior
Open in Web View Automation 

Guard getInternalUser/getClient against the nil UUID (00000000-0000-0000-0000-000000000000)
so tasks-app returns a controlled APIError instead of surfacing Copilot platform
'not able to get user record' errors to Sentry. Also reject nil UUID ids in auth tokens.

Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

POR-22645

@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview Aug 22, 2026 3:50am

Request Review

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