Skip to content

feat(#29): async NanaBanana webhook processing with DLQ & polling fal… - #187

Merged
Darkvader-ship-it merged 2 commits into
PHASE-STELLAR:mainfrom
Peace-001:feature/async-nanobanana-webhook
Aug 31, 2026
Merged

feat(#29): async NanaBanana webhook processing with DLQ & polling fal…#187
Darkvader-ship-it merged 2 commits into
PHASE-STELLAR:mainfrom
Peace-001:feature/async-nanobanana-webhook

Conversation

@Peace-001

Copy link
Copy Markdown

…lback

  • lib/generation-job-store.ts: persistent file-based job store (generationJobs + generationDlq sidecars); jobs keyed by txHash for client polling; full CRUD by txHash/taskId/id; automatic pruning (4h completed, 24h pending, 7d DLQ)

  • lib/forge-nanobanana.ts: extract submitGenerateTask(); add submitForgeImageTaskViaNanobananaApi() (returns taskId immediately, no poll); add nanobananaAsyncWebhookEnabled() helper (requires NANOBANANA_WEBHOOK_SECRET

    • NANOBANANA_CALLBACK_URL)
  • app/api/webhooks/nanobanana/route.ts: full implementation replacing stub; HMAC-SHA256 signature verification against NANOBANANA_WEBHOOK_SECRET; DLQ entries on sig failure / parse error / task failure; background pipeline continuation (lore → IPFS → mint) after successful webhook delivery

  • app/api/jobs/[txHash]/route.ts: new client polling endpoint; returns job status (pending/processing/webhook_received/completed/failed) + result

  • app/api/forge-agent/route.ts: when async webhook mode active + txHash known, submits image task asynchronously and returns {async:true, jobId, txHash}; falls back to synchronous runForgePipeline on overload or unconfigured mode; also fixes pre-existing typos (static const, randomUUId, catc, WWA-Authenticate)

  • app/forge/page.tsx: initiateAgentForge() detects async:true response and polls /api/jobs/[txHash] every 3.5s (4-min client timeout) until completed or failed; sync path unchanged for fallback

Closes #29

…& polling fallback

- lib/generation-job-store.ts: persistent file-based job store (generationJobs +
  generationDlq sidecars); jobs keyed by txHash for client polling; full CRUD
  by txHash/taskId/id; automatic pruning (4h completed, 24h pending, 7d DLQ)

- lib/forge-nanobanana.ts: extract submitGenerateTask(); add
  submitForgeImageTaskViaNanobananaApi() (returns taskId immediately, no poll);
  add nanobananaAsyncWebhookEnabled() helper (requires NANOBANANA_WEBHOOK_SECRET
  + NANOBANANA_CALLBACK_URL)

- app/api/webhooks/nanobanana/route.ts: full implementation replacing stub;
  HMAC-SHA256 signature verification against NANOBANANA_WEBHOOK_SECRET;
  DLQ entries on sig failure / parse error / task failure; background pipeline
  continuation (lore → IPFS → mint) after successful webhook delivery

- app/api/jobs/[txHash]/route.ts: new client polling endpoint; returns job
  status (pending/processing/webhook_received/completed/failed) + result

- app/api/forge-agent/route.ts: when async webhook mode active + txHash known,
  submits image task asynchronously and returns {async:true, jobId, txHash};
  falls back to synchronous runForgePipeline on overload or unconfigured mode;
  also fixes pre-existing typos (static const, randomUUId, catc, WWA-Authenticate)

- app/forge/page.tsx: initiateAgentForge() detects async:true response and
  polls /api/jobs/[txHash] every 3.5s (4-min client timeout) until completed
  or failed; sync path unchanged for fallback

Closes PHASE-STELLAR#29
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Peace-001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Darkvader-ship-it
Darkvader-ship-it merged commit b1e78ad into PHASE-STELLAR:main Aug 31, 2026
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.

[Feature] Implement Async Nano Banana Webhook Processing with Dead-Letter Queue & Polling Fallback

2 participants