Skip to content

fix: validate connector config files - #480

Open
HwangJohn wants to merge 1 commit into
langchain-ai:mainfrom
HwangJohn:fix/connector-config-validation
Open

fix: validate connector config files#480
HwangJohn wants to merge 1 commit into
langchain-ai:mainfrom
HwangJohn:fix/connector-config-validation

Conversation

@HwangJohn

Copy link
Copy Markdown
Contributor

Summary

  • add connector id and config path context when connector config files cannot be read or parsed
  • reject connector config JSON values that are not objects before merging with defaults
  • keep the existing missing-file default config behavior

Why

A malformed or hand-edited ~/.openwiki/connectors/<id>/config.json could previously surface as a raw JSON syntax error, or arrays/primitives could be spread into runtime config values. This makes connector setup failures easier to diagnose and avoids silently accepting invalid config shapes.

No dedicated issue; found during a connector hardening sweep.

Testing

  • corepack pnpm exec vitest run test/connector-config.test.ts passed
  • corepack pnpm run format:check passed
  • corepack pnpm run lint:check passed
  • corepack pnpm run typecheck passed
  • git diff --check passed
  • corepack pnpm test was attempted on Windows and still fails outside this change in existing test/env-behavior.test.ts HOME/permission assertions plus Mermaid/jsdom timeout tests

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.

1 participant