mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-18 05:59:42 +02:00
Running an agent against a real model surfaced two failures that unit tests and typechecking could not. Anthropic rejected the whole request with "tools.19.custom.input_schema.type: Field required". Three browser tools (browser_scroll, browser_cookies, browser_storage) are discriminated unions, which convert to a top-level anyOf; providers require an object at the root and refuse anyOf/oneOf/allOf there. Because the rejection is per-request rather than per-tool, one such schema took the entire agent down. They are now flattened into a single object - union of every branch's properties, requiring only what all branches share, with the discriminator collapsed into an enum so no mode is hidden from the model. The real zod schema still validates inside callTool, so a bad combination returns a correctable error instead of breaking the conversation. A tool whose schema cannot be expressed is dropped with a warning rather than poisoning every request. The suspension then reached the frontend but rendered nothing: the chat only built interactive cards for approval-shaped payloads and chat_action, so the run sat suspended with no way to resume. Adds a third interactive variant for the connect card. The approval card was not reusable - it is hard-coded to "Approval required" with Approve/Deny, which is the wrong question here. One suspend payload now serves both surfaces: `components` is what a channel turns into Block Kit, `type` and `setupUrl` are what the in-app chat matches on. Neither minds the other's fields. Verified in the preview against Claude Sonnet 4.5: the agent calls browser_tab_open, the card renders with a working setup link, and clicking "I've connected" resumes the run - which then reports no browser and explains it instead of looping. |
||
|---|---|---|
| .. | ||
| bin | ||
| scripts | ||
| src | ||
| templates | ||
| test | ||
| AGENTS.md | ||
| BREAKING-CHANGES.md | ||
| eslint.config.mjs | ||
| nodemon.json | ||
| package.json | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| vitest.config.base.ts | ||
| vitest.config.integration.testcontainers.ts | ||
| vitest.config.integration.ts | ||
| vitest.config.migration.testcontainers.ts | ||
| vitest.config.migration.ts | ||
| vitest.config.ts | ||
| vitest.tsc-entity-transform.ts | ||
| vitest.workspace-externals.ts | ||