Skip to content

feat: add per-turn transparency receipts #125

Description

@QueryPlanner

Summary

Add a /trace or /why command that gives users a privacy-safe receipt for the
last agent turn: model, tools, duration, token/cost metadata when available, and
external services that received data. This should provide user-facing trust without
exposing hidden reasoning or sensitive content.

Priority

P2

Level of Effort

Medium (1 day)

Scope

  • Define a typed per-turn receipt produced by the ADK runtime and callbacks.
  • Store only the latest bounded receipt per conversation.
  • Add Telegram command routing and a transport-neutral formatter.
  • Record external destinations such as OpenRouter, Jina, Mem0/Qdrant, weather,
    Brave Search, and sandbox services when used.
  • Exclude prompts, chain-of-thought, credentials, and raw sensitive tool payloads.

Passing Criteria

  • /trace returns the last completed turn receipt for the current conversation.
  • Receipts cannot be retrieved across Telegram chats or topic threads.
  • Tests verify model, tool, duration, token, and external-destination fields.
  • Tests verify secrets, prompt contents, hidden thoughts, and raw tool arguments are
    absent.
  • Receipt storage is bounded and cleaned up with the session lifecycle.
  • The feature remains compatible with the embedded observability dashboard tracked
    in issue Embedded DuckDB Observability Dashboard #100.

Sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions