Skip to content

fix(agent): restore agent draft schema types stranded by #16448 freeze - #16565

Closed
christian-byrne wants to merge 2 commits into
mainfrom
christian-byrne/cjx13-agent-draft-schema
Closed

christian-byrne wants to merge 2 commits into
mainfrom
christian-byrne/cjx13-agent-draft-schema

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

What

AgentDraftSnapshot, DraftPatchData, and DraftVersionData existed only at the frozen FE #16448 head (278338e6a0) and were dropped from main when #16396 merged without them (agentApiSchema.ts on #16396's squash does not define them, verified via git grep on both refs).

This PR ports the three zod schemas + inferred types from the frozen head into src/workbench/extensions/agent/schemas/agentApiSchema.ts and wires draft_patch/draft_version back into the AgentWsEvent discriminated union, matching the frozen head's shape exactly.

Why now

Unblocks cjx-8 (agentDraftStore.ts) and residual cjx-11, both of which depend on this schema carrier existing on main. Neither the schema nor its consumers currently exist anywhere reachable from main.

Scope

Deliberately narrow — schema types only, no runtime draft-sync logic:

  • useAgentSession.ts's onRaw switch now explicitly drops draft_patch/draft_version frames (they aren't chat-transcript events) instead of falling through to the default branch, which stopped typechecking once AgentWsEvent grew two more variants than AgentChatEvent's Extract<> allows.
  • The three new type exports carry @knipIgnoreUsedByStackedPR — their only consumer is the not-yet-landed draft-store PR.
  • Did not port zAgentRunMode/AgentRunModePreference/AgentRunMode from the frozen head — out of scope for this row.

Tests

  • Schema round-trip + rejection cases for all three new shapes (agentApiSchema.test.ts)
  • Updated the two union-membership assertions that previously asserted draft frames were foreign to the union (they're now admitted)
  • useAgentSession.test.ts regression confirming draft frames don't leak into the chat transcript

Local verification: typecheck, ESLint, oxlint, oxfmt, knip, and the two affected vitest suites (75 tests) all green.

Source: todo.md row cjx-13; evidence in program/cj16448-triage.md and reports/review/finalverify/closure-receipts-prep.md ("Stranded dependency" section).

AgentDraftSnapshot, DraftPatchData, and DraftVersionData existed only at
the frozen FE #16448 head (278338e) and were dropped when #16396
merged without them. Port the three zod schemas + inferred types and
wire draft_patch/draft_version back into the AgentWsEvent discriminated
union, matching the frozen head exactly.

useAgentSession's onRaw switch now explicitly drops draft_patch/
draft_version frames (they are not chat-transcript events; the runtime
consumer lands with the draft-store PR, cjx-8/cjx-11) rather than
falling through to the default branch, which no longer typechecks
against AgentChatEvent's narrower Extract<> now that AgentWsEvent has
two more variants.

The three new type exports are tagged @knipIgnoreUsedByStackedPR since
their only consumer is the not-yet-landed draft-store PR.

Tests: schema round-trip + rejection cases for all three shapes, updated
the two union-membership assertions that previously asserted draft
frames were foreign to the union, and a useAgentSession regression
confirming draft frames don't leak into the chat transcript.

Unblocks cjx-8 (agentDraftStore.ts) and residual cjx-11.

Source: todo.md cjx-13 (program/cj16448-triage.md,
reports/review/finalverify/closure-receipts-prep.md 'Stranded
dependency')
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: cc94b83f-8d78-494f-951b-58a4e8dbd095

📥 Commits

Reviewing files that changed from the base of the PR and between 8476602 and 42fe0a7.

📒 Files selected for processing (4)
  • src/workbench/extensions/agent/composables/agent/useAgentSession.test.ts
  • src/workbench/extensions/agent/composables/agent/useAgentSession.ts
  • src/workbench/extensions/agent/schemas/agentApiSchema.test.ts
  • src/workbench/extensions/agent/schemas/agentApiSchema.ts

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

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/02/2026, 01:21:34 AM UTC

Links

🎭 Playwright: ✅ 1893 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1872 / ❌ 0 / ⚠️ 2 / ⏭️ 4)
  • 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)

