Skip to content

feat(cockpit): refund-authorization interrupts example#553

Merged
blove merged 5 commits into
mainfrom
claude/cockpit-interrupts-refund
May 28, 2026
Merged

feat(cockpit): refund-authorization interrupts example#553
blove merged 5 commits into
mainfrom
claude/cockpit-interrupts-refund

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 28, 2026

Summary

Rewrites the cockpit `interrupts` example as a refund-authorization agent. PR #2 of three in the HITL Refund work stream.

  • LangGraph graph restructured to a three-node flow: `draft → request_approval → issue`. Structured interrupt payload `{ kind: 'refund_approval', amount, customer_id, reason }`. Conditional edge from `request_approval` reads `state.decision_approved` set by the operator's resume value.
  • Angular component swapped from the old `ChatInterruptPanelComponent` + bespoke `ApprovalCardComponent` to the new `ChatApprovalCardComponent` from `@threadplane/chat` (shipped in PR feat(chat): ChatApprovalCard dialog composition + ChatInterruptPanel refresh #552). Welcome suggestions are refund-flavored. Approve/Cancel/Edit all resume the graph with structured values.
  • Bespoke `ApprovalCardComponent` deleted — the library composition replaces it.
  • Three new Playwright tests cover dialog visibility, Approve path, Cancel path.

Strict gate

Auto-merge intentionally disabled. This PR stays in draft until manual review (Piece 3 in the plan) is signed off in a real browser. The whole point of this PR is the forcing-function: we use what we ship, in the actual cockpit, before writing the blog about it.

Test plan

  • `nx build cockpit-langgraph-interrupts-angular` green (verified locally)
  • `nx e2e cockpit-langgraph-interrupts-angular` green in CI
  • Manual: walk through approve/edit/cancel flows in a local browser
  • Manual: capture three screenshots for the blog post

Depends on PR #552 (merged).
Plan: docs/superpowers/plans/2026-05-25-hitl-refund-cockpit-blog.md

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 28, 2026 4:33am

Request Review

Surfaced by dogfooding the cockpit refund example in a real browser:

- ChatApprovalCard: center the dialog (margin:auto was cleared by reset
  rules, pinning it top-left) and add backdrop blur + 50% dim so the
  modal reads as modal against dark chat surfaces.
- ChatApprovalCard: Edit is now non-terminal — emit('edit') no longer
  closes the dialog, so callers can reveal an inline editor in the body
  slot. Approve/Cancel still close. Added a unit test.
- Cockpit graph: add a Pydantic with_structured_output extraction step
  so the approval card shows real amount/customer/reason instead of
  $0.00/unknown. Wrap identifiers in backticks so markdown doesn't eat
  the underscores in cus_*/re_* IDs.

Verified end-to-end in browser: approve issues at original amount,
edit adjusts the amount then issues, cancel skips the refund.
@blove blove marked this pull request as ready for review May 28, 2026 04:33
@blove blove enabled auto-merge (squash) May 28, 2026 04:33
@blove blove merged commit ef0abd6 into main May 28, 2026
3 checks passed
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