Skip to content

AJV strict mode warnings: allowUnionTypes not enabled #196

@Vb6Z

Description

@Vb6Z

Description

When schemas registered in the ACP Web GUI contain union types (e.g., "type": ["string", "number"] for optional fields like limitPrice, size, takeProfit, stopLoss), the SDK emits strict mode warnings to stderr on every schema compilation:

strict mode: use allowUnionTypes to allow union type keyword at "#/properties/limitPrice" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/size" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/takeProfit" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/stopLoss" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/closeSize" (strictTypes)

Root Cause

In dist/index.mjs:4118, AJV is initialized without allowUnionTypes:

this.ajv = new Ajv({ allErrors: true });

Suggested Fix

this.ajv = new Ajv({ allErrors: true, allowUnionTypes: true });

Impact

  • Functional impact: None — validation still works correctly
  • Operational impact: These warnings go to stderr, which Railway (and other platforms) classify as error-level logs. This triggers false positive monitoring alerts for any agent using schemas with union types. We had to add noise filters in our monitoring to suppress them.

Environment

  • @virtuals-protocol/acp-node v0.3.0-beta.38 and beta.39
  • Node.js 22.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions