Initial exploration of cost optimizer sub command#317154
Draft
cwebster-99 wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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-optimizerprompt file in the Copilot extension’schatPromptFiles. - 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addition of cost optimization prompt:
chronicle-cost-optimizer.prompt.mdthat analyzes session history for token efficiency, highlights common inefficiency patterns (such as premium model overuse and runaway loops), and recommends optimizations.package.jsonso it is available whengithub.copilot.sessionSearch.enabledis true and for local session types.