Repository navigation
fix(agent): restore agent draft schema types stranded by #16448 freeze - #16565
christian-byrne wants to merge 2 commits into
Conversation
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')
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1893 passed, 0 failed · 2 flaky📊 Browser Reports
⚡ Performance
|
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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 421 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
CodeJuggernaut
left a comment
There was a problem hiding this comment.
The restored schema types match the frozen source exactly. No issues.
|
Closing: zero diff; draft frames intentionally retired. The corrective commit Full context for agent readersThe original Verified immediately before closure: PR head |
|
Deployment failed for project comfy-home-v1 with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
question: this branch currently has a zero net diff against 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 Full context for agent readersFound by the hourly Two other open principal FE PRs are in the same state and carry the same comment: #11389 ( The |
What
AgentDraftSnapshot,DraftPatchData, andDraftVersionDataexisted only at the frozen FE #16448 head (278338e6a0) and were dropped from main when #16396 merged without them (agentApiSchema.tson #16396's squash does not define them, verified viagit grepon both refs).This PR ports the three zod schemas + inferred types from the frozen head into
src/workbench/extensions/agent/schemas/agentApiSchema.tsand wiresdraft_patch/draft_versionback into theAgentWsEventdiscriminated union, matching the frozen head's shape exactly.Why now
Unblocks
cjx-8(agentDraftStore.ts) and residualcjx-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'sonRawswitch now explicitly dropsdraft_patch/draft_versionframes (they aren't chat-transcript events) instead of falling through to the default branch, which stopped typechecking onceAgentWsEventgrew two more variants thanAgentChatEvent'sExtract<>allows.@knipIgnoreUsedByStackedPR— their only consumer is the not-yet-landed draft-store PR.zAgentRunMode/AgentRunModePreference/AgentRunModefrom the frozen head — out of scope for this row.Tests
agentApiSchema.test.ts)useAgentSession.test.tsregression confirming draft frames don't leak into the chat transcriptLocal verification: typecheck, ESLint, oxlint, oxfmt, knip, and the two affected vitest suites (75 tests) all green.
Source:
todo.mdrowcjx-13; evidence inprogram/cj16448-triage.mdandreports/review/finalverify/closure-receipts-prep.md("Stranded dependency" section).