Skip to content

fix(service-automation): end the backoff retry of a degraded connector on a configuration fault - #28014

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-o8znbc
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-o8znbc

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #27992

Clause-②: no
Metadata-protocol: none
Skills-docs: follow-up owed — content/docs/automation/connectors.mdx (its fault table has no row for a configuration fault met on a degraded instance's retry; git grep -n -i degraded -- skills finds no retry wording; docs/adr/0097-declarative-connector-instances.md §degrade is governed and left as is)

维护者速读

  • 改了什么:连接器在启动时连不上上游会进入「降级」并按退避定时重试;如果之后重试时上游可达、但配置本身有错(例如 include 写了上游没有的工具),现在会停止重试,并把原因换成配置错误的原文。
  • 为什么改:之前这种情况只记一条日志,实例仍留在重试集合里,连接器列表一直显示过时的「连不上」原因,并每 5 分钟徒劳地重连一次;ADR-0097 规定配置错误不重试。
  • 风险与回滚:只影响「已降级且重试时遇到配置错误」这一条路径;凭据被拒与上游仍不可达两条路径不变(有对照测试)。回滚即还原本 PR 的 plugin.ts。
  • 先看:packages/services/service-automation/src/plugin.ts(工厂 catch 里新加的分支,与新方法 failDegradedConnectorInstance);connector-retry-configuration-fault.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/service-automation exec vitest run --maxWorkers=2 src/connector-retry-configuration-fault.test.ts,预期 6/6 通过。
  • 需要你做的:无,席位落地。

What changes

reconcileDeclaredConnectors routes a provider factory's throw three ways: a credential rejection holds, an upstream-unavailable fault degrades and retries on the backoff, and anything else is a configuration fault that fail()s (fatal at boot, logged and skipped on a reload). The skip left an instance that was already degraded in degradedInstances, with its husk still carrying the stale "could not reach" reason, so the backoff timer kept reconnecting against a fault no retry can clear.

Now, on a soft run, a configuration fault met by an instance in degradedInstances goes to a new failDegradedConnectorInstance:

  • The instance is held (the existing held flag the credential path uses): scheduleDeclarativeRetry skips it, and a reconcile with the same signature skips it. A change of its declaration or a restart re-attempts it.
  • With no live connector, the husk is registered again with the provider's configuration message as its degradedReason, so GET /api/v1/automation/connectors and the connector_action refusal name the configuration fault.
  • With a live connector (a changed entry whose new configuration was pending a retry), the old connector keeps serving and the retry stops.
  • One error record says the instance is no longer retried; the provider's message rides meta (finding(service-automation): connector 物化失败的 fail() 也是 ${err.message} 单行插值,同 #5048 的类别、另一个接缝 #5575).

Untouched: the boot path (still fatal), a configuration fault on an instance that was not degraded (still logged and skipped), the credential hold path, and the unavailable degrade path.

Reading chosen for "the failed state": ConnectorState (packages/spec/src/integration/connector-descriptor.ts) has only ready and degraded, so the descriptor keeps state: 'degraded' and the failure is carried by the replaced reason plus the ended retry. Adding a failed state would widen a published spec type and is outside this card.

Tests

New packages/services/service-automation/src/connector-retry-configuration-fault.test.ts, under fake timers, with fake mcp and openapi provider factories shaped like the real ones (unavailable marker while down, a plain Error naming providerConfig.include once up). The openapi pin needed no provider-package edit: the path is provider-agnostic in plugin.ts.

  • mcp / openapi: degraded at boot, the backoff retry meets the include fault, the descriptor's degradedReason is the configuration message and no longer "could not reach", and 64 × the base delay later the factory has not been called again.
  • An unchanged reload does not re-attempt it; an edit of the declaration does and recovers it to ready.
  • A changed entry pending a retry: the old connector keeps serving and the retry stops.
  • Control: an upstream still unreachable on the retry keeps degrading and is retried again.
  • Control: a credential refused on the retry keeps its hold path.

Acceptance notes

  • The connector_action refusal (builtin/connector-nodes.ts) still ends with "the platform retries automatically" for every degraded husk, a held one included (a refused credential today, a configuration fault after this PR); the engine's Connector registered DEGRADED warn likewise says "the materializer retries with backoff". Both are outside this card's file surface, so the reason text names the fault but the sentence after it still promises a retry.
  • The other per-instance fail() arms in reconcileDeclaredConnectors (no provider factory, unparseable retryConfig, host credential resolver throwing) can also be met by an instance that is already degraded, after an edit; they keep the old skip-and-retry behaviour. This PR routes only the factory's configuration fault, which is the card's mechanism.
  • Not touched, as ordered: a misspelt narrowing include on a hot reload of a live connector still keeps the wider set serving.

Verification

All readings at head fbe1de19.

Reproduction on main (red), fix (green), ablation, restore
  • On main (46943657's plugin.ts, with the new test file): Tests 4 failed | 2 passed (6). The mcp and openapi cases fail on the reason (expected 'connector-mcp provider: connector …' to match /providerConfig\.include names 'nope'/, the stale "could not reach" text), and the changed-entry case fails with expected 67 to be 3: 67 factory calls in 64 base delays. The two controls pass.
  • With the fix: Tests 6 passed (6).
  • Ablation through scripts/ablation-replace.mjs, anchor if (!opts.fatal && this.degradedInstances.has(name)) { replaced by if (false /* ABLATION */ && this.degradedInstances.has(name)) {: anchor 1 to 0, blob 95e8c37606da to 577056522a42; run Tests 4 failed | 2 passed (6) (the same four; both controls stay green); restore: blob after restore equals the blob at HEAD (95e8c37606da), git diff HEAD empty; re-run Tests 6 passed (6). The test imports ./plugin.js from source, so no dist/ leg applies.
Package suite and typecheck
  • pnpm --filter @objectstack/service-automation test: Test Files 222 passed (222), Tests 2836 passed (2836).
  • pnpm --filter @objectstack/service-automation typecheck: exit 0 (check:test-typecheck: OK).
dispatch-gates families (60 derived, 60 run, 0 NOT-MEASURED) and pnpm lint

Run after a whole-tree turbo run build (exit 0). dispatch-gates --ran: 60 derived families accounted for, 60 run, 0 NOT-MEASURED.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/check-tenant-audit-census.mjs :: exit 0
node scripts/check-tenant-audit-census.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:durability-log-level :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm lint :: exit 0

Generated by Claude Code

…r on a configuration fault

A degraded declarative instance whose retry meets a configuration fault
(an mcp or openapi include naming what the upstream does not offer) was
logged and skipped while staying in the retry set, so the stale
"could not reach" reason stayed and the timer kept reconnecting. It is
now held with the configuration reason: no timer retry, no re-attempt
on an unchanged reload; an edit of the declaration or a restart
re-attempts it.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czEP1ZwBWHusgCZugF
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-automation, touching 3 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/flows.mdx (via AutomationServicePlugin (symbol, a top-level class))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-6.mdx (via AutomationServicePlugin (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 58 of 210 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from cdc2ebcafcc9d6ce63cfc059f76818392ba42128 — the merge of head fbe1de197eabf684e6437116d4ba555af2de1413 into base e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cdc2ebcafcc9d6ce63cfc059f76818392ba42128 && git checkout cdc2ebcafcc9d6ce63cfc059f76818392ba42128
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1 fbe1de197eabf684e6437116d4ba555af2de1413 && git checkout -B drift-repro e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1 && git merge --no-ff fbe1de197eabf684e6437116d4ba555af2de1413

node scripts/docs-audit/affected-docs.mjs --json e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs e199adfb79ba2eddb79ad7d5fb0e827c6fb653c1 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia

Seat ACCEPT · PR #28014 · head fbe1de197eabf684e6437116d4ba555af2de1413 · 2026-10-30T08:20Z

维护者速读

A declarative connector that was unreachable at boot sits degraded and retries on a backoff. Before this change, if a retry later reached the upstream and the provider refused the instance's configuration (for example an include naming a tool the MCP server does not list), the instance stayed on the retry timer with the stale "could not reach" reason. Now that retry ends it: the instance is held with the configuration reason, and only an edit of its declaration or a restart re-attempts it, as ADR-0097 says for configuration faults. A refused credential keeps its hold path, and an unreachable upstream keeps retrying.

席位核对

  • Shape: draft → main, Fixes #27992, 3 files: plugin.ts (+50, one new branch in the reconcile catch and one helper), a new test file, and a changeset (@objectstack/service-automation patch).
    • check-governed-merges --pr 28014: NOT governed, +292 / −0.
  • Read of the diff: the new branch runs only when the call is not fatal (not boot) and the instance is already degraded. It sets the existing held flag with the configuration reason. It re-registers the husk with that reason unless a previously materialised connector is still serving, and logs once at error, with the provider's message in meta per finding(service-automation): connector 物化失败的 fail() 也是 ${err.message} 单行插值,同 #5048 的类别、另一个接缝 #5575. The boot-time and reload-time paths for an instance that is not degraded are untouched.
  • Deviation the seat accepted: triage 6516917595 says "into the failed state". ConnectorState has only ready and degraded, so the dev reused the existing held mark. Every observable part of the graded rule holds: the reason is replaced, the retry stops, and an edit or a restart re-attempts. No new state was added to a published type.
  • Tests: 6 cases. mcp and openapi each take the configuration reason and are not retried across 64× the base delay. An unchanged reload does not re-attempt, and an edit recovers to ready. A live connector pending a changed entry keeps serving and stops retrying. Controls: unreachable keeps retrying, and a refused credential stays held. The card thread reports 4 of 6 red on main, an ablation that reds 4 with the controls green, and a clean restore.
  • Declarations: Clause-②: no, Metadata-protocol: none, patch. No published face narrows, so no contract review is owed.
  • Skills-docs / follow-up: the PR body says "follow-up owed" (content/docs/automation/connectors.mdx). That row is carried by automation: a held connector instance (a configuration fault or a refused stored credential) still tells a dispatch "the platform retries automatically", and the connectors page has no row for a configuration fault met on a retry #28016, together with a dispatch refusal that still tells a held instance "the platform retries automatically" (connector-nodes.ts:76, which needs engine knowledge of the hold, so it is not in this PR).
  • Local (card thread): package suite 2836/2836, typecheck green, 60 of 60 derived gate families exit 0, pnpm lint green.
  • Gate check-runs on this head: 48 total, 35 success, 13 skipped by the path filter, 0 failed. mergeable_state: clean.
  • Landing: Tier S, under the maintainer's landing grant for this term (2026-10-29 22:05Z, seat thread). Ready + auto-merge through the relay.

ACCEPT

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 08:21
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 08:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 066ff51 Oct 30, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-o8znbc branch October 30, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant