fix: honor per-instance connectorConfig in gmail, slack, x connectors#288
Conversation
ingestion.ts passes each source instance's connectorConfig overrides to every connector, but only hackernews and web-search merged them on top of the on-disk config. gmail, slack, and x read only the disk config, so per-instance overrides from onboarding were silently dropped for those three connectors. Apply the same merge pattern the other two connectors already use: disk config first, then options.connectorConfig overrides on top. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Greg Land (@bikeusaland) thanks for the PR! Could we get some tests for this? |
Adds test/connector-config-overrides.test.ts, addressing the review request on langchain-ai#288. Each test points $HOME at a throwaway temp dir (the same pattern used by onboarding/env-behavior tests), writes an on-disk connector config, and asserts that options.connectorConfig is merged on top of it. The tests are network-free: they observe which short-circuit gate the run stops at (enabled -> "skipped", missing token -> "error"), so the merge behavior is proven without any fetch. Verified the x/slack cases fail against the pre-fix code (they return "skipped" instead of "error"). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks Colin Francis (@colifran)! Added tests in Approach: the gmail/slack/x connectors read config from
I confirmed the x/slack tests fail against the pre-fix code (returning |
Colin Francis (colifran)
left a comment
There was a problem hiding this comment.
Nice one. Thanks Greg Land (@bikeusaland)!
Problem
ingestion.tspasses each source instance'sconnectorConfigoverrides to every connector:But only
hackernewsandweb-searchactually merged those overrides on top of the on-disk config:gmail,slack, andxread only the on-disk config and ignoredoptions.connectorConfigentirely. As a result, per-instance overrides defined during onboarding (e.g. a differentquery,maxMessages, orstreamsfor a specific source instance) were silently dropped for those three connectors — no error, just the on-disk defaults.Fix
Apply the exact merge pattern the other two connectors already use to
gmail,slack, andx: read the on-disk config first, then spreadoptions.connectorConfigon top so per-instance overrides win.No behavior change for users who don't set per-instance overrides (the spread of an empty object is a no-op).
Verification
typecheck,lint:check,format:check, and the full test suite (200 tests) all pass.Note: the source connectors currently have no unit-test harness (they call
readConnectorConfigon the real~/.openwikihome and globalfetchwith no injection seam), so a directingest()regression test is out of scope here — it depends on the broader connector-testability work. This change is the same one-line merge pattern already proven by the two connectors that had it.🤖 Generated with Claude Code
Related PRs
Part of a batch from a single codebase-review pass. Independent,
main-based branches that can merge in any order.Security
Correctness
Feature
(This PR is #288.)