- Home
- Skills
- Agents & Orchestration
- Repair Request Cancellation & Abort Bugs
More screenshots
Works with the AI Agents you already use
Repair Request Cancellation & Abort Bugs
Diagnose and repair request cancellation, abort propagation, timeouts, background continuation, cleanup, and partial side effects.
$1
Repair Request Cancellation & Abort Bugs
Example session with this skill installed
The 'submit-order' endpoint keeps processing payments even after the client disconnects. Here is the Node.js handler snippet and the logs showing 499 errors followed by successful DB writes.
- Read your context and instructions
- Compiled the repair request cancellation
I have analyzed the submit-order handler and the provided logs. The issue stems from the payment gateway call not being linked to the incoming request's AbortSignal, allowing the transaction to complete despite the client's 499 disconnect.
Diagnosis and Repair
The handler currently awaits the processPayment promise without passing the request context. While the database transaction is scoped, it is not aborted when the connection closes.
| Component | Current Behavior | Required Invariant |
|---|---|---|
| Client | Disconnects (499) | Signal must propagate to all downstream IO |
| Payment API | Runs to completion | Must abort via AbortController signal |
| DB Transaction | Commits regardless of status | Rollback must trigger on signal abort |
Implementation Patch
// routes/orders.js - Proposed Fix
app.post('/submit-order', async (req, res) => {
const ac = new AbortController();
req.on('close', () => ac.abort());
const session = await db.startSession();
try {
session.startTransaction();
// Link external payment call to request cancellation
const payment = await paymentGateway.process({
amount: req.body.total,
signal: ac.signal
});
// Ensure DB write respects the signal
await Order.create([{ ...req.body, paymentId: payment.id }], {
session,
signal: ac.signal
});
await session.commitTransaction();
res.status(201).json({ success: true });
} catch (err) {
await session.abortTransaction();
if (err.name === 'AbortError') {
console.log('Request cancelled: cleanup successful');
} else {
throw err;
}
} finally {
session.endSession();
}
});
Deterministic Test Plan
- Mock Service: Create a mock payment gateway with a 500ms latency.
- Abort Trigger: Use a
setTimeoutto triggerreq.emit('close')at 200ms.
Assertion: Verify that the paymentGateway receives an abort signal and that Order.countDocuments() remains 0.
Next steps
- Update the
paymentGatewaySDK wrapper to accept anAbortSignal. - Deploy the patch to a staging environment and verify log suppression for cancelled requests.
- Check for similar patterns in the 'refund-process' endpoint.
Connects securely to your tools. The creator never sees your data.
About this skill
Repair Request Cancellation & Abort Bugs is a bounded ToolForge Labs workflow. Diagnose and repair request cancellation, abort propagation, timeouts, background continuation, cleanup, and partial side effects. Works from full repositories or partial context such as snippets, logs, configuration, traces, and architecture notes. Produces concrete repairs or evidence-backed review outputs while preserving existing product/security policy.
It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Cannot verify production systems, external services, or facts that are not present in supplied evidence. With partial context it returns bounded diagnosis/review, explicit assumptions, and a deterministic validation plan rather than claiming successful execution.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Use a clean branch or a controlled review workspace. Supply repository files, logs, traces, configuration, or evidence needed for the task. Review all patches/findings before merge or operational action; keep production credentials and destructive production actions out of the workflow.