Repository navigation
feat(crdt): port dev panel instrument to v2 ci-fix line - #16275
christian-byrne merged 7 commits into
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
2dcd614
into
christian-byrne/integration-candidate-v2-ci-fix
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ❌ 1795 passed, 47 failed❌ Failed Tests📊 Browser Reports
|
Codecov Report❌ Patch coverage is @@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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 typecheckpassed;pnpm lintpassed (0 errors, existing warnings only);pnpm exec vitest run src/workbench/extensions/agent/ --reporter=dotpassed (66 files, 743 tests);pnpm build:cloudpassed.Full context for agent readers
This is an ancestry-safe replay of exactly these six #16209 commits, in order:
5e5acb29f,a3b24aab6,2793fda86a,3335de89ec,9cdfc0d2a3, and956fd013c3.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 oneagentobject.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
AgentPanelRootmount, one Ask Comfy Agent locale/button seam, no duplicate store/locale surface, and no orphaned e2e fixture.