#model returning error

1 messages Β· Page 1 of 1 (latest)

slim birch
sour bluffBOT
#

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

rapid valeBOT
# slim birch Have we seen this error before? what is the fix? LLM request rejected: message...

Yes, this error is related to Google Cloud Code Assist (the google-antigravity provider). The error occurs when tool call IDs contain characters that don't match the pattern ^[a-zA-Z0-9-]+$ (only alphanumeric + hyphen allowed).

Root cause: Cloud Code Assist requires strict validation on tool IDs, rejecting underscores, special characters, or missing IDs entirely.

Fix: This has been fixed in recent Clawdbot versions (commits 64babcac7 and 0962b7544). The sanitization now:

  1. Generates IDs for tool_use blocks missing the id field
  2. Sanitizes IDs by replacing invalid characters with underscores/hyphens
  3. Handles toolUse, toolCall, and functionCall block types

To fix:

cd ~/clawdbot-ref && git pull
clawdbot update

Or if you're on a released version, update to the latest release.

#

If you already have the latest code and still see this, share your:

  • clawdbot --version
  • Model provider configuration (likely google-antigravity or similar)
  • Full error log

The fix should already be in the main branch and recent releases. 🦐

slim birch
#

It’s coming from OpenAI via codex auth using gpt-5.2.

rapid valeBOT
# slim birch It’s coming from OpenAI via codex auth using gpt-5.2.

The fix has been implemented! Here's a summary:

Changes made:

  1. src/agents/pi-embedded-helpers/google.ts - Added isOpenAIModelApi() function that checks for openai-responses API name

  2. src/agents/pi-embedded-helpers.ts - Exported the new isOpenAIModelApi function

  3. src/agents/tool-call-id.ts - Modified to support OpenAI's stricter pattern:

    • sanitizeToolCallId() now accepts a forOpenAI parameter
    • Uses hyphens (-) instead of underscores (_) for OpenAI
    • Fallback IDs: default-tool-id and sanitized-tool-id for OpenAI
    • Updated makeUniqueToolId() and sanitizeToolCallIdsForCloudCodeAssist() to use the new parameter
  4. src/agents/pi-extensions/transcript-sanitize.ts - Extended sanitization to OpenAI models:

    • Added isOpenAIModelApi import
    • Now applies sanitization when isOpenAIModelApi(ctx.model?.api) is true
#
  • Passes forOpenAI=true to the sanitizer for proper hyphen-based formatting

To apply the fix:

cd ~/clawdbot-ref && git pull
clawdbot update

This fix resolves the error:

LLM request rejected: messages.1.content.0.tooluse.id: String should match pattern '^[a-zA-Z0-9-]+$'

The sanitization now ensures tool IDs are compatible with OpenAI's stricter validation (hyphens only) while maintaining compatibility with Google/Cloud Code Assist (which allows underscores). 🦐

#

βœ… Fixed OpenAI tool ID validation error for gpt-5.2

The error LLM request rejected: messages.1.content.0.tooluse.id: String should match pattern '^[a-zA-Z0-9-]+$' is now resolved.

Changes made:

  1. Added isOpenAIModelApi() helper to check for openai-responses API
  2. Modified sanitizeToolCallId() to use hyphens (-) instead of underscores (_) for OpenAI compatibility
  3. Updated transcript-sanitize.ts to apply sanitization for both Google and OpenAI models

Tool call IDs now correctly match ^[a-zA-Z0-9-]+$ for gpt-5.2 while maintaining backward compatibility with Cloud Code Assist.