mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:00:50 +00:00
feat: declare openai catalog suppressions
This commit is contained in:
@@ -1102,6 +1102,9 @@ export function resolveProviderBuiltInModelSuppression(params: {
|
||||
env?: NodeJS.ProcessEnv;
|
||||
context: ProviderBuiltInModelSuppressionContext;
|
||||
}) {
|
||||
// Deprecated compatibility fallback. Static suppression rules should live in
|
||||
// manifest modelCatalog.suppressions so list/model resolution can answer
|
||||
// without loading provider runtime.
|
||||
for (const plugin of resolveProviderPluginsForCatalogHooks(params)) {
|
||||
const result = plugin.suppressBuiltInModel?.(params.context);
|
||||
if (result?.suppress) {
|
||||
|
||||
@@ -966,11 +966,11 @@ export type ProviderBuildUnknownModelHintContext = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Built-in model suppression hook.
|
||||
* Built-in model suppression hook context.
|
||||
*
|
||||
* Use this when a provider/plugin needs to hide stale upstream catalog rows or
|
||||
* replace them with a vendor-specific hint. This hook is consulted by model
|
||||
* resolution, model listing, and catalog loading.
|
||||
* @deprecated Use manifest `modelCatalog.suppressions` for static suppression
|
||||
* rules. Runtime suppression hooks remain as compatibility fallback for
|
||||
* plugins that cannot express a rule declaratively yet.
|
||||
*/
|
||||
export type ProviderBuiltInModelSuppressionContext = {
|
||||
config?: OpenClawConfig;
|
||||
@@ -1480,6 +1480,10 @@ export type ProviderPlugin = {
|
||||
* Return `{ suppress: true }` to hide a stale upstream row. Include
|
||||
* `errorMessage` when OpenClaw should surface a provider-specific hint for
|
||||
* direct model resolution failures.
|
||||
*
|
||||
* @deprecated Use manifest `modelCatalog.suppressions` for static suppression
|
||||
* rules. Runtime suppression hooks remain as compatibility fallback for
|
||||
* plugins that cannot express a rule declaratively yet.
|
||||
*/
|
||||
suppressBuiltInModel?: (
|
||||
ctx: ProviderBuiltInModelSuppressionContext,
|
||||
|
||||
Reference in New Issue
Block a user