Skip to content

Use structured Workers AI replies and remove repeated fallbacks - #35

Merged
Mabolla merged 4 commits into
mainfrom
fix/workers-ai-structured-replies
Sep 9, 2026
Merged

Use structured Workers AI replies and remove repeated fallbacks#35
Mabolla merged 4 commits into
mainfrom
fix/workers-ai-structured-replies

Conversation

@Mabolla

@Mabolla Mabolla commented Sep 9, 2026

Copy link
Copy Markdown
Owner

What changed

  • switch the probe listener to Cloudflare's JSON Mode-supported @cf/meta/llama-3.1-8b-instruct-fast model
  • request a strict {action, reply} schema and handle object or text response shapes
  • remove the two canned deterministic replies
  • fail closed on binding, quota/model, or invalid-output errors instead of publishing repeated content
  • log whether a decision came from Workers AI
  • add regression coverage for structured output and malformed/error paths

Verification

  • npm test: 90/90 passing
  • main Wrangler dry-run: AI binding present, new model configured
  • git diff --check: clean

Cloudflare JSON Mode reference: https://developers.cloudflare.com/workers-ai/features/json-mode/

@Mabolla
Mabolla merged commit 1d307b5 into main Sep 9, 2026
1 check 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