Repository navigation
feat(desktop): account-wide naming instructions for workspaces and branches - #9389
Draft
aaronrosenthal wants to merge 3 commits into
Draft
aaronrosenthal wants to merge 3 commits into
aaronrosenthal wants to merge 3 commits into
Conversation
…anches Naming now layers the person's global instructions (from userSettings) before the project's, and the project wins where they conflict. host-service reads the global text from the API at naming time, with a 3s timeout; a failed read names with the project text only. A project can turn on 'Ignore global naming instructions'. Either text being set enables the custom branch rules, so a global 'feat/' prefix keeps its slash. Closes ParadevAI#9197
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #9197. Third of three PRs. Depends on #9387 and #9388. This is a fork PR, so it also contains their commits. Review only the top commit,
feat(desktop): account-wide naming instructions…. Per rule 9, it should merge only after #9388's API is live.Today naming instructions can only be set per project, and they are stored per host. This PR adds an account-wide "Naming instructions" setting that applies in every project, on every host.
Prompt layering (
ai-workspace-names.ts):buildInstructionsnow takes{ global, project }and emits<global-naming-instructions>first, then<project-naming-instructions>./allowed) apply when either block is set. Without this, a global-only "prefix with feat/" rule would come out asfeatfoo.How the host gets the global text (option 2 in the issue): the new
resolveNamingInstructionsreadsuserSettings.getthrough the host's existing API client when naming runs.workspaces.aiRenamedoes the read in its background chain, so the mutation still returns immediately.Ignore toggle:
projects.ignore_global_naming_instructions(host SQLite migration0039,NOT NULL DEFAULT false).project.setIgnoreGlobalNamingInstructions.project.getreturns the new field.Desktop UI:
settings/components/NamingInstructionsField, which both fields use.ignoreGlobalNamingInstructionsget the old UI (no toggle, no inherited text), because they don't apply global text either.Fallback: deriving the name from the prompt (when the agent CLI can't run) still ignores all instructions. The docs (
workspaces.mdx) now say so.Compatibility: every host-service change is additive (a new procedure and a new output field). Existing English copy is unchanged; the new hint is a separate message, so existing translations stay valid. New strings are translated in all 17 locales.
How I tested it
Unit tests:
ai-workspace-names.test.ts:feat/reply keepsfeat/add-login, while the same reply without instructions becomesfeatadd-loginnaming-instructions.test.ts:NamingInstructionsSection.test.tsx: inherited placeholder and hint; ignored state; an old host shows no toggle and no inherited textIn the dev desktop app (this worktree's renderer, driven over CDP with real clicks and key input, against the local API and host-service):
user_settings.naming_instructionsfor the signed-in user then held that text.project.geton the host returnedignoreGlobalNamingInstructions: true, and the placeholder and hint went back to the defaults.Not verified end to end: an actual AI naming run picking up the global text through the host's API client. That path is covered by the unit tests above.
Checks:
bun run lint,typecheck(host-service, desktop, trpc), andbun run check:i18npass. Desktop settings tests and the fullhost-servicesuite pass, apart from one ordering failure inruntime/pull-requests/pull-requests.test.ts(PR history order). That test passes on its own and this PR doesn't touch that code.Screenshots of steps 1–3 were captured over CDP and will be attached here.
Checklist
type(scope): subject)bun run lintandbun run typecheckpass (CI fails on lint warnings too)Summary by cubic
Adds account-wide naming instructions for AI-generated workspace and branch names, applied in every project and on every host. Global instructions are layered before the project's, and the project's win where the two conflict.
feat/prefix keeps its slash.NamingInstructionsFieldcomponent that shows the global text as the project field's placeholder.Written for commit 2a45a35. Summary will update on new commits.