Skip to content

feat(api): account-wide naming instructions in userSettings - #9388

Draft
aaronrosenthal wants to merge 2 commits into
ParadevAI:mainfrom
aaronrosenthal:user-settings-naming-instructions-api
Draft

aaronrosenthal wants to merge 2 commits into
ParadevAI:mainfrom
aaronrosenthal:user-settings-naming-instructions-api

Conversation

@aaronrosenthal

@aaronrosenthal aaronrosenthal commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Second of three PRs for #9197. Depends on #9387. This is a fork PR, so it can't be stacked on that branch and also contains its commit. Review only the top commit, feat(api): account-wide naming instructions in userSettings.

userSettings now carries the person's account-wide naming instructions:

  • get returns a new namingInstructions: string | null field. Accounts without a row get null.
  • update takes a new optional namingInstructions: string | null (max 2000 characters, the same limit as the per-project field on the host). The value is trimmed, and blank saves as null.

Compatibility (trpc-compat): both changes are additive. Every existing input stays valid, nothing is tightened, and the output only gains a field. Released desktop and mobile builds call get and update({ experimentalChat }) and are unaffected. The update handler builds the set object explicitly, so a call that omits a field never writes it.

How I tested it

  • user-settings.test.ts:
    • an account with no row gets the defaults, including namingInstructions: null
    • update stores only the fields it was given
    • naming instructions are trimmed, and blank clears them to null
  • In the dev desktop app against the local API: saving the global field (PR 3) wrote the text to user_settings.naming_instructions for the signed-in user, checked in the DB.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Adds account-wide naming instructions to userSettings, the second of three PRs for #9197. get now returns namingInstructions: string | null (null when the account has no row), and update accepts an optional namingInstructions field up to 2000 characters; values are trimmed and blank strings are saved as null. Both changes are additive, so existing clients that pass experimentalChat only are unaffected. Adds a naming_instructions column to user_settings in migration 0190_user_settings_naming_instructions.

Written for commit d3e34ed. Summary will update on new commits.

View guided diff

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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