Skip to content

Initial exploration of cost optimizer sub command#317154

Draft
cwebster-99 wants to merge 1 commit into
mainfrom
chronicle-cost-optimizer
Draft

Initial exploration of cost optimizer sub command#317154
cwebster-99 wants to merge 1 commit into
mainfrom
chronicle-cost-optimizer

Conversation

@cwebster-99
Copy link
Copy Markdown
Member

Addition of cost optimization prompt:

  • Added a new prompt file chronicle-cost-optimizer.prompt.md that analyzes session history for token efficiency, highlights common inefficiency patterns (such as premium model overuse and runaway loops), and recommends optimizations.
  • Registered the new cost optimizer prompt in package.json so it is available when github.copilot.sessionSearch.enabled is true and for local session types.

Copilot AI review requested due to automatic review settings May 18, 2026 20:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an initial “cost optimizer” Chronicle sub-command by adding a dedicated prompt file and expanding the Chronicle skill guidance to include a budget/token-efficiency workflow.

Changes:

  • Registered a new chronicle:cost-optimizer prompt file in the Copilot extension’s chatPromptFiles.
  • Extended the Chronicle skill documentation with a detailed “Budget” workflow, including suggested SQL queries for cloud (DuckDB) and local (SQLite) session stores.
  • Added the new prompt markdown file that triggers the cost-optimizer flow and prioritizes common inefficiency patterns.
Show a summary per file
File Description
extensions/copilot/package.json Registers the new cost-optimizer prompt so it’s available when Chronicle session search is enabled.
extensions/copilot/assets/prompts/skills/chronicle/SKILL.md Adds a new “Budget” workflow with detailed token/cost analysis guidance and query templates.
extensions/copilot/assets/prompts/chronicle-cost-optimizer.prompt.md Introduces the new user-facing prompt entrypoint for cost optimization analysis.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines +115 to +119
Three possible outcomes — handle each explicitly:

- **Query succeeds** → you have the **cloud DuckDB** backend. Proceed with the full query set below.
- **Query fails with a SQL/table error** (e.g. "table events does not exist") → you have the tool but no events data; fall through to the **local SQLite** queries.
- **Tool itself is unavailable** → tell the user to enable `github.copilot.chat.localIndex.enabled` in VS Code Settings.
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.

2 participants