Skip to content

fix(router): honor stats filePath#272

Open
snvtac wants to merge 1 commit into
OpenBMB:mainfrom
snvtac:snvtac/251-stats-filepath
Open

fix(router): honor stats filePath#272
snvtac wants to merge 1 commit into
OpenBMB:mainfrom
snvtac:snvtac/251-stats-filepath

Conversation

@snvtac

@snvtac snvtac commented Jun 23, 2026

Copy link
Copy Markdown

Summary

  • preserve router.stats.filePath when parsing router stats config
  • write router stats to the exact configured file path instead of always using stats.jsonl
  • treat a blank filePath as unset so existing/default stats persistence still works

Root cause

parseStats accepted router.stats but did not carry filePath into RouterStatsConfig. Even if a caller provided filePath directly, TokenStatsCollector only used it to derive a directory and then always wrote stats.jsonl.

Impact

Users and tests can now configure a full stats output path such as /tmp/custom-name.jsonl and the collector will write to that exact file. Existing configs without filePath, or with an empty templated value, continue to use the default ~/.pilotdeck/router/stats.jsonl.

Validation

  • PILOTDECK_SKIP_BOOTSTRAP=1 npm test
  • git diff --check

Closes #251

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.

bug(router): stats.filePath is parsed as a file path but always writes stats.jsonl

1 participant