Skip to content

[telemetry] 🤖 feat: measure advisor cache usage and savings - #4205

Open
coadler wants to merge 2 commits into
mainfrom
advisor-cache-dt21
Open

[telemetry] 🤖 feat: measure advisor cache usage and savings#4205
coadler wants to merge 2 commits into
mainfrom
advisor-cache-dt21

Conversation

@coadler

@coadler coadler commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add an advisor completion event to PostHog. Measure cache usage, estimated savings, timing, and call outcomes without changing cache behavior.

Background

Advisor cache writes can cost more than they save. Existing telemetry cannot measure this tradeoff.

Implementation

  • Record successful, failed, and cancelled calls. Exclude calls rejected by the usage limit.
  • Round token counts, timing, and estimated costs. Preserve unknown values as null.
  • Compare read savings with the write premium before rounding.
  • Limit cost estimates to known Anthropic pricing with one known TTL.
  • Exclude prompt content, cache keys, endpoint URLs, and unresolved custom model names.

Risks

Cache cost estimates use catalog rates, not invoice charges. Mixed TTLs and unsupported pricing remain unknown.
Telemetry errors do not change the advisor result. No personal deployment validation is available.


Generated with xum • Model: openai:gpt-6-astra • Thinking: medium • Cost: $13.41

## Summary

Add an advisor completion event to PostHog. Measure cache usage, estimated savings, timing, and call outcomes without changing cache behavior.

## Background

Advisor cache writes can cost more than they save. Existing telemetry cannot measure this tradeoff.

## Implementation

- Record successful, failed, and cancelled calls. Exclude calls rejected by the usage limit.
- Round token counts, timing, and estimated costs. Preserve unknown values as null.
- Compare read savings with the write premium before rounding.
- Limit cost estimates to known Anthropic pricing with one known TTL.
- Exclude prompt content, cache keys, endpoint URLs, and unresolved custom model names.

## Risks

Cache cost estimates use catalog rates, not invoice charges. Mixed TTLs and unsupported pricing remain unknown.
Telemetry errors do not change the advisor result. No personal deployment validation is available.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `medium` • Cost: `$13.41`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=medium costs=13.41 -->
@mintlify

mintlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Sep 10, 2026, 9:33 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@chatgpt-codex-connector

This comment has been minimized.

@coadler

coadler commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@coadler

coadler commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7853f11ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/tools/advisor.ts
Measure cache policy after transport injection and TTL overrides.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `medium` • Cost: `$26.20`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=medium costs=26.20 -->
@coadler

coadler commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: f5d59fa595

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

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