refactor(openrouter): extract determineFallbackFeature helper#3088
Merged
chrarnoldus merged 2 commits intomainfrom May 7, 2026
Merged
refactor(openrouter): extract determineFallbackFeature helper#3088chrarnoldus merged 2 commits intomainfrom
chrarnoldus merged 2 commits intomainfrom
Conversation
Replace the legacy /openrouter path check with a system-prompt-based fallback: only default to 'direct-gateway' when the system prompt does not contain the Kilo or OpenClaw markers.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.5-20260423 · 190,979 tokens |
Contributor
|
I see some "You are a personal assistant running inside OpenClaw" and "You are Kilo" as |
markijbema
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
determineFallbackFeaturehelper inapps/web/src/app/api/openrouter/[...path]/route.tsthat decides the fallback value used when nox-kilocode-featureheader is provided./openrouterpath check: the URL no longer influences fallback selection.'direct-gateway'only when the system prompt does not contain eitherYou are KiloorYou are a personal assistant running inside OpenClaw; otherwise it returns''sovalidateFeatureHeaderresolves tonull.Verification
N/A (no manual verification performed; no long-running checks run per instructions).
Visual Changes
N/A
Reviewer Notes
system_prompt_prefixproduced byextractPromptInfo. Both marker strings fit comfortably within that prefix, so the check is equivalent to scanning the full system prompt for these well-known opening phrases.extractPromptInfois called twice on this hot path now (once here, once downstream at line ~440). If that becomes a concern we can thread the result through instead.