Skip to content

fix(goal-executor): replace z.record() with z.object().passthrough() in Anthropic schemas#146

Open
Echolonius wants to merge 1 commit into
final-run:mainfrom
Echolonius:fix/anthropic-propertynames-schema
Open

fix(goal-executor): replace z.record() with z.object().passthrough() in Anthropic schemas#146
Echolonius wants to merge 1 commit into
final-run:mainfrom
Echolonius:fix/anthropic-propertynames-schema

Conversation

@Echolonius
Copy link
Copy Markdown

@Echolonius Echolonius commented May 14, 2026

Summary

  • z.record(z.string(), z.string()) in launchAppGrounderSchema emits a JSON Schema with the propertyNames keyword. Anthropic's structured-output validator rejects that keyword with HTTP 400, so any run that routes through the Anthropic path and reaches a launch_app grounder call fails at the API boundary.
  • OpenAI and Google accept propertyNames without complaint, which is why this went unnoticed — the failure only surfaces on the Anthropic call path.
  • Replaces both fields (permissions and arguments) with z.object({}).passthrough() — an open-ended object schema with no keyword constraints — preserving the same runtime behaviour while satisfying the Anthropic validator.

Test plan

  • Run a launch_app grounder call on the Anthropic path and confirm it no longer returns HTTP 400.
  • Confirm OpenAI and Google grounder paths continue to behave correctly — no schema changes on those paths.

Closes #100

Summary by CodeRabbit

  • Bug Fixes
    • Improved input validation for permissions and arguments fields to accept more flexible data formats.

Review Change Stack

…in Anthropic schemas

z.record(z.string(), z.string()) emits a JSON Schema with the `propertyNames`
keyword. Anthropic's structured-output validator rejects that keyword with
HTTP 400 — OpenAI and Google accept it without complaint, so the failure
only surfaced on the Anthropic call path.

Replaces `permissions` and `arguments` in `launchAppGrounderSchema` with
z.object({}).passthrough(): an open-ended object schema with no keyword
constraints. Runtime behaviour is unchanged.

Fixes final-run#100
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 17d28374-0e33-42e3-b21c-46114d1a8395

📥 Commits

Reviewing files that changed from the base of the PR and between fcbb4fb and c4210a8.

📒 Files selected for processing (1)
  • packages/goal-executor/src/ai/schemas.ts

📝 Walkthrough

Walkthrough

The PR loosens validation in the launch-app grounder schema by changing permissions and arguments fields from strict Record<string, string> types to passthrough objects that accept arbitrary nested structures. This eliminates the propertyNames JSON schema keyword that Anthropic's structured-output validator rejects, enabling Claude model compatibility.

Changes

Anthropic Provider Schema Fix

Layer / File(s) Summary
Schema validation loosening
packages/goal-executor/src/ai/schemas.ts
FEATURE_LAUNCH_APP_GROUNDER permissions and arguments fields changed from strict string records to passthrough objects accepting any shape, removing propertyNames constraint incompatible with Anthropic API.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A schema shift, oh what a sight,
From strict records to passthrough delight,
Anthropic Claude can now run free,
No propertyNames to disagree,
The grounder hops toward compatibility!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing z.record() with z.object().passthrough() in Anthropic-related schemas.
Linked Issues check ✅ Passed The PR directly addresses all coding requirements from issue #100: replaces z.record() with z.object().passthrough() for permissions and arguments fields to resolve Anthropic's propertyNames validation rejection.
Out of Scope Changes check ✅ Passed All changes are scoped to the linked issue #100: only the two schema fields (permissions and arguments) in FEATURE_LAUNCH_APP_GROUNDER are modified as required.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude (Anthropic) provider fails at step 1 with HTTP 400: propertyNames not supported

1 participant