Repository navigation
Conversation
In-isolate OpenTelemetry recipe around env.AI.run with awaited flush, example Worker, unit tests and a local workerd E2E script. Native Cloudflare OTLP export documented as unsupported. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Run the recipe against the real Workers AI API (llama-3.1-8b-instruct): success with real usage, real 400 error, privacy scan. Adds the live-entry REST-backed env.AI used for the run and a note on the 2s flush bound against a slow collector. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…H-8278) The warning still said no Cloudflare API was called and no real model responses were exercised, which the 2026-10-19 section contradicts. It now says the calls went to the real Workers AI API, not through the ai binding, nothing was deployed, and the e2e script still uses a stand-in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nik13
marked this pull request as ready for review
October 21, 2026 22:46
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Preserve current integration catalog entries alongside the Workers AI guide. Co-Authored-By: Claude Code <[email protected]>
nik13
marked this pull request as draft
November 9, 2026 01:27
Use published @traceai/auto 0.1.2 on the OpenAI-compatible REST endpoint. Add offline conformance for span metadata, content privacy, HTTP failure and snippet parity. Keep live qualification blocked on the missing staged Cloudflare token. Co-Authored-By: Claude Code <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes TH-8278 (parent TH-8103).
Replace the copied workerd tracing/exporter implementation with the published
@traceai/[email protected]package. The guide now uses ordinary Node.js globalfetchcalls to Workers AI's OpenAI-compatible/ai/v1/chat/completionsendpoint, with one startup preload and no tracing imports in the application.main(ddca13930bd9c4b9cc80384b7cf2b1a0d71fa43d) and resolve the integration-catalog conflict without dropping other integrations.Why this path
The old recipe transferred maintenance of tracing source to customers. The released preload recognizes Cloudflare's host and the OpenAI-compatible chat protocol. It is a maintained path for an existing Node REST client and does not require a Worker deployment or Cloudflare account-setting changes.
Cloudflare Workers native OTLP destinations and AI Gateway OTLP export are separate supported Cloudflare mechanisms; this PR no longer labels native export unsupported. It does not configure either service or claim that the Node preload instruments deployed Workers,
env.AI.run, streaming, tools, or Worker lifecycle spans.Verification
All execution was in E2B or GitHub Actions, not on the local machine.
th8103-cf964-node20-r1: Node 20.6.0, published@traceai/auto 0.1.2/@traceai/fi-core 1.2.3; 5/5 passed. Verifies one model span (no duplicate), provider/model/usage/project routing, input/output hiding, HTTP 403 ERROR export with a nonzero application exit, missing provider credentials, and exact MDX/application parity. Captured OTLP excludes synthetic credentials and the account ID. This is a fake provider transport plus real package/exporter/loopback collector, not a live Cloudflare call. Sandbox termination confirmed.th8103-cf964-offline-r1: 5/5 example tests; 273/273 docs integration tests; integration TypeScript check passed; zero broken navigation or content links. The full Astro build then hit Node's approximately 2 GiB heap limit (exit 134). Sandbox termination confirmed.th8103-cf964-build-r2: full Astro build and Pagefind passed withNODE_OPTIONS=--max-old-space-size=6144; the Workers AI page rendered, and Pagefind indexed 851 pages. Exit 0; sandbox termination confirmed. This resolves the first run's heap-limit failure without a repository build-configuration change.examples/runtimes/cloudflare-workers-aiwithnpm ci --ignore-scripts --no-audit --no-fund && npm test. No provider credentials or external model calls are required by these tests.c12c294b46d26637a7dc93ed7667db41abd59cbd: 10/10 successful, including PR Checks (docs build/Pagefind, browser checks, link audit and Helicone conformance), Workers AI Node 20.6.0 / 22.18.0 conformance, Temporal Go contracts and FastMCP contracts.Publication blocker — keep draft
The approved credential-staging helper failed before starting a provider sandbox:
missing in key file: ['CLOUDFLARE_API_TOKEN']. No real Cloudflare calls were made and no trace was forwarded to Future AGI Cloud for this replacement. Historical workerd evidence does not qualify the new package route.Required human step: make a Workers AI Read token for the intended account available to the existing approved staging helper, without sharing it in the PR or chat. Then run 2–3 minimal calls with the documented Llama 3.2 1B model, check captured OTLP for provider-key absence, forward one real trace to the
th8103-docsCloud project and record its trace ID. No Worker deployment or account-setting change is needed.Do not merge, publish or close TH-8278 until that live qualification succeeds and the latest-head checks are green. No ticket was closed and no merge/publication was performed in this pass.
Review scope
Reviewed against the internal minimal-code, failure-mode, PR, naming and testing standards. The actual diff is confined to this guide/catalog entry, replacement example and its CI. There are no migrations, API/EE boundaries or frontend contracts changed. Product E2E coverage is not applicable (no
e2e/harness). The new tests and docs gates provide offline evidence only; missing live provider/Cloud qualification remains the release blocker. No separate review comment or approval was posted.🤖 Generated with Claude Code