Skip to content

Backport #18704 to cloud/1.55 - #19183

Closed
christian-byrne wants to merge 1 commit into
cloud/1.55from
christian-byrne/backport-18704-cloud-1.55
Closed

christian-byrne wants to merge 1 commit into
cloud/1.55from
christian-byrne/backport-18704-cloud-1.55

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

Backports #18704 (stops retrying permanently refused CRDT document subscriptions) to cloud/1.55.

The automated cherry-pick conflicted where 1.55 lacks the newer undo-bracket API. This keeps the release branch reset path and adds the refusal-state reset directly, while preserving the permanent-error notification and retry gate.

Validation:

  • Same target-native implementation as the validated core/1.55 backport
  • 4 focused suites: 381 tests passed
  • full workspace typecheck passed
  • changed-file formatting passed

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 378cdba1-bbe1-48a6-915f-e159ff79caad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@christian-byrne

Copy link
Copy Markdown
Contributor Author

Self-review complete. This is the same target-native conflict resolution as #19182 on cloud/1.55. It preserves the release reset flow while adding the refusal-state reset and the permanent refusal/error-notification behavior. The core-equivalent implementation passed 381 focused tests, full workspace typecheck, formatting, and dependency checks; cloud CI supplies branch-specific validation.

@christian-byrne
christian-byrne force-pushed the christian-byrne/backport-18704-cloud-1.55 branch from 0883424 to 229635b Compare September 28, 2026 03:48
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since a1300e95f8922aea5e93e9ecf0a9d0603d06eaa4

Full docs: ADR-DEVEX-LINT-0015

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/28/2026, 04:01:34 AM UTC

Links

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff.

Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🎭 Playwright: ✅ 2125 passed, 0 failed

📊 Browser Reports
  • chromium: View Report (✅ 2104 / ❌ 0 / ⚠️ 0 / ⏭️ 13)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

Backport #18704 to the 1.55 release branch with its native reset path. Preserve the permanent schema-mismatch refusal gate, durable sync-error notification, and reset of the one-shot give-up latch.
@christian-byrne
christian-byrne force-pushed the christian-byrne/backport-18704-cloud-1.55 branch from 229635b to ec93d84 Compare September 28, 2026 03:49
@christian-byrne
christian-byrne enabled auto-merge (squash) September 28, 2026 03:51
@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 28, 2026
@christian-byrne

Copy link
Copy Markdown
Contributor Author

Closing as duplicate: the intended backport already merged in #19166.

auto-merge was automatically disabled September 28, 2026 04:11

Pull request was closed

@christian-byrne
christian-byrne deleted the christian-byrne/backport-18704-cloud-1.55 branch September 28, 2026 04:11

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @christian-byrne.

Found 9 finding(s).

Severity Count
🟠 High 1
🟡 Medium 6
🟢 Low 2

Panel: 8/8 reviewers contributed findings.

resumeHeldOpsIfSubscribed()
} else {
lifecycle.onSubscribeRefused()
const refusal = handleSubscribeRefusal(detail, lifecycle)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — handleSubscribeRefusal returns shouldNotify: false both for ordinary retryable refusals and for a permanent refusal the lifecycle deliberately discarded as a stale straggler, but this else branch still runs the full teardown: connected.value was already set to false above, and releaseHeldOps() + sender.abortIfUnbound() run unconditionally. So in exactly the race confirmedSinceLastSend exists to survive, the bridge has already nulled sentWorkflowId and a healthy confirmed channel is still reported disconnected, its in-flight human batch settled unconfirmed, and doc_updates dropped until the next status frame or stale probe. Distinguish "discarded as stale" from "retryable refusal" in SubscribeRefusalOutcome and skip the teardown for the former. Raised by 4 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case).

if (this.confirmedSinceLastSend) return false
this.clearAckTimer()
this.clearStaleProbe()
return this.giveUpPermanently(code, isNotifyingPermanentRefusalCode(code))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — doc_subscribed frames carry no attempt identity, so this guard only helps when the confirm happens to arrive first. In the reverse ordering — attempt N's permanent refusal lands while attempt N+1 (sent by the ack timeout) is still outstanding — giveUpPermanently latches gaveUp, and N+1's later confirm is filtered out at the bridge because sentWorkflowId was already cleared; with shouldDeferSubscribe() now true, status-frame reconciles are blocked and nothing resubscribes, leaving a dead channel behind a sticky "can't sync" toast until a reconnect or retarget (pre-diff the bounded retry self-healed this). Raised by 2 of 8 reviewers (kimi-k3-max adversarial, gpt-5.6-sol-max adversarial).

// See `confirmedSinceLastSend`: bail out before touching any timer,
// so a stale straggler can't clear the probe/backoff state the
// confirm it raced behind already armed.
if (this.confirmedSinceLastSend) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — The discard path returns before arming any recovery, yet the bridge has already cleared sentWorkflowId for that same ok: false frame; the old code's unconditional scheduleSubscribeRetry() repaired that within 500 ms, so the follower now stays unsubscribed until the next status frame or the stale probe (up to 30 s). The same blind spot swallows a genuinely new refusal: an older attempt confirming late, or an unsolicited terminal refusal pushed after a confirm, is indistinguishable from a straggler and is dropped with no latch, no retry, and no onSyncError — the silent desync this feature exists to surface. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).

this.clearAckTimer()
this.clearStaleProbe()
this.scheduleSubscribeRetry()
return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — The confirmedSinceLastSend check guards only the permanent branch. A stale retryable refusal (e.g. doc_not_found) answering a superseded attempt still falls through to clearStaleProbe() + scheduleSubscribeRetry(), tearing down the healthy confirm's probe and resubscribing a working channel — and via the follower's shared else branch it also marks it disconnected and releases held ops. The race is identical in both branches, so the guard belongs before the code classification. Raised by 3 of 8 reviewers (gemini-3.1-pro adversarial, gemini-3.1-pro edge-case, claude-opus-5-thinking-max adversarial).

// A reconnect that lands the same permanent code for the same workflow
// is one unchanged fact - only a different workflow (retarget/doc_reset,
// see `resetNotifiedGiveUp`) is a new one worth telling the person about.
if (workflowId !== null && workflowId === this.lastNotifiedGiveUpWorkflowId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — lastNotifiedGiveUpWorkflowId dedupes on workflow id alone, while the comment above describes the suppressed fact as the same permanent code recurring. A reconnect answered with a different permanent code for the same workflow (schema_version_mismatch, then catalog_mismatch after a server-side change) is a distinct failure with its own localized copy, but onSyncError, the dev event, and reportError are all suppressed — the person keeps the wrong explanation, or gets none if they dismissed the first sticky toast. Key the marker on the workflow id plus the code. Raised by 6 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, kimi-k3-max edge-case, gemini-3.1-pro edge-case).

// A redelivered/duplicate refusal frame answers nothing new once the
// latch is already set — without this guard it would re-run the report
// and the caller's `onGaveUp` (toast/telemetry) a second time.
if (this.gaveUp) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — gaveUp is also latched by the ack-timeout path (giveUp() below), which never notifies, so a permanent refusal arriving just after three unanswered acks hits this early return and produces no dev event, no reportError, and no onSyncError. The user is left with a silently dead channel even though that refusal is the first concrete reason received; a flag distinct from the ack-timeout latch would let the refusal still notify. Raised by 3 of 8 reviewers (gpt-5.6-sol-max edge-case, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).

summary: t('agent.workflowSyncFailedTitle'),
detail: formatWorkflowSyncErrorDetail(t, message, code),
// A permanent desync remains visible until the person dismisses it.
life: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — This toast never auto-dismisses and is never removed programmatically, while the dedupe marker is cleared by clearForRetarget() — which the follower's watch([workflowId, isTargetActive]) runs on every change, including an isTargetActive flip with the workflow unchanged. Switching away from and back to a permanently incompatible workflow therefore re-notifies each round trip, stacking N undismissing error toasts for one unchanged fact, and those toasts survive a later successful resubscribe, still claiming the workflow can't sync after it recovered. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial).

// survive the permanent latch: its callback checks only `workflowId()`,
// not `gaveUp`, so left alone it would still fire a resubscribe later.
this.clearSubscribeRetry()
if (!notify) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — if (!notify) return false sits before both recordDevEvent and reportError, so latching unsupported emits no signal at all — not even a dev-panel event. The comment only justifies suppressing the user-facing toast for a deployment-wide condition, but that same condition refuses every user's subscribe, so a fleet-wide agent-sync outage becomes invisible in telemetry; record the event and report before the notify check. Raised by 1 of 8 reviewers (kimi-k3-max adversarial).

: 'agent.workflowSyncFailedDetail'
)
if (!message) return detail
return `${detail} (${truncate(message, { length: SYNC_ERROR_RAW_MESSAGE_MAX_LENGTH })})`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — The doc-host's raw message is interpolated verbatim into a user-visible toast; the 200-char clamp bounds its length but validates nothing, so a misbehaving or compromised host can place arbitrary prose (e.g. a fake "sign in at …" instruction) inside legitimate-looking product copy — content spoofing rather than XSS, since PrimeVue escapes HTML — and embedded newlines or a clamp landing mid-surrogate-pair break the single-line detail's rendering. Consider keeping the raw developer text in telemetry and showing only the code-mapped localized detail. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max edge-case).

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.55   #19183   +/-   ##
=============================================
  Coverage              ?   80.59%           
=============================================
  Files                 ?     2200           
  Lines                 ?   117518           
  Branches              ?    33499           
=============================================
  Hits                  ?    94709           
  Misses                ?    22463           
  Partials              ?      346           
Flag Coverage Δ
unit 80.59% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/workbench/extensions/agent/AgentPanelRoot.vue 90.26% <100.00%> (ø)
...nch/extensions/agent/crdt/agentCrdtDocLifecycle.ts 99.46% <100.00%> (ø)
src/workbench/extensions/agent/crdt/devPanelLog.ts 86.86% <ø> (ø)
...ench/extensions/agent/crdt/useAgentCrdtFollower.ts 97.87% <100.00%> (ø)
...h/extensions/agent/crdt/workflowSyncErrorDetail.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Trigger multi-model Cursor agent review on this PR greenlight risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants