Skip to content

[AISAGE-706] feat(ai-gateway): log Reflection reasoning placeholder mutations - #8054

Merged
chrarnoldus merged 2 commits into
mainfrom
fix/reflection-placeholder-logs
Oct 19, 2026
Merged

chrarnoldus merged 2 commits into
mainfrom
fix/reflection-placeholder-logs

Conversation

@chrarnoldus

@chrarnoldus chrarnoldus commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #8018. Jira: AISAGE-706.

This PR logs a warning whenever the gateway adds Reflection reasoning placeholders to a request. That shows how often clients send Reflection history without reasoning, which happens after a model switch, compaction, or with clients that drop reasoning.

[addReflectionReasoningPlaceholders] mutated request with reasoning placeholders
{ model, requestKind, placeholderCount }
  • The log fires once per request, and only when at least one placeholder was added.
  • It matches the existing request-mutation logs ([removeNonSensicalMaxTokens], [applyProviderSpecificLogic] Removed unsupported request-level service tier): console.warn with a structured payload.
  • The payload has only the model, the request kind and a count. Message content is never logged.

The per-API placeholder helpers now return how many placeholders they added. addReflectionReasoningPlaceholders takes the requested model so the log can include it.

Verification

Visual Changes

N/A

Reviewer Notes

The log uses console.warn, like the other request-mutation logs. console.info would also be reasonable, since placeholders are expected during normal operation.

@chrarnoldus chrarnoldus self-assigned this Oct 19, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The change threads the requested model through addReflectionReasoningPlaceholders, returns per-API placeholder counts, and logs a structured warning only when at least one placeholder was inserted; the counting is consistent with the existing mutation logic across all three request kinds.

Files Reviewed (3 files)
  • packages/web-shared/src/lib/ai-gateway/providers/apply-provider-specific-logic.ts
  • packages/web-shared/src/lib/ai-gateway/providers/reflection.ts
  • packages/web-shared/src/lib/ai-gateway/providers/reflection.test.ts

Reviewed by deepseek-v4.1-flash-1017 · Input: 42K · Output: 5.2K · Cached: 225.5K

Review guidance: REVIEW.md from base branch main

@chrarnoldus chrarnoldus changed the title feat(ai-gateway): log Reflection reasoning placeholder mutations [AISAGE-706] feat(ai-gateway): log Reflection reasoning placeholder mutations Oct 19, 2026
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.

3 participants