Skip to content

[Workers] Update Tail Handler docs to match TraceItem types - #36118

Open
namnhcntt wants to merge 1 commit into
cloudflare:productionfrom
namnhcntt:fix/tail-handler-traceitem-types
Open

namnhcntt wants to merge 1 commit into
cloudflare:productionfrom
namnhcntt:fix/tail-handler-traceitem-types

Conversation

@namnhcntt

Copy link
Copy Markdown

Summary

Updates the Tail Handler documentation (src/content/docs/workers/runtime-apis/handlers/tail.mdx) so the documented type names and properties match @cloudflare/workers-types (5.20261202.1) and workerd (src/workerd/api/trace.h).

Changes:

  • Rename TailItems / TailItem -> TraceItem, FetchEventInfo -> TraceItemFetchEventInfo, TailRequest -> TraceItemFetchEventInfoRequest, TailResponse -> TraceItemFetchEventInfoResponse, TailLog -> TraceLog, and TailException -> TraceException, updating all internal section anchors accordingly.
  • Add a TypeScript tab under Syntax showing events: TraceItem[].
  • Document the remaining TraceItem properties (diagnosticsChannelEvents, executionModel, truncated, cpuTime, wallTime, optional metadata fields), TraceDiagnosticChannelEvent, and the non-fetch TraceItem*EventInfo event types (TraceItemScheduledEventInfo, TraceItemQueueEventInfo, TraceItemAlarmEventInfo, TraceItemEmailEventInfo, TraceItemTailEventInfo, TraceItemJsRpcEventInfo, TraceItemHibernatableWebSocketEventInfo, TraceItemOnHibernateEventInfo).
  • Fix TraceException.message type from object to string and add optional stack.

Closes #35994.

Documentation checklist


Disclosure: AI assistance was used to cross-check @cloudflare/workers-types definitions and draft this documentation update; all type names, properties, and MDX anchors were verified against @cloudflare/workers-types@5.20261202.1 and cloudflare/workerd.

Copilot AI balanced review requested due to automatic review settings December 5, 2026 01:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed 7c5f8c9 · 1 finding · incremental

👉 Fix in your agent 👈
Fix the following review findings in PR #36118 (https://github.com/cloudflare/cloudflare-docs/pull/36118).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification.
- If you disagree, explain why.
- If you need clarification before deciding, ask those questions.
- Then share your plan for which issues to tackle and in what order.

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit because the next review reads PR comments.

## Style Guide
- S-079da272 | src/content/docs/workers/runtime-apis/handlers/tail.mdx:36 | Raw `ts` fence with a default-export handler
  This added ` ```ts ` block in a docs MDX file exports a `default` handler (`async tail(events: TraceItem[], env: Env, ctx: ExecutionContext)`), which the Workers code-sample convention renders through `<TypeScriptExample>` instead of a bare fence.

Style Guide

  • src/content/docs/workers/runtime-apis/handlers/tail.mdx:36 · Raw ts fence with a default-export handler

    This added ```ts block in a docs MDX file exports a default handler (async tail(events: TraceItem[], env: Env, ctx: ExecutionContext)), which the Workers code-sample convention renders through &lt;TypeScriptExample&gt; instead of a bare fence.

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Review coverage

✅ The ownership area is covered.

✅ 1 area already covered
Area Approved by
workers
1 file changed
irvinebroque
CODEOWNERS mappings for displayed areas (1)
Pattern Owners
/src/content/docs/workers/ @GregBrimble, @irvinebroque, @korinne, @MattieTK, @mikenomitch, @vy-ton, @WalshyDev, @cloudflare/deploy-config, @cloudflare/dev-plat-leads, @cloudflare/workers-runtime-1, @cloudflare/wrangler, @cloudflare/product-owners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tail Handler types are documented with incorrect names

3 participants