CopilotKit / CopilotKit/outpost

Factory reset accepts reseed: true but cannot re-seed

Open
#205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: product roadmap roadmap: later
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

POST /api/admin/reset accepts a reseed flag but cannot honour it:

    if (reseed) {
        // The seed script uses a top-level async IIFE with its own PrismaClient,
        // so it cannot be cleanly imported. Manual re-seed is required.
        reseeded = false;
    }

It returns note: 'Manual re-seed required. Run: npx prisma db seed'.

Why it matters

Minor, but the API accepts a parameter it silently declines to act on. The caller has to read the response note to discover the reset left an empty database.

Fix

Refactor the seed script to export a callable seed(prisma) function, keeping the IIFE only as the CLI entry point, then call it from the reset route. That makes reseed: true mean what it says.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the seed script and the POST /api/admin/reset route described in the issue. Refactor the seed script around a callable seed(prisma) entry point while retaining its CLI entry point, then have the reset route invoke it for reseed: true and verify the response no longer reports that manual re-seeding is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, database
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.