Remove hidden default of 5 from max_reblog #57

Closed
coding-agent-marvin8 wants to merge 0 commits from fix/issue-56-max-reblog-no-default into main
coding-agent-marvin8 commented 2026-06-23 20:30:21 +00:00 (Migrated from codeberg.org)

Previously max_reblog had a hardcoded default of 5, causing zhongli to silently stop after 5 posts even when run_continuously = true was set. The field had no documentation and the default was invisible to users who didn't know to look for it.

Changes:

  • max_reblog: int = 5max_reblog: int | None = None — no limit when unset
  • Configuration gains omit_defaults=True so None fields (and other defaults) are cleanly omitted from the written TOML rather than causing a serialization error
  • create_default_config no longer hard-codes max_reblog=5
  • Tests updated: assert max_reblog is None when not set; new tests for _should_stop_boosting with None, at-limit, and below-limit cases

Behaviour after this fix:

  • Unset max_reblog (most users) → runs indefinitely
  • max_reblog = N → stops after N posts, regardless of run_continuously
  • CLI --max-posts N still takes precedence over the config field

Closes #56

Previously `max_reblog` had a hardcoded default of `5`, causing zhongli to silently stop after 5 posts even when `run_continuously = true` was set. The field had no documentation and the default was invisible to users who didn't know to look for it. **Changes:** - `max_reblog: int = 5` → `max_reblog: int | None = None` — no limit when unset - `Configuration` gains `omit_defaults=True` so `None` fields (and other defaults) are cleanly omitted from the written TOML rather than causing a serialization error - `create_default_config` no longer hard-codes `max_reblog=5` - Tests updated: assert `max_reblog` is `None` when not set; new tests for `_should_stop_boosting` with `None`, at-limit, and below-limit cases **Behaviour after this fix:** - Unset `max_reblog` (most users) → runs indefinitely - `max_reblog = N` → stops after N posts, regardless of `run_continuously` - CLI `--max-posts N` still takes precedence over the config field Closes #56
marvin8 commented 2026-06-23 20:59:44 +00:00 (Migrated from codeberg.org)

Manually merged in f934790f9e

Manually merged in f934790f9e7016c0839b620dd88816cd90f5f203

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/dujiangyan!57
No description provided.