Skip to content

fix(cli): reload config on each daemon sync cycle#49

Merged
Phil-Fan merged 1 commit into
mainfrom
fix/daemon-config-reload
May 16, 2026
Merged

fix(cli): reload config on each daemon sync cycle#49
Phil-Fan merged 1 commit into
mainfrom
fix/daemon-config-reload

Conversation

@Phil-Fan

Copy link
Copy Markdown
Contributor

Summary

  • Reload config from disk before every daemon sync iteration so changes made via tokenarena config set (apiKey, apiUrl, etc.) take effect without a manual service restart

Context

The daemon only called loadConfig() once at startup, then reused that config object in its sync loop. After modifying config values, the daemon continued using stale credentials, causing "Could not fetch usage settings" errors until tokenarena service restart was run.

Test plan

  • Start daemon with valid config
  • Run tokenarena config set apiKey <new-key>
  • Verify daemon picks up the new key on the next sync cycle (no restart needed)

🤖 Generated with Claude Code

The daemon only loaded config at startup, so changes made via
`tokenarena config set` (e.g. apiKey, apiUrl) were ignored until
a manual `service restart`. Now loadConfig() is called before
every sync iteration so the daemon picks up config changes
automatically.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

React Doctor

Score: 95 / 100

react-doctor v0.1.6

✔ Select projects to scan › token-arena-web
Scanning changes: fix/daemon-config-reload → main

No changed source files in /home/runner/work/TokenArena/TokenArena/web, skipping.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Workspace Lines Statements Functions Branches
CLI 82.76% 79.41% 82.12% 66.87%
Web 80.59% 80.43% 78.20% 70.47%

Coverage thresholds are enforced in the vitest config.

@Phil-Fan Phil-Fan merged commit de404e8 into main May 16, 2026
19 checks passed
@Phil-Fan Phil-Fan deleted the fix/daemon-config-reload branch May 16, 2026 05:15
@codecov

codecov Bot commented May 16, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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