feat(automation): ADR-0096 follow-ups — runtime re-materialization + connector origin (#2977)#3001
Merged
Merged
Conversation
…connectors (#2977) Provider-bound declarative `connectors:` instances materialized only at boot, so a connector published from Studio (or a dev reload) did not become dispatchable until a restart. `materializeDeclaredConnectors` is now a reconcile against the declared set, run at boot (fatal) and on `metadata:reloaded` (soft): - Adds newly-declared instances, tears down removed / newly-`enabled:false` ones (calling their `close`, e.g. an MCP connection), and re-materializes only those whose signature — a stable hash of provider + providerConfig + auth + identity — changed. An unchanged instance is left untouched (no needless MCP reconnect on an unrelated metadata reload). - Boot keeps the "fail loudly" contract (throws → fatal bootstrap). Reload is soft: unknown provider / unresolvable credentialRef / factory failure / name conflict is logged and the entry skipped, never crashing the live server; a changed instance's old connector keeps serving until its replacement materializes successfully. Tracking (`materializedConnectorClosers` array → `materializedConnectors` Map) carries the signature + close per name. 6 new reload tests (add/remove/disable/ unchanged/changed/soft-failure); service-automation suite green (285 tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pbmw3pMqNJfPbkvwh9Fkjs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…-0096 #2977) `getConnectorDescriptors()` (served by GET /api/v1/automation/connectors) now includes `origin: 'plugin' | 'declarative'` per connector, so a designer can tell a materialized declarative instance (ADR-0096) apart from a plugin-registered connector. Additive: the field is always present; existing consumers ignore it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pbmw3pMqNJfPbkvwh9Fkjs
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to the merged ADR-0096 (#2994). Tracking: #2977. Two cohesive additions to
@objectstack/service-automation:1. Runtime re-materialization
Provider-bound declarative
connectors:instances (ADR-0096) materialized only at boot — a connector published from Studio, or introduced by a dev reload, did not become dispatchable until a full restart.materializeDeclaredConnectorsis now a reconcile against the declared set, run both at boot and onmetadata:reloaded(the Studio-publish / dev-reload hook that already re-syncs flows):enabled:falseones (calling theirclose, e.g. an MCP connection); re-materialize only instances whose signature — a stable hash ofprovider+providerConfig+auth+ identity — changed. An unchanged MCP instance is not reconnected on an unrelated metadata reload.providerConfig/ unresolvablecredentialRef/ name conflict aborts startup.Tracking moved from a
materializedConnectorClosersarray to amaterializedConnectorsMap (name →{ signature, close }).2. Connector
originon the descriptorConnectorDescriptor(served byGET /api/v1/automation/connectors) now carriesorigin: 'plugin' | 'declarative', so the flow designer can distinguish a materialized declarative instance from a plugin-registered connector. Additive — the field is always present; existing consumers ignore it. (Enables the Studio picker to label declarative connectors; that UI change lands separately inobjectui.)Verification
origin: asserted on the descriptor.service-automationgreen (26 files, 285 tests);runtimedispatcher green (523 tests) — the new required descriptor field breaks no consumer. Full DTS build clean; ESLint clean; changeset included.Compatibility
Additive — boot behavior is byte-for-byte unchanged (same
fatal: truepath); the descriptor gains a field. No schema or authorable-key changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pbmw3pMqNJfPbkvwh9Fkjs