#error when using chatgpt model

1 messages · Page 1 of 1 (latest)

gentle thunder
#

@cerulean topaz
I keep getting this error when I try to use chatgpt " Agent failed before reply: (0 , _agentHarnessRuntime.hasBeforeToolCallPolicy) is not a function."
when I give this command:
openclaw models status --probe
I get what you see in the image. any idea why this is the case?

calm hawkBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

bronze merlinBOT
cerulean topazBOT
# gentle thunder <@1457407575476801641> I keep getting this error when I try to use chatgpt " Ag...

That OpenAI line is probably not an API-key problem. The screenshot shows:

  • google/gemini-3.1-pro-preview probes OK
  • Anthropic is failing because the Anthropic account has low credit balance
  • OpenAI fails with (0 , _agentHarnessRuntime.hasBeforeToolCallPolicy) is not a function

That last one looks like a version/runtime mismatch: newer OpenAI/Codex runtime code is trying to call hasBeforeToolCallPolicy, but the installed OpenClaw package/runtime pieces don’t line up. OpenAI openai/gpt-* models use the Codex app-server runtime path, so it can fail differently than Gemini.

First thing: what does this show?

openclaw --version

Then I’d update/restart and reprobe:

cerulean topazBOT
# gentle thunder <@1457407575476801641> I keep getting this error when I try to use chatgpt " Ag...
openclaw update
openclaw gateway restart
openclaw models status --probe

If you’re running from a git/source checkout instead of the packaged install, update/build from that checkout with pnpm install, pnpm build, and pnpm ui:build, then restart the gateway.

Docs: https://docs.openclaw.ai/help/faq and https://docs.openclaw.ai/install/updating

If it still happens after updating, please file it with your openclaw --version, install method, Node version, and the probe output: https://github.com/openclaw/openclaw/issues