Skip to content

feat(crdt): port dev panel instrument to v2 ci-fix line - #16275

Merged
christian-byrne merged 7 commits into
christian-byrne/integration-candidate-v2-ci-fixfrom
christian-byrne/crdt-dev-panel-ci-fix
Aug 30, 2026
Merged

christian-byrne merged 7 commits into
christian-byrne/integration-candidate-v2-ci-fixfrom
christian-byrne/crdt-dev-panel-ci-fix

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

TL;DR: Ports the six commits from #16209 onto the current v2 ci-fix line without merging its stale candidate ancestry. Adds the gated CRDT debug panel, redacted report/snapshot tooling, structured logs, and merge scenarios for live QA.

Base SHA: ec2997283e42aa72cdd0121c803ffc5e4343d924.

Gates: pnpm typecheck passed; pnpm lint passed (0 errors, existing warnings only); pnpm exec vitest run src/workbench/extensions/agent/ --reporter=dot passed (66 files, 743 tests); pnpm build:cloud passed.

Full context for agent readers

This is an ancestry-safe replay of exactly these six #16209 commits, in order: 5e5acb29f, a3b24aab6, 2793fda86a, 3335de89ec, 9cdfc0d2a3, and 956fd013c3.

Conflict resolution kept the ci-fix seams authoritative while retaining the dev-panel behavior:

  • src/locales/en/main.json: reused the recorded deduplicated locale resolution, leaving one agent object.
  • ecsFollowerAdapter.ts: retained per-workflow target sessions and session-scoped mutations; added structured effect logging around that seam.
  • useAgentCrdtFollower.ts: retained per-workflow bind/unbind, safe teardown, persisted rebind, retry/probe behavior, and workflow-scoped pending cleanup; added debug logs, snapshots, and redacted outbound envelopes.
  • followerSubscription.test.ts: retained the current schema-version source and added repeated-failure metadata assertions.
  • mergeTrace.ts: labels the current package's index-based widget register with the authored widget name for readable QA traces.

The resulting tree keeps one AgentPanelRoot mount, one Ask Comfy Agent locale/button seam, no duplicate store/locale surface, and no orphaned e2e fixture.

glary-bot and others added 7 commits August 30, 2026 03:44
The overlay was blocking the product: a status strip above the agent
panel pushed the composer below the fold, and a fixed-position "CRDT
dev" pill sat on top of the composer's submit button.

- Contain the instrument inside #agent-panel-root. The chip lives in the
  title row and the sheet opens below the panel header, so neither can
  cover the composer or the canvas.
- Fold the status strip into the chip label, removing the block element
  that consumed vertical space (and its now-unused i18n keys).
- Gate on DEV *or* an explicit ?crdtDebug=1 opt-in. The audience is
  product testers on staging builds, where DEV is false.
- Route every CRDT-internal event through one logger so the console and
  the copied report are the same record read two ways, with scope
  (wire/doc/ecs/ops) and level axes.
- Add a merge lab: replay op sequences through the pinned applier and
  report per-op verdict, contested register, stamp order and node
  incarnation, in one vocabulary. Includes the delete/set_widget/add
  case and a free-text field for the rule a tester would prefer.
- Restore the copy-system-stats bundle deleted in #5259 (system stats,
  server logs, settings, extensions, versions) and merge it with the
  existing copy into one report.
- stale_probe logged at warn, and warn bypasses the debug gate by design,
  so an idle bound workflow emitted a console warning every 30s in every
  build — including for users who had explicitly opted out. Demote to info.
- The batch-abort scenario applied its ops one per batch, so it could not
  produce the abort it narrated: the trace said the remainder was
  abandoned and then showed it applied. Model batches explicitly; the
  tail is now not-reached/batch_aborted. The test had pinned the wrong
  outcome and now asserts what its own name promised.
- The report shipped all settings and 40k chars of server logs with no
  warning. addSetting is public extension API, so the dictionary is an
  open set: redact credential-shaped keys and mark both sections, and
  the workflow section, as needing review before sharing.
- The panel was a static import, so the CRDT applier reached every
  agent-panel user to serve the ?crdtDebug minority. Load it async.
- Anchor at top-12: the header is h-12 and top-10 painted over its last
  8px. End the sheet above the composer so a tester can drive the agent
  and watch the log at once.
- Key trace rows on index; the idempotent-resend scenario is deliberately
  one op twice, so op_id is not unique across rows.
- devEventReplacer tracked every visited object, reporting a value
  referenced twice from sibling positions as [Circular]. Track ancestors.
- Snapshot the doc when Copy is pressed rather than trusting the 1s poll,
  and keep a malformed /system_stats payload from aborting the report.
- Drop the retained op payload from op_minted, the unproduced 'panel' log
  scope, and update the runbook that pointed at the deleted status strip.
The sheet was still an overlay reserving space with `bottom-1/3` — a
percentage against a composer whose height is fixed in pixels, so it
covered the composer below roughly a 910px viewport. Measured at 1366x768
it pushed the submit button from y=679 to y=869, out of the clipped
column entirely.

It is now a real child of AgentPanel's flex column via an #instrument
slot, above the shrink-0 composer. Getting there needed three things that
each failed once and are all load-bearing: the OUTER wrapper carries the
cap (a percentage max-height resolves against the parent, so on the inner
sheet it measured an auto-height wrapper and capped nothing);
`max-h-[50%]` not `max-h-1/2` (Tailwind has no max-h fraction utility,
so the class emitted nothing); and `min-h-0` plus `grow` rather than
`flex-1` (flex items default to min-height:auto and refuse to shrink,
while flex-1's basis:0 collapses the wrapper to nothing). Verified at
1366x768 and 1280x600: the submit button does not move at all when the
panel opens, and is hit-testable in both states.

Report: logs, settings and the workflow are now per-source opt-ins,
defaulting off, as the dialog deleted in #5259 had them — restoring the
collection without the consent was the regression. Redaction recurses,
because Comfy.Server.LaunchArgs is a Record<string,string> whose own key
matches nothing, so a one-level walk emitted --api-token whole; argv gets
the same treatment.

Also: keep raw payloads out of an opted-out user's console while leaving
the always-on warning line; stop ?crdtDebug=1 resetting a chosen
verbosity and let a later dismissal survive reload; truncate collapsed
log rows and poll the document only on the Status tab; seed node
incarnations only from ops that applied; drop the never-emitted 'panel'
scope.
The blocker: `dismissed` was per-mount state seeded from `false`, and the
panel lives in a slot inside `v-if="!showHistory"` — so opening chat
history and coming back destroyed and re-created it, resurrecting a chip
the tester had explicitly hidden, with the opt-out still persisted. Seed
it from the gate instead. The test that claimed to cover this only
asserted within one mount; it now unmounts and re-renders.

- doc_gap and a non-acknowledged batch both repeat indefinitely, and warn
  bypasses the debug gate by design, so both drop to info. The floor is
  now reserved for terminal conditions (schema_error, doc_reset).
- Cache the gate: isLevelEnabled runs once per outbound frame, per applied
  frame and per minted op, and each call was a synchronous
  localStorage.getItem — paid by opted-out users for nothing. Declared
  above applyQueryOverride's module-evaluation call, which now goes
  through the setters and would otherwise hit the temporal dead zone.
- max-h-[50%] -> max-h-1/2: AGENTS.md forbids arbitrary percentages where
  a fraction utility exists, and the doc comment already said max-h-1/2.
- Cap the event-log and stamp-ledger report sections, which grow with
  session length, the way the workflow and log sections already are.
- Surface meta.schema_version, the one fact that explains a schema_error.
- Evaluate duplicate-op and node-presence at each op's own position in a
  batch, so an intra-batch resend or delete no longer resolves to
  'unknown' — the one answer a merge explainer must not give wrongly.
- redactArgv no longer blanks the argument after an inline --flag=value.
- Hoist defineAsyncComponent to module scope and narrow its comment to
  what is genuinely deferred.
The blocker: the three opt-in controls gating server logs, settings and
the workflow rendered at 0x0. agentPanel.css strips `appearance` from
every input under #agent-panel-root with no replacement sizing, so a bare
checkbox collapses while its <label> still forwards clicks — brushing the
word "Settings" armed the toggle invisibly, and the next Copy folded the
settings dictionary into the paste with no indication. They are now
role=switch buttons (the CSS reset leaves buttons sized), with an on/off
icon and border, and the test asserts their rendered state.

- ws_out retained the whole parsed frame. Once the human write leg lands
  that is every widget value a user typed, sitting in an un-gated report
  section while the same text in the workflow JSON sits behind a toggle
  and a warning. Log the envelope only, as opSender already does, and add
  the sharing warning to the event-log and stamp-ledger sections.
- schema_error re-dispatched per frame, and warn bypasses the debug gate,
  so an unreadable doc warned once per frame forever in shipping builds.
  Announce the first failure only.
- Split readCrdtSnapshot into crdtSnapshot.ts: the follower imported it
  from crdtDebugReport, dragging the collector, redaction helpers and the
  extension store into the eager bundle the async panel exists to avoid.
- The trace <ol> kept UA decimal markers while the template numbered each
  step, rendering "1.  1. delete_node".
- The closed chip floated over the empty-state greeting; put it in flow.
- Guard copyLog like copyReport; persist the tester note across the
  remount a chat-history toggle causes; fall back when a device reports
  no index; correct the gate comment (DEV *or* opt-in, not plus).
Both were introduced by earlier rounds of this branch, not by the base.

1. The schema_error de-dup I added to quieten the console suppressed the
   EVENT, and its listener also clears `connected`, cancels the stale
   probe and discards pending effects. A reconnect re-armed all three, the
   next bad frame was silently swallowed, and the probe resubscribed every
   30s forever while the panel reported connected:yes. This is the live
   follower path, not behind the debug gate. Dispatch every failing frame
   and move the once-only guard into the detail so only the log dedupes.
   Test: two consecutive bad frames must produce two events.

2. The fault-tolerance fallback I added to renderSystem dumped the raw
   /system_stats payload on any render error — putting argv back on the
   clipboard unredacted, in the one collected section with no opt-in.
   systemSection is now total (the payload is asserted, not parsed, so a
   200 with a different shape is expected) and the raw fallback is gone.
   Test: a secret in argv stays absent when devices is malformed.

Also from the review:
- redactArgv pattern-tested every token as if it were a flag, so
  '/home/me/private/x' leaked (it matched) while the harmless argument
  after it was blanked. Identify flags by the leading dash, and blank
  path- and URL-shaped values whatever flag names them: --output-directory
  and --extra-model-paths-config match no credential pattern.
- MAX_WORKFLOW_CHARS 20k dropped nearly every real graph a tester had just
  opted in to share (the sandbox's 10-node default is already 10k).
- A log line containing a triple backtick closed its own fence; pick a
  delimiter longer than anything in the body.
- An explicit opt-out now skips the ring buffer too, not just the console.
- doc_reset is a host re-mint, not a client fault: info, not warn.
- The consent comment claimed the deleted dialog gated three sources; it
  gated four, and the fourth was SystemStats. Say why that one is not
  gated here rather than misdescribing the prior art.
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e083fc1e-d277-415f-9ec9-bf80338de10a

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
christian-byrne merged commit 2dcd614 into christian-byrne/integration-candidate-v2-ci-fix Aug 30, 2026
30 checks passed
@christian-byrne
christian-byrne deleted the christian-byrne/crdt-dev-panel-ci-fix branch August 30, 2026 03:59
@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/30/2026, 04:01:16 AM UTC

Links

🎭 Playwright: ❌ 1795 passed, 47 failed

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 1784 / ❌ 42 / ⚠️ 0 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 8 / ❌ 5 / ⚠️ 0 / ⏭️ 0)

@github-actions github-actions Bot added the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Aug 30, 2026
@codecov

codecov Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.87135% with 124 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...c/workbench/extensions/agent/crdt/CrdtDevPanel.vue 76.33% 53 Missing ⚠️
...ench/extensions/agent/crdt/useAgentCrdtFollower.ts 38.63% 27 Missing ⚠️
...workbench/extensions/agent/crdt/crdtDebugReport.ts 83.33% 18 Missing and 3 partials ⚠️
...rc/workbench/extensions/agent/crdt/crdtSnapshot.ts 0.00% 8 Missing ⚠️
src/workbench/extensions/agent/crdt/mergeTrace.ts 92.00% 6 Missing ⚠️
...ench/extensions/agent/crdt/layoutFollowerBridge.ts 75.00% 4 Missing ⚠️
.../workbench/extensions/agent/crdt/mergeScenarios.ts 96.10% 3 Missing ⚠️
...c/workbench/extensions/agent/crdt/crdtDebugGate.ts 96.82% 2 Missing ⚠️
@@                                Coverage Diff                                 @@
##             christian-byrne/integration-candidate-v2-ci-fix   #16275   +/-   ##
==================================================================================
  Coverage                                                   ?   83.25%           
==================================================================================
  Files                                                      ?     2027           
  Lines                                                      ?   117315           
  Branches                                                   ?    34407           
==================================================================================
  Hits                                                       ?    97674           
  Misses                                                     ?    19299           
  Partials                                                   ?      342           
Flag Coverage Δ
e2e 66.67% <ø> (?)
unit 76.38% <81.87%> (?)

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 93.75% <100.00%> (ø)
...h/extensions/agent/components/agent/AgentPanel.vue 97.14% <ø> (ø)
src/workbench/extensions/agent/crdt/crdtLog.ts 100.00% <100.00%> (ø)
src/workbench/extensions/agent/crdt/devPanelLog.ts 100.00% <100.00%> (ø)
...kbench/extensions/agent/crdt/ecsFollowerAdapter.ts 89.63% <100.00%> (ø)
src/workbench/extensions/agent/crdt/opSender.ts 100.00% <100.00%> (ø)
...c/workbench/extensions/agent/crdt/crdtDebugGate.ts 96.82% <96.82%> (ø)
.../workbench/extensions/agent/crdt/mergeScenarios.ts 96.10% <96.10%> (ø)
...ench/extensions/agent/crdt/layoutFollowerBridge.ts 90.82% <75.00%> (ø)
src/workbench/extensions/agent/crdt/mergeTrace.ts 92.00% <92.00%> (ø)
... and 4 more
🚀 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.

@huang47 huang47 added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
@DrJKL DrJKL added agent Comfy Agent product, integration, tests or product documentation agent-crdt Agent document synchronization, graph projection or CRDT operations agent-docs Agent product architecture, contracts or documentation agent-test-unit Touches Agent-related unit/component tests or their support agent-ui Agent panel, composer, transcript or other user-interface components labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Comfy Agent product, integration, tests or product documentation agent-crdt Agent document synchronization, graph projection or CRDT operations agent-docs Agent product architecture, contracts or documentation agent-test-unit Touches Agent-related unit/component tests or their support agent-ui Agent panel, composer, transcript or other user-interface components risk:high PR risk grade (advisory shadow check; grader-owned) size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants