Skip to content

Commit f44b400

Browse files
committed
feat: enable pricing and version checking by default, add version logging
Enhanced default configuration to provide better out-of-the-box functionality: - Enable pricing_update_enabled by default (was False) - Enable version_check_enabled by default (was False) - Add version information to CLI command logging for serve and claude commands - Remove debug print statement from serve command - Update configuration descriptions for clarity - Adjust unit tests to reflect new default values - Add version check disable in integration test to prevent network calls during testing These changes improve the user experience by enabling useful features by default while maintaining privacy-conscious design and proper version tracking in logs.
1 parent c3ef714 commit f44b400

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

ccproxy/cli/commands/serve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from click import get_current_context
1111
from structlog import get_logger
1212

13+
from ccproxy._version import __version__
1314
from ccproxy.cli.helpers import (
1415
get_rich_toolkit,
1516
is_running_in_docker,
@@ -709,7 +710,6 @@ def api(
709710

710711
# Always reconfigure logging to ensure log level changes are picked up
711712
# Use JSON logs if explicitly requested via env var
712-
print(f"{settings.server.log_level} {settings.server.log_file}")
713713
setup_logging(
714714
json_logs=settings.server.log_format == "json",
715715
log_level_name=settings.server.log_level,
@@ -729,6 +729,7 @@ def api(
729729
logger.info(
730730
"cli_command_starting",
731731
command="serve",
732+
version=__version__,
732733
docker=docker,
733734
port=server_options.port,
734735
host=server_options.host,
@@ -896,6 +897,7 @@ def claude(
896897
logger.info(
897898
"cli_command_starting",
898899
command="claude",
900+
version=__version__,
899901
docker=docker,
900902
args=args if args else [],
901903
)

ccproxy/config/scheduler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class SchedulerSettings(BaseSettings):
3434

3535
# Pricing updater task settings
3636
pricing_update_enabled: bool = Field(
37-
default=False,
38-
description="Whether pricing cache update task is enabled. Disabled by default for privacy - downloads from GitHub when enabled",
37+
default=True,
38+
description="Whether pricing cache update task is enabled. Enabled by default for privacy - downloads from GitHub when enabled",
3939
)
4040

4141
pricing_update_interval_hours: int = Field(
@@ -84,8 +84,8 @@ class SchedulerSettings(BaseSettings):
8484

8585
# Version checking task settings
8686
version_check_enabled: bool = Field(
87-
default=False,
88-
description="Whether version update checking is enabled. Disabled by default for privacy - checks GitHub API when enabled",
87+
default=True,
88+
description="Whether version update checking is enabled. Enabled by default for privacy - checks GitHub API when enabled",
8989
)
9090

9191
version_check_interval_hours: int = Field(

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ build-backend = "hatchling.build"
4242
[tool.hatch.version]
4343
source = "vcs"
4444

45+
4546
[tool.hatch.build.hooks.vcs]
4647
version-file = "ccproxy/_version.py"
4748

tests/unit/services/test_scheduler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,11 @@ def test_scheduler_settings_defaults(self) -> None:
387387
assert settings.enabled is True
388388
assert settings.max_concurrent_tasks == 10
389389
assert settings.graceful_shutdown_timeout == 30.0
390-
assert settings.pricing_update_enabled is False
390+
assert settings.pricing_update_enabled is True # Enabled by default for privacy
391391
assert settings.pricing_update_interval_hours == 24
392-
assert settings.pushgateway_enabled is False
393-
assert settings.stats_printing_enabled is False # Default is False
392+
assert settings.pushgateway_enabled is False # Disabled by default
393+
assert settings.stats_printing_enabled is False # Disabled by default
394+
assert settings.version_check_enabled is True # Enabled by default for privacy
394395

395396
def test_scheduler_settings_environment_override(self) -> None:
396397
"""Test scheduler settings from environment variables."""
@@ -488,6 +489,9 @@ async def test_scheduler_with_tasks_configured(self) -> None:
488489
settings.scheduler.stats_printing_interval_seconds = 60.0
489490
settings.scheduler.pricing_update_enabled = True
490491
settings.scheduler.pricing_update_interval_hours = 6
492+
settings.scheduler.version_check_enabled = (
493+
False # Disable version check for this test
494+
)
491495

492496
with (
493497
patch("ccproxy.observability.metrics.get_metrics"),

0 commit comments

Comments
 (0)