Fix broken Accept/Reject: call /actions/resolve, not /diff/resolve#7
Merged
Conversation
The Accept/Reject buttons on diff preview cards were calling a dead endpoint. Data Machine unified its preview primitive on a generic pending-action model in DM PR #1171 + data-machine-editor PR #5 (merged 2026-04-23): - /datamachine/v1/diff/resolve → removed - /datamachine/v1/actions/resolve → new home for every preview-capable tool kind, not just content diffs - diff_id → action_id on the request payload - ResolveDiffAbility / PendingDiffStore → deleted in favour of ResolvePendingActionAbility + PendingActionStore Every click of Accept or Reject on a live site has been 404'ing since the DM bump that dropped /diff/resolve. Fix: - rename resolveDiff() → resolvePendingAction(). - call /datamachine/v1/actions/resolve with { action_id, decision }. - rename the callback parameters diffId → actionId end-to-end. - drop the local MediaUploadFn type redeclaration; import it from @extrachill/chat where it's already exported (v0.9.0+). - bump @extrachill/chat dep from ^0.8.0 to ^0.10.1. The installed version was missing isVisible, onUnreadChange, MediaUploadFn, and useClientContextMetadata's current shape — all referenced by this file. npm ci in a fresh checkout would type-fail until this bump. Note on id round-tripping: @extrachill/chat@0.10.1 only reads diff.diffId / diff_id from tool payloads. DM's CanonicalDiffPreview now emits actionId. So the id delivered to the resolve endpoint will still be empty until the chat package also learns the actionId vocabulary (upstream PR filed separately). The endpoint rename here is still correct — it gets the frontend off the deleted route — and full end-to-end functionality unblocks as soon as the chat bump lands.
chubes4
added a commit
that referenced
this pull request
Apr 24, 2026
v0.11.0 lands the `actionId` field on CanonicalDiffData that DM's CanonicalDiffPreview::build() emits. Before this bump, the `resolvePendingAction` call in AgentChat.tsx was shipping action_id: '' because the chat package's parser only read `diffId` / `diff_id` (never `actionId`). With 0.11 installed, the parser populates both fields from the `actionId` payload and DiffCard's onAccept/onReject callbacks deliver the real id. In other words: this is the dep bump that actually makes #7 work end-to-end. Other 0.11 additions (preview nesting in parseCanonicalDiff, onToolCalls/sessionContext forwarding on <Chat>) are unused here but free. `npm run typecheck` and `npm run build` both pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Accept/Reject buttons on diff preview cards have been 404'ing on every click since Data Machine unified its preview primitive on a generic pending-action model:
/datamachine/v1/diff/resolve→ removed/datamachine/v1/actions/resolve→ new home for every preview-capable tool kind (not just content diffs)diff_id→action_idon the request payloadResolveDiffAbility/PendingDiffStore→ deleted in favour ofResolvePendingActionAbility+PendingActionStoreFix
resolveDiff()→resolvePendingAction()./datamachine/v1/actions/resolvewith{ action_id, decision }.diffId→actionIdend-to-end.MediaUploadFntype redeclaration; import it from@extrachill/chatwhere it's already exported (v0.9.0+).@extrachill/chatdep from^0.8.0→^0.10.1. The installed 0.8.0 was missingisVisible,onUnreadChange,MediaUploadFn, and the currentuseClientContextMetadatashape — all referenced by this file.npm ciin a fresh checkout type-failed until this bump.Round-trip note (follow-up required)
@extrachill/chat@0.10.1only readsdiff.diffId/diff_idfrom tool payloads. DM'sCanonicalDiffPreview::build()now emitsactionId. So the id delivered to the resolve endpoint will still be empty until the chat package also learns theactionIdvocabulary — companion PR filed: Extra-Chill/chat#21.The endpoint rename here is still correct in isolation — it gets the frontend off the deleted route — and full end-to-end functionality unblocks as soon as that chat bump lands. A follow-up will pin
@extrachill/chatto whatever version ships theactionIdfield (e.g.^0.11.0).Validation
npm ci+npm run build— succeeds, no warnings.npm run typecheck— clean.actions/resolve+action_idare present anddiff/resolve+diff_idare gone.AI assistance