⚡ Performance

⚠️ Performance tests failed. Check the CI workflow logs.

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

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #16565      +/-   ##
==========================================
+ Coverage   80.71%   82.33%   +1.62%     
==========================================
  Files        2427     2018     -409     
  Lines      123858   116634    -7224     
  Branches    32783    29266    -3517     
==========================================
- Hits        99969    96030    -3939     
+ Misses      23393    20429    -2964     
+ Partials      496      175     -321     
Flag Coverage Δ
e2e 68.10% <ø> (-0.02%) ⬇️
unit 76.66% <100.00%> (+<0.01%) ⬆️
website-unit ?

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

Files with missing lines Coverage Δ
...ensions/agent/composables/agent/useAgentSession.ts 96.24% <100.00%> (+0.05%) ⬆️
...rkbench/extensions/agent/schemas/agentApiSchema.ts 100.00% <100.00%> (ø)

... and 421 files with indirect coverage changes

🚀 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.

@christian-byrne

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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
CodeJuggernaut
CodeJuggernaut previously approved these changes Sep 2, 2026

@CodeJuggernaut CodeJuggernaut 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.

The restored schema types match the frozen source exactly. No issues.

@christian-byrne

christian-byrne commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Closing: zero diff; draft frames intentionally retired.

The corrective commit feebe52d21 neutralized the stale schema restoration, leaving this branch with no files changed against main. The earlier scheduled rebase is cancelled.

Full context for agent readers

The original cjx-13 question now has an explicit disposition: no successor carrier is needed. phs-3 records that FE #16198 intentionally retired draft_patch and draft_version; current main keeps permanent tests rejecting both frame names. Restoring AgentDraftSnapshot, DraftPatchData, or DraftVersionData for that transport would reverse the accepted retirement decision.

Verified immediately before closure: PR head feebe52d216dcaf1cf7ea4f2d2fb7f1b8c84c31e, changed_files=0, and compare/main...head reports zero files. This edit supersedes the prior instruction to rebase after #16769 → #16393 → #16856.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deployment failed for project comfy-home-v1 with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: comfy-home-v1.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@christian-byrne
christian-byrne marked this pull request as ready for review September 4, 2026 03:35
@christian-byrne
christian-byrne marked this pull request as draft September 4, 2026 03:37
@christian-byrne

Copy link
Copy Markdown
Contributor Author

question: this branch currently has a zero net diff against main, so as it stands it would merge as a no-op. 42fe0a7c adds +133/-5 across four files and feebe52d ("keep retired draft frames excluded") removes +5/-133 from the same four, and GET /pulls/16565 reports changed_files=0 additions=0 deletions=0 at head feebe52d, with compare/main...feebe52d returning ahead_by=2, files=0. The body still describes porting AgentDraftSnapshot, DraftPatchData, and DraftVersionData from the frozen #16448 head, which no longer matches the tree.

Was the full revert intended (in which case closing this and letting the schema ride on its successor seems cleaner than carrying an empty PR through review), or did feebe52d overshoot and only the draft_patch/draft_version frame exclusion belong in it?

Full context for agent readers

Found by the hourly pr-hygiene sweep, check 2 (drafts). This PR briefly satisfied the "green CI, no WIP marker, main-based" ready criterion and was flipped to ready-for-review; that was reverted to draft in the same pass once the zero diff was confirmed, because a no-op PR should not enter the review queue. CI reading green here is expected and not evidence of content: 57 check-runs pass precisely because there is nothing to build.

Two other open principal FE PRs are in the same state and carry the same comment: #11389 (43b990b1 deletes 91 lines, exactly the +68 and +23 added by the two prior commits) and #16381 (20 commits, compare/main...8797ac90 = ahead_by=20, files=0).

The #16856 conflict-guard note above still holds and is unaffected: this branch remains an unsuitable resolution source regardless of whether it is closed or restored.

@DrJKL DrJKL added the agent Comfy Agent product, integration, tests or product documentation label 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 risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants