Skip to content

feat: disclaimer option parity for ASP.NET Core ChatKit wrapper - #8

Open
SamuelMcAravey with Copilot wants to merge 3 commits into
mainfrom
copilot/add-chatkit-disclaimer-option
Open

feat: disclaimer option parity for ASP.NET Core ChatKit wrapper#8
SamuelMcAravey with Copilot wants to merge 3 commits into
mainfrom
copilot/add-chatkit-disclaimer-option

Conversation

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

The ASP.NET Core wrapper already had the full disclaimer plumbing in C# (ChatKitAspNetCoreOptions.Disclaimer, tag-helper attributes, BuildDisclaimerConfig, and runtimeHost.js forwarding) but lacked a JS-level test covering the runtime passthrough and any documentation.

Changes

  • entry.test.mjs — Extends the buildOptions test to include a disclaimer payload and asserts options.disclaimer.text / options.disclaimer.highContrast are forwarded to ChatKit options.

  • chatkit-tag-helper.md — Adds a "Disclaimer" section covering:

    • disclaimer-text and disclaimer-high-contrast tag-helper attributes
    • Global defaults via ChatKitAspNetCoreOptions.Disclaimer
    • Per-instance overrides
    • Null-handling contract (block omitted entirely when no text is set)

Example

<incursa-chatkit-hosted
    session-endpoint="/api/chatkit/session"
    action-endpoint="/api/chatkit/action"
    disclaimer-text="AI may make mistakes. Verify important details."
    disclaimer-high-contrast="true" />

Or globally with a per-instance override:

builder.Services.AddOpenAIChatKitHosted(options =>
{
    options.Disclaimer.Text = "AI may make mistakes. Verify important details.";
    options.Disclaimer.HighContrast = false;
});
Original prompt

This section details on the original issue you should resolve

<issue_title>chatkit disclaimer option parity</issue_title>
<issue_description>## Summary
The upstream ChatKit.js option surface supports a disclaimer block below the composer, but the ASP.NET Core wrapper does not currently expose it.

Acceptance criteria

  • ChatKitAspNetCoreOptions can configure disclaimer text and high-contrast mode.
  • The <incursa-chatkit> surface can override the configured disclaimer per instance.
  • The packaged runtime forwards disclaimer to useChatKit(...).
  • Tests cover serialization and null-handling behavior.
  • Docs include a simple example showing disclaimer usage.

Related

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: SamuelMcAravey <11021165+SamuelMcAravey@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ChatKit disclaimer option to ASP.NET Core wrapper feat: disclaimer option parity for ASP.NET Core ChatKit wrapper Mar 20, 2026
Copilot AI requested a review from SamuelMcAravey March 20, 2026 03:47
@SamuelMcAravey
SamuelMcAravey marked this pull request as ready for review March 20, 2026 05:52
Copilot AI review requested due to automatic review settings March 20, 2026 05:52
@github-actions

Copy link
Copy Markdown

Test Docs Summary

  • Total tests: 24
  • Compliant: 24 (100.0%)
  • Missing required: 0
  • Invalid format: 0

Artifacts: testdocs (docs/testing/generated)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds test and documentation coverage for the ASP.NET Core ChatKit wrapper’s existing “disclaimer” option passthrough, ensuring the runtime forwards disclaimer configuration into ChatKit.js options and documenting tag-helper usage.

Changes:

  • Extend the JS runtime buildOptions test to assert disclaimer.text and disclaimer.highContrast are forwarded.
  • Add a new “Disclaimer” documentation section describing tag-helper attributes, global defaults, overrides, and omission behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Incursa.OpenAI.ChatKit.AspNetCore/ClientApp/chatkit-runtime/src/entry.test.mjs Adds assertions that buildOptions(...) forwards disclaimer into the ChatKit options object.
docs/30-contracts/chatkit-tag-helper.md Documents disclaimer configuration via tag-helper attributes and global ASP.NET Core options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

disclaimer-high-contrast="true" />
```

The disclaimer block is omitted from the serialized config entirely when no text is configured. Setting `disclaimer-high-contrast` alone without a text value has no effect.

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence is inaccurate as written: disclaimer-high-contrast can have an effect without a per-instance disclaimer-text if a global default options.Disclaimer.Text is configured (the tag helper will then serialize the disclaimer using the default text plus the overridden high-contrast value). Consider rewording to clarify that high-contrast alone has no effect only when no disclaimer text is configured anywhere (neither per-instance nor globally).

Suggested change
The disclaimer block is omitted from the serialized config entirely when no text is configured. Setting `disclaimer-high-contrast` alone without a text value has no effect.
The disclaimer block is omitted from the serialized config entirely when no disclaimer text is configured anywhere (neither per-instance nor globally). In that case, setting `disclaimer-high-contrast` alone without a text value has no effect.

Copilot uses AI. Check for mistakes.
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.

chatkit disclaimer option parity

3 participants