qwen-code/docs/developers/development
jinye 54fd5c50f0
feat(telemetry): add detailed sensitive span attributes (#4097)
Layer detailed content attributes onto the existing hierarchical spans
(qwen-code.interaction / qwen-code.llm_request / qwen-code.tool) gated
by includeSensitiveSpanAttributes:

- Interaction span: user prompt (new_context)
- LLM request span: system prompt + hash + preview + length (full text
  deduped per session via SHA-256), tool schemas (per-tool tool_schema
  events, also hash-deduped), model output
- Tool span: tool input, tool result on every exit path (success +
  pre-hook block + post-hook stop + tool error + try-block cancel +
  catch-block cancel + execution exception)

All large content truncated at 60KB with *_truncated and
*_original_length metadata. Heavy serialization (safeJsonStringify on
tool I/O, partToString on user prompt) is guarded by the sensitive
flag at the call site so it doesn't run when telemetry is off.

Also adds:
- getActiveInteractionSpan() helper for client.ts to attach prompt
  attributes to the interaction span.
- Updated config schema description and docs (telemetry.md +
  settings.md) to reflect expanded scope and add security/cost notes.
- 28 unit tests for detailed-span-attributes, 4 tests for
  getActiveInteractionSpan, integration mocks updated.
2026-05-17 00:36:48 +08:00
..
_meta.ts feat: update docs 2025-12-15 09:47:03 +08:00
deployment.md feat: restructure docs 2025-12-04 18:26:05 +08:00
integration-tests.md feat: restructure docs 2025-12-04 18:26:05 +08:00
issue-and-pr-automation.md feat: restructure docs 2025-12-04 18:26:05 +08:00
npm.md chore: remove tiktoken dependency and replace with character-based token estimation 2026-01-17 22:39:18 +08:00
telemetry.md feat(telemetry): add detailed sensitive span attributes (#4097) 2026-05-17 00:36:48 +08:00