Skip to content

feat: per-profile coding prompt behavior override - #215

Draft
Kunde21 wants to merge 5 commits into
happier-dev:devfrom
Kunde21:profile-system-prompt
Draft

feat: per-profile coding prompt behavior override#215
Kunde21 wants to merge 5 commits into
happier-dev:devfrom
Kunde21:profile-system-prompt

Conversation

@Kunde21

@Kunde21 Kunde21 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds per-profile overrides for the two coding system-prompt behavior knobs — session title updates and response options — with the account-level setting remaining the default. A profile can override either knob; any knob omitted from the profile inherits the global account default.

Changes

  • protocol (packages/protocol): new CodingPromptBehaviorOverrideV1Schema (partial — no per-field defaults, so omit = inherit global) nested as optional codingPromptBehaviorV1 on AIBackendProfileSchema. Adds resolveCodingPromptBehaviorV1WithOverride() and applyCodingPromptBehaviorOverrideToSettings(). A malformed override is dropped via .catch({ v: 1 }) so the profile itself stays valid.
  • cli (apps/cli): resolveEffectiveCodingPrompt.ts resolves the selected profile by id (non-throwing) and merges its override over global settings when building the base coding prompt. Built-in / unknown / override-free profiles fall back to the global default — unchanged behavior.
  • ui (apps/ui): getProfileCodingPromptBehaviorOverride (read) + buildCodingPromptBehaviorOverrideV1 (save) helpers, and a profile-level "Coding prompt behavior" editor section with two dropdowns, each offering "Use system default" to inherit the account setting. i18n across en + 9 locales.

Verification

  • protocol: 1289 unit tests pass; build + typecheck clean.
  • cli: 10 unit tests pass (3 new override tests, RED→GREEN); typecheck clean.
  • ui: typecheck exit 0; ProfileEditForm suite 18/18 pass (4 existing render suites + 9 new helper tests).

Notes

  • Backward compatible: field optional, no migration, no account-settings version bump.
  • Non-English locales use English baseline copy for the new keys; translation review is the only outstanding follow-up.

Draft — opening for early review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Note

Add per-profile coding prompt behavior override for session title updates and response options

  • Adds codingPromptBehaviorV1 as an optional field on backend profiles, allowing each profile to override session title update mode and response options mode independently of account-level defaults.
  • Introduces CodingPromptBehaviorOverrideV1Schema, resolveCodingPromptBehaviorV1WithOverride, and applyCodingPromptBehaviorOverrideToSettings in @happier-dev/protocol to validate, merge, and apply per-profile overrides.
  • Updates resolveEffectiveCodingPromptPlan in the CLI agent to read the active profile's override and apply it before building the base coding prompt plan.
  • Adds two dropdown controls to the profile edit form (ProfileEditForm) for selecting session title update mode and response options mode, initialized from the profile and included in dirty tracking and save payload.
  • Adds translation strings for the new settings section across all supported locales.

Macroscope summarized e669080.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b08aa5f5-dfc9-47f4-b0ad-4c8235c6c59c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

Kunde21 added 5 commits August 4, 2026 13:38
Adds CodingPromptBehaviorOverrideV1Schema as an optional nested field on AIBackendProfileSchema, with resolveCodingPromptBehaviorV1WithOverride() and applyCodingPromptBehaviorOverrideToSettings(). Partial semantics: omitted fields inherit the global account default (no per-field defaults). Malformed overrides are dropped via .catch({ v: 1 }) so the profile itself stays valid. Symbols exported from the package barrel.
resolveEffectiveCodingPromptPlan resolves the selected profile by id (non-throwing) and merges its codingPromptBehaviorV1 override over global settings when building the base prompt. Profiles without an override, unknown ids, and built-in profiles fall back to the global default, preserving current behavior.
Derived helper reading a profile's codingPromptBehaviorV1 override (null when absent). Backs the upcoming profile-editor section; pure unit tests cover full, partial, absent, and malformed overrides.
Pure builder that turns explicit per-knob choices into a CodingPromptBehaviorOverrideV1 (or undefined when neither knob is set), preserving omit-means-inherit semantics on save. Unit tests cover partial, full, and null handling.
Adds a profile-level Coding prompt behavior section to ProfileEditForm with two dropdowns (session title updates + response options), each offering 'Use system default' to inherit the account setting. Wires state, isDirty tracking, and save through buildCodingPromptBehaviorOverrideV1 so omitted knobs stay inherited. Adds i18n keys across en + 9 locales (English baseline copy; translation review pending).
@Kunde21
Kunde21 force-pushed the profile-system-prompt branch from 316fdad to e669080 Compare August 4, 2026 06:51
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