Skip to content

Chore[Docs-AI]: use Datadog Feature Flags when streaming quality degrade#35336

Merged
onceLearner merged 4 commits intomasterfrom
reda.elissati/temp-disable-streaming-docs-ai
Mar 17, 2026
Merged

Chore[Docs-AI]: use Datadog Feature Flags when streaming quality degrade#35336
onceLearner merged 4 commits intomasterfrom
reda.elissati/temp-disable-streaming-docs-ai

Conversation

@onceLearner
Copy link
Contributor

@onceLearner onceLearner commented Mar 17, 2026

What does this PR do? What is the motivation?

Non-streaming fallback with feature flag: Added a DOCS_AI_DISABLE_STREAMING feature flag to switch Docs AI responses from streaming (SSE) to a single synchronous request. This mitigates a known upstream issue where streamed chunks arrive with dropped/corrupted tokens — worsened by faster model output (GPT-5.2) and higher traffic. When streaming is disabled, users see a rotating status indicator ("Searching documentation…", "Reviewing relevant pages…", etc.) while the full response is generated.

Merge instructions

Merge readiness:

  • Ready for merge

Note: The DOCS_AI_DISABLE_STREAMING flag should be enabled in Datadog Feature Flags when streaming quality degrades. It can be toggled off once the upstream fix is released.

AI assistance

Additional notes

https://docs-staging.datadoghq.com/reda.elissati/temp-disable-streaming-docs-ai/

The non-streaming path returns the complete Docs AI response in a single request. Response quality and content are identical — only the delivery method changes. The feature flag allows toggling between modes without a deploy.

@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Mar 17, 2026
@onceLearner onceLearner changed the title chore: use feature flag to disable streaming [wip] Chore[Docs-AI]: use Datadog Feature Flags when streaming quality degrade Mar 17, 2026
@onceLearner onceLearner marked this pull request as ready for review March 17, 2026 17:25
@onceLearner onceLearner requested a review from a team as a code owner March 17, 2026 17:25
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5f36d9340

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +20 to +21
const USE_LEGACY_MODEL_FLAG_KEY = 'docs-ai-use-legacy-model';
const DISABLE_STREAMING_FLAG_KEY = 'docs-ai-disable-streaming';

Choose a reason for hiding this comment

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

P1 Badge Preserve backward compatibility for feature flag keys

This change renames both Datadog flag keys to docs-ai-* and drops the previously used DOCS_AI_* names without a fallback check. If the existing flags are still configured under the old keys (as in prior code), resolveFlags() will never enable the non-streaming path or legacy model, so the operational kill switch for streaming degradation can silently fail until flags are recreated/renamed in Datadog.

Useful? React with 👍 / 👎.

Copy link
Contributor

@StefonSimmons StefonSimmons left a comment

Choose a reason for hiding this comment

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

same prompt for preview and live site produces the same results however the preview has an uncorrupted response 👍

@onceLearner onceLearner merged commit 11b5e56 into master Mar 17, 2026
19 checks passed
@onceLearner onceLearner deleted the reda.elissati/temp-disable-streaming-docs-ai branch March 17, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants