Skip to content

[Bug] tools.profile (coding) warns about apply_patch as unknown entry on non-OpenAI providers #40538

@Adam-Researchh

Description

@Adam-Researchh

Summary

When using the built-in coding tools profile with a non-OpenAI provider (e.g. Anthropic), the gateway logs a warning on every session init:

[tools] tools.profile (coding) allowlist contains unknown entries (apply_patch).
These entries won't match any tool unless the plugin is enabled.

This fires repeatedly — on every session start, reset, and tool policy evaluation.

Root Cause

The coding profile's allowlist includes apply_patch (which is an OpenAI-specific tool for multi-file patches). When the active provider is Anthropic/Claude, apply_patch is never registered as a tool, so stripPluginOnlyAllowlist() in tool-policy-pipeline.ts flags it as an unknown entry.

The tool IS in DEFAULT_TOOL_ALLOW and TRUSTED_TOOL_RESULT_MEDIA, so it's intentionally part of the ecosystem — it's just provider-specific.

Impact

  • Warning noise in logs on every session lifecycle event
  • Confusing for users who haven't configured anything custom — the warning suggests misconfiguration but it's the built-in profile
  • Makes it harder to spot real warnings in log output

Expected Behavior

Provider-specific tools in built-in profiles should either:

  1. Be silently ignored when the provider doesn't support them (no warning)
  2. Be conditionally included in the profile based on the active provider
  3. At minimum, the warning should be downgraded to debug level for built-in profile entries

Reproduction

  1. Set tools.profile: "coding" in openclaw.json (or use it as default)
  2. Use any non-OpenAI provider (e.g. anthropic/claude-sonnet-4-6)
  3. Start a session
  4. Check gateway.err.log — warning appears

Environment

  • OpenClaw 2026.3.7
  • Provider: anthropic/claude-opus-4-6
  • Config: tools.profile: "coding", tools.exec.security: "full"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions