docs: document fail-closed behavior for rejected modelPatterns · openclaw/openclaw@36f269d
SebTardif
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -455,6 +455,9 @@ function resolveModelSupportMatchKind(
|
455 | 455 | ): ModelSupportMatchKind | undefined { |
456 | 456 | const patterns = plugin.modelSupport?.modelPatterns ?? []; |
457 | 457 | for (const patternSource of patterns) { |
| 458 | +// compileSafeRegex rejects patterns with nested repetition (ReDoS risk) |
| 459 | +// and returns null. Rejected patterns are silently skipped: the plugin |
| 460 | +// will not match via that pattern but other patterns/prefixes still apply. |
458 | 461 | const regex = compileSafeRegex(patternSource, "u"); |
459 | 462 | if (regex?.test(modelId)) { |
460 | 463 | return "pattern"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。