Skip to content

docs(tracing): explain recorder ownership, stream IDs, and promise status - #503

Open
SaKaNa-Y wants to merge 2 commits into
devframes:mainfrom
SaKaNa-Y:docs/tracing-recorder-lifecycle
Open

SaKaNa-Y wants to merge 2 commits into
devframes:mainfrom
SaKaNa-Y:docs/tracing-recorder-lifecycle

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

A panel that waits for a new streamId after calling record(name) a second time can wait indefinitely. The event reference now explains when the panel can keep its subscription.

- A fresh id is issued on every `record()` and `clear()`.
+ Use the advertised ID.
+ Devframe creates a stream when the channel starts recording and replaces the stream when the selected source reports a clear during recording.
+ Repeating `record()` on the built-in recorder keeps the current stream.

When two active recorders share a channel name, records(name) reads the selected recorder's buffer. The stream can keep the same ID across a switch, so a new subscriber can replay updates from the earlier recorder.

Evidence

Case Before (previous documentation) After (verified behavior now documented)
Shared channel name The guide said Devframe never records a channel supplied by an attached tool. After stop(name) stopped the tool's recorder, the local recorder still captured require('node:os'). Detaching the tool revealed that call in the local buffer.
Repeated record() The event reference promised a fresh ID. A second call kept both the ID and the buffered record. Clearing the active recording changed the ID.
Pending promise The example described the final result or error without explaining the earlier ok. The synchronous end event marked a pending query as ok. A later rejection changed the same record to error. Node then emitted asyncEnd.

Merge Danger

Door: Two-way. The patch changes documentation and type comments.

Blast Radius: Documentation. The guidance affects authors who subscribe to trace streams or display live query status.

@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/503?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-22 04:43 UTC
🔗 head 02a059e
🤖 automated by pulls.review

{
  "headSha": "02a059e752a03fea5904f442d5e9f142bb122d91",
  "result": {
    "overallSummary": "Fixes documentation and type comments that previously described incorrect or incomplete tracing behavior: it clarifies that the `devframe:tracing` stream ID does not change on every `record()`/`clear()`, explains how `tracePromise` reports pending (`ok`) vs settled (`error`)/`asyncEnd` results, and corrects the claim that devframe never records a channel shared with an attached tool's recorder.",
    "groups": [
      {
        "key": "docs-tracing-clarification",
        "label": "Tracing docs clarification",
        "summary": "Clarifies previously inaccurate documentation and type comments about tracing recorder ownership when multiple sources share a channel name, when the `devframe:tracing` stream ID changes (not on every `record()`/`clear()`), and how `tracePromise` reports pending vs settled results via `ok`/`error`/`asyncEnd`. Corrects the earlier incorrect claim that devframe never records an attached tool's channel.",
        "category": "docs",
        "filePaths": [
          "docs/content/1.guide/24.tracing-channels.md",
          "docs/content/8.references/3.events.md",
          "docs/content/8.references/4.node-api.md",
          "packages/devframe/src/types/tracing.ts"
        ],
        "fileNotes": [
          {
            "path": "docs/content/1.guide/24.tracing-channels.md",
            "text": "Main guide update: explains stream ID lifecycle, the tracePromise pending `ok` state, and the real behavior when a local recorder and an attached tool share a channel name."
          },
          {
            "path": "packages/devframe/src/types/tracing.ts",
            "text": "Updates JSDoc comments on `DevframeTracingChannelInfo.streamId`, `recording`, `DevframeTracingSource`, and `attach` to match the corrected documentation (no longer claims devframe never records a shared-name channel)."
          }
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-22T04:43:23.645Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@SaKaNa-Y SaKaNa-Y changed the title docs(tracing): clarify recorder ownership and lifecycle docs(tracing): explain recorder ownership, stream IDs, and promise status Nov 21, 2026
@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review November 22, 2026 04:41

This branch has not been deployed

No deployments
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