Skip to content

Fix broken Accept/Reject: call /actions/resolve, not /diff/resolve#7

Merged
chubes4 merged 1 commit into
mainfrom
fix-resolve-action-endpoint
Apr 24, 2026
Merged

Fix broken Accept/Reject: call /actions/resolve, not /diff/resolve#7
chubes4 merged 1 commit into
mainfrom
fix-resolve-action-endpoint

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 24, 2026

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:

  • DM PR #1171 + data-machine-editor PR #5 (merged 2026-04-23):
    • /datamachine/v1/diff/resolveremoved
    • /datamachine/v1/actions/resolve → new home for every preview-capable tool kind (not just content diffs)
    • diff_idaction_id on the request payload
    • ResolveDiffAbility / PendingDiffStore → deleted in favour of ResolvePendingActionAbility + PendingActionStore

Fix

  • Rename resolveDiff()resolvePendingAction().
  • Call /datamachine/v1/actions/resolve with { action_id, decision }.
  • Rename callback parameters diffIdactionId 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^0.10.1. The installed 0.8.0 was missing isVisible, onUnreadChange, MediaUploadFn, and the current useClientContextMetadata shape — all referenced by this file. npm ci in a fresh checkout type-failed until this bump.

Round-trip note (follow-up required)

@extrachill/chat@0.10.1 only reads diff.diffId / diff_id from tool payloads. DM's CanonicalDiffPreview::build() now emits actionId. So the id delivered to the resolve endpoint will still be empty until the chat package also learns the actionId vocabulary — 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/chat to whatever version ships the actionId field (e.g. ^0.11.0).

Validation

  • npm ci + npm run build — succeeds, no warnings.
  • npm run typecheck — clean.
  • Visual check of the built bundle confirms actions/resolve + action_id are present and diff/resolve + diff_id are gone.

AI assistance

  • AI assistance: Yes
  • Tool(s): Claude Code (Opus 4.7)
  • Used for: Traced the unified preview primitive through DM + editor PRs, drafted the endpoint rename, the upstream chat PR, and validated the two pieces against each other. Chris flagged the audit target.

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 chubes4 merged commit 8d95c11 into main Apr 24, 2026
@chubes4 chubes4 deleted the fix-resolve-action-endpoint branch April 24, 2026 18:08
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant