[Follow-up] Add append/replace system prompt modes and immutable workspace prompt snapshots#494
Conversation
Implement profile-level custom system prompt settings with append/replace behavior, and persist immutable effective prompts on project creation so existing workspaces remain stable. - add a dedicated system prompt helper module for default prompt construction and append/replace resolution - extend profile API + PG adapters with user system prompt mode/content read/write support - add profile UI controls for mode toggle, editable prompt text, clear action, save button, and cmd/ctrl+Enter submission - snapshot the effective system prompt at project creation and store it for both PG and git metadata paths - update chat context construction to use per-project immutable system prompts when present - add supabase migration for user settings columns, project system_prompt column, and updated/recreated RPC functions
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to [Preview Branch (codex/2026-02-20/github-mention-fr]-user-defined-system-prompts) ↗︎](https://supabase.com/dashboard/project/kciyvgodwmgosahrqpna)
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5c1f8ce3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…eturn-type rules Resolve the Supabase migration failure by explicitly dropping and recreating the key-status RPC before changing its OUT columns. Also restore explicit execute grants after recreation to preserve access semantics. - add before redefining the function with new OUT parameters - add revoke/grant statements for after recreation to keep authenticated execution permissions explicit
Prevent profile PUT requests from unintentionally clearing prompt text or resetting mode when clients send only one of the system prompt fields. - fetch current user system prompt settings before applying partial updates - merge incoming systemPrompt/systemPromptMode fields with existing values instead of coercing missing fields - keep explicit clear behavior when systemPrompt is provided as null/empty
Align server/store tests with the new project system prompt and profile prompt-setting behavior, and restore deterministic mocks where new RPC reads were introduced. - mock rtGetProjectShadowV1 in context tests to prevent unintended Supabase client initialization during pg-mode unit coverage - mock rtGetUserSystemPromptV1 in projects route tests and assert the new p_system_prompt wiring in rt_create_project calls - update pg store/local adapter tests for the expanded rt_create_project signature including p_system_prompt - update user key status mapping assertions to include systemPrompt/systemPromptMode fields
|
@codex, review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcf7d9f9c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
smoke tested a replace system prompt - working |
…lity Ensure project-creation prompt snapshots use the same canvas tool gating as runtime context construction so workspaces do not persist tool-available instructions in git mode. - change getCurrentEffectiveSystemPrompt to accept store mode and gate canvas tools on store.mode === 'pg' plus RT_CANVAS_TOOLS - pass the resolved store mode from POST before computing the effective snapshot prompt
|
@codex, final review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f862c236d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…efresh errors Reduce metadata exposure in list APIs and make profile saves resilient to transient post-save refresh failures so successful writes are not misreported as failed. - strip systemPrompt from git-mode project summaries returned by listProjects while keeping full prompt available via getProject for runtime context - make loadProfile after successful profile PUT best-effort in token/system-prompt save flows and keep success notices even when refresh fails - add regression coverage verifying listProjects omits systemPrompt while getProject retains the snapshot
Motivation
Description
buildDefaultSystemPromptandresolveSystemPromptto centralize default prompt construction and append/replace resolution (src/server/systemPrompt.ts).systemPrompt,systemPromptMode) and wire RPC adapters for persistence (app/api/profile/route.ts,src/store/pg/userSystemPrompt.ts,src/store/pg/userLlmKeys.ts).src/components/profile/ProfilePageClient.tsx).app/api/projects/route.ts,src/store/pg/projects.ts,src/git/projects.ts,src/server/context.ts).system_promptcolumns and updated RPC signatures (src/store/pg/localAdapter.ts,supabase/migrations/20260220145436_user_system_prompt_modes.sql).Testing
npm run lint, which completed successfully.npm run dev) and observed Next.js start (local smoke run), but full E2E Playwright screenshot attempt failed due to the Playwright/Chromium process crashing in this environment (SIGSEGV), so no UI screenshot artifact was produced.Codex Task