fix(grounding): restore the pre-existing default persona and refusal - #49
Conversation
#40 made grounding copy configurable and ALSO changed the defaults to neutral wording. The issue specified that defaults stay exactly as they were, and that is the right call for a stronger reason than spec compliance: changing a default silently rewords live user-facing traffic on a patch upgrade, which is not the gateway's decision to make. Restored to "You are a customer-support assistant." and the refusal that offers a human handoff. The objection stands and is now recorded where it is actionable rather than dropped. The doc comments and docs/configuration.md say plainly that these defaults are a support-desk voice, that they are wrong for the claims/clinical/legal deployments that most want grounded answers, and that a deployment with no support desk cannot honour the handoff the refusal promises. Such deployments set `persona` and `refusal` — which is what #40 made possible, and what the tests here prove reaches the user.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe grounding defaults now use a customer-support persona and a refusal message that offers knowledge-base guidance and human support-agent handoff. Tests and configuration documentation assert and describe these defaults. ChangesGrounding defaults
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/api/src/modules/chat/grounding.ts`:
- Around line 18-35: Scope the upgrade-compatibility comments for
DEFAULT_GROUNDING_PERSONA and GROUNDING_REFUSAL to state that the unchanged
wording applies only to upgrades from before grounding copy became configurable;
also update docs/configuration.md lines 355-360 to document that deployments
upgrading from `#40` may receive the restored persona and refusal wording.
In `@packages/api/test/grounding-config.test.ts`:
- Around line 55-61: Update the refusal assertion in the test “keeps the
pre-existing refusal when nothing is configured” to compare GROUNDING_REFUSAL
against the complete expected literal, matching the exact full-string assertion
used by the persona test, rather than checking only for the “human support
agent” substring.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b04e4292-c1e1-4daf-acc0-4b4a56f918b8
📒 Files selected for processing (3)
docs/configuration.mdpackages/api/src/modules/chat/grounding.tspackages/api/test/grounding-config.test.ts
The 'upgrading alters nothing' claim held only for RELEASED versions — a
deployment tracking main between the commit that made grounding copy
configurable and this one did see the neutral wording. Scoped in both the
doc comment and docs/configuration.md.
The refusal test used toContain("human support agent"), which any other
refusal mentioning a support agent would have satisfied. Now asserts the
full literal, as the persona test already did.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/configuration.md`:
- Around line 355-357: Update the upgrade sentence in the persona/refusal
documentation to say that an upgrade from any released version does not change
the wording sent to users, preserving the existing released-version scope.
- Around line 359-360: Update the human-handoff documentation around the
support-desk warning to state that handoff requires an available support agent,
not merely a support desk. Preserve the existing warning about deployments
without a support desk.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b38b2a8f-6143-4417-b0f3-52bcb74af343
📒 Files selected for processing (3)
docs/configuration.mdpackages/api/src/modules/chat/grounding.tspackages/api/test/grounding-config.test.ts
#40 made grounding copy configurable and also changed the defaults to neutral wording. The issue specified that defaults stay exactly as they were. This restores them.
personarefusalWhy this is right beyond spec compliance
Changing a default silently rewords live, user-facing traffic on a patch upgrade. Every existing grounded deployment would have started saying something different to its users without anyone choosing that. That is not the gateway's call to make, and it is a stronger argument than the one I made for changing them.
The objection is kept, not dropped
I still think a support-desk voice is the wrong default, and the refusal promises a human handoff a deployment may have no one to honour. That is now recorded where it is actionable instead of lost:
docs/configuration.mdgains a "Setpersonaandrefusaloutside a support desk" note naming the claims / clinical / legal cases;Configurability — the actual feature from #40 — is untouched, and the tests proving an override reaches the user are unchanged.
pnpm verifygreen: 1262 tests.Summary by CodeRabbit
New Features
Documentation