agentsclimarketplace

Copilot cost collection

Skill Grimblaz/agent-orchestra/skills/copilot-cost-collection

Copilot OTel cost collection setup and interpretation guidance. Use when enabling local Copilot Chat OTel file export, installing the workspace sentinel, or explaining branch-correlated Copilot cost telemetry. DO NOT USE FOR: Claude-native cost capture, durable session memory handoff, review-pipeline scoring logic, or session-cost discipline behavior rules (see skills/terminal-hygiene/SKILL.md § Session-Cost Discipline).From its SKILL.md

Install
npx -y skills add Grimblaz/agent-orchestra --skill copilot-cost-collection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.6 KB, as published. Nobody here has run it

Copilot Cost Collection

This skill documents the machine-local setup needed for Copilot-side cost telemetry in Agent Orchestra. It pairs the Copilot Chat OTel file exporter with the cost walker that attributes sessions to the active branch by joining OTel session timestamps to the git reflog.

Methodology

  1. Enable Copilot Chat OTel export to a local file.
  2. Write a literal workspace-specific github.copilot.chat.otel.outfile path. Do not rely on VS Code variable templates for this setting; issue #488 OQ1 showed the exporter did not expand them in this environment.
  3. Keep setup state machine-local: user settings, workspace .vscode/settings.json, the OTel JSONL directory, and .copilot-cost-collection-installed are local operating state, not durable plan or session memory.
  4. Let the cost walker correlate sessions to branches from the git reflog. Branch switches, detached checkouts, and reflog pruning can reduce attribution confidence.

Install Contract

Run the installer from the repo root or pass -WorkspacePath explicitly:

pwsh -NoProfile -ExecutionPolicy Bypass -File skills/copilot-cost-collection/scripts/Initialize-CopilotCostCollection.ps1 -WorkspacePath . -Yes -NonInteractive

The installer is additive and idempotent:

  • VS Code user settings: sets github.copilot.chat.otel.enabled=true, github.copilot.chat.otel.exporterType="file", and github.copilot.chat.otel.captureContent=false while preserving other keys.
  • Workspace settings: sets github.copilot.chat.otel.outfile to a literal path shaped like <UserHome>/.copilot-otel/<workspaceFolderBasename>/copilot.jsonl.
  • Workspace root: writes .copilot-cost-collection-installed with provenance fields and keeps it ignored by git.
  • OTel directory: creates the parent directory for the JSONL file but does not create the JSONL file.

Use -UserSettingsPath for VS Code profiles, Insiders, portable installs, or any alternate user-data directory. The default targets stable VS Code user settings for the current OS.

Branch Correlation Rules

Copilot OTel records do not carry a repository branch. The walker groups token-bearing records by session.id, uses the earliest session timestamp, and joins that timestamp to the git reflog window for the target branch.

Known limitations:

  • Multi-worktree or cross-checkout sessions can be ambiguous when the same OTel file receives events from more than one workspace.
  • Reflog pruning, manual reflog expiry, or missing checkout entries can make old sessions unattributable.
  • A long Copilot session that spans a branch switch is attributed by session start time, not by every later token event.

Machine-Local State

Survival: within-worktree; contract: SMC-08 style local setup note, not a durable phase-completion marker.

The sentinel and settings prove local install provenance only. Do not treat them as plan state, review state, CE evidence, or cross-tool durable handoff. Durable workflow state still belongs in GitHub issue comments, PR bodies, committed docs, or the session-memory mechanisms named by skills/session-memory-contract/SKILL.md.

Platform-specific invocation

This skill's methodology is tool-agnostic. Platform-specific setup notes live alongside:

Related

Gotchas

TriggerGotchaFix
Writing ${userHome} or ${workspaceFolderBasename} into github.copilot.chat.otel.outfileCopilot Chat file export may treat the template as a literal and never create the expected JSONL fileRun the installer so the workspace setting receives a literal resolved path
Opening the repo in VS Code Insiders, a profile, or a portable user-data dirThe default user settings path may update stable VS Code instead of the active profileRe-run with -UserSettingsPath pointing at the active settings.json
Treating .copilot-cost-collection-installed as workflow memoryThe sentinel is local and uncommitted, so other machines and agents cannot rely on itUse SMC durable markers or PR-body metrics for cross-session handoff

Frame Ports Filled By This Skill

None. This is setup methodology only. The Step 9 implementation slice provides implement-code through Code-Smith; this skill declares no provides: field.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.