Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Summary
Cron jobs failing because gateway passes tools[].type: "custom" to Anthropic Messages API → 400.
Repro
- Version: openclaw 2026.5.19 (a185ca2)
- Platform: macOS 26.5 arm64, node 22.22.2
- Setup: 2 agents (main + crcbot), 11 cron jobs targeting Anthropic + OpenAI
Error
{
"type": "error",
"error": {
"type": "invalid_request_error",
"code": "unknown_parameter",
"message": "Invalid value: 'custom'",
"param": "tools"
},
"status": 400
}
Source
grep -r 'type: "custom"' dist/ shows the literal in src-BSuxs9xi.js + schemas-Bmna8ihM.js (3 occurrences). Anthropic Messages API doesn't accept tools[].type: 'custom' as a valid tool type. Valid: omit type for user-defined tools, or use computer_20241022/text_editor_20241022/bash_20241022 for builtin tools.
Impact
All cron jobs w/ tool-calling agents fail silently. openclaw secrets audit clean, openclaw status clean, but cron list shows 9/11 jobs in error state.
Workaround
openclaw cron disable <id> for affected jobs.
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 21, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Workflow note: Future ClawSweeper reviews update this same comment in place.
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Summary
Keep open: the report has concrete release/provider error evidence, and current main still has a source path where a custom Anthropic session stream can bypass OpenClaw's Anthropic tool-shaping transport.
Reproducibility: yes. at source level: the issue supplies the shipped provider 400 and packaged payload evidence, and current main still has a custom-session stream path that can bypass OpenClaw's Anthropic tool converter. I did not execute a live Anthropic cron job in this read-only review.
Next step
This is a narrow provider/gateway compatibility bug with concrete release evidence, clear current-main source path, and focused validation.
Review details
Best possible solution:
Keep OpenClaw's policy-owned tool inventory intact, but make every Anthropic Messages run path that can carry
customToolsuse OpenClaw's Anthropic tool wire shape or an equivalent provider-owned adapter.Do we have a high-confidence way to reproduce the issue?
Yes, at source level: the issue supplies the shipped provider 400 and packaged payload evidence, and current main still has a custom-session stream path that can bypass OpenClaw's Anthropic tool converter. I did not execute a live Anthropic cron job in this read-only review.
Is this the best way to solve the issue?
Yes: the best fix is at the provider/embedded-runner transport boundary, not in cron or secrets, so Anthropic requests use the accepted tool schema while OpenClaw policy and sandbox tool registration remain unchanged.
Label changes:
issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.issue-rating: 🐚 platinum hermit: Current issue advisory state no longer selects this label.Label justifications:
P1: The issue reports released cron jobs failing now for tool-using Anthropic agents with clean status/audit output.impact:message-loss: Failed scheduled agent runs can suppress expected cron replies or task output.impact:auth-provider: The failure is in provider-specific Anthropic Messages request shaping and stream routing.Acceptance criteria:
What I checked:
Invalid value: 'custom'forparam: tools, with 9 of 11 cron jobs in error state and clean status/audit output.v2026.5.19; the issue targets shipped behavior, not only unreleased main. (a185ca283a74)customTools, which preserves policy filtering but can also reach Pi/provider serialization if the OpenClaw transport is bypassed. (src/agents/pi-embedded-runner/tool-split.ts:5, 9f2c0a80b40f)resolveEmbeddedAgentStreamFnonly forces boundary-aware transport for default stream functions or already-resolved runtime keys; otherwise it returns the session's custom stream function. (src/agents/pi-embedded-runner/stream-resolution.ts:167, 9f2c0a80b40f)session-custom, while runtime-auth custom streams use the boundary-aware Anthropic transport. (src/agents/pi-embedded-runner/stream-resolution.test.ts:91, 9f2c0a80b40f)name, optionaldescription, andinput_schemafields for tools, with no top-leveltype: "custom". (src/agents/anthropic-transport-stream.ts:464, 9f2c0a80b40f)Likely related people:
src/agents/pi-embedded-runner/stream-resolution.ts,src/agents/pi-embedded-runner/tool-split.ts,src/agents/anthropic-transport-stream.ts)src/agents/pi-embedded-runner/run/attempt.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9f2c0a80b40f.
JulyanXu commentedon May 22, 2026
Source-verified. The issue is that OpenClaw's tool schema includes
type: "custom"for user-defined tools, but Anthropic's Messages API doesn't accept this value.Valid Anthropic tool types: Omit
typeentirely for custom tools, or use one of the built-in types (computer_20241022,text_editor_20241022,bash_20241022). Anthropic's API treats tools without atypefield as custom tools by default.Root cause: The tool schema serialization code likely adds
type: "custom"to differentiate custom tools from built-in ones in OpenClaw's internal representation, but this field shouldn't be forwarded to providers that don't support it.Fix location: The provider adapter layer (where tool schemas are transformed before sending to each LLM provider) should strip
type: "custom"when targeting Anthropic, or more generally, strip anytypefield value that isn't in the provider's accepted set.This should be a provider-level normalization, not a global schema change — OpenClaw may legitimately use
type: "custom"internally. The Anthropic provider adapter should filter it before the API call.Pattern for other providers: OpenAI accepts
type: "function"for custom tools. Google acceptsfunctionDeclarations. Each provider adapter should handle thetypefield normalization independently.steipete commentedon Jun 14, 2026
Closing as misattributed after reproducing the exact v2026.5.19 dependency path.
The release pinned
@earendil-works/pi-ai@0.75.1. I installed that exact package and captured its pre-request Anthropic payload with a custom tool. The tool keys were:The tool had no top-level
typefield (Object.hasOwn(tool, "type") === false). Source inspection confirms Pi's shippedconvertToolsemitted only Anthropic'sname/description/input_schemashape plus optional Anthropic fields. OpenClaw's own transport in the same release also omittedtype: "custom". Thetype: "custom"literals found by grepping bundled files came from unrelated schemas/internal records and do not prove that value was sent in an Anthropic request.The reported error shape includes
code: "unknown_parameter"andparam: "tools", so it may have originated from an OpenAI-compatible gateway or another provider route among the mixed Anthropic/OpenAI cron jobs. Current main keeps provider-owned tool serializers and has explicit compatibility shaping for OpenAI-compatible Anthropic-family endpoints.If this still occurs, please open a new issue (or ask to reopen) with the exact provider id, model ref, redacted base URL/endpoint family, one failing cron model selection, and a redacted
before_provider_requestpayload. That evidence would identify the actual adapter without redirecting all official Anthropic/custom streams.