Gate freeshard loop behind CLAYDE_FS_ENABLED (default off)#100
Merged
Conversation
Introduce CLAYDE_FS_ENABLED so the freeshard issue-grinding loop can be toggled independently of the Pebble webhook. Defaults to False so the loop is opt-in. Covered by a config-default test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_run_with_pebble now only schedules _freeshard_loop when settings.fs_enabled is true; the Pebble webhook server and worker always run. Logs whether the loop is enabled or disabled so the container state is visible at startup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a config switch,
CLAYDE_FS_ENABLED(Settings.fs_enabled, default False), that gates the freeshard issue-grinding loop. When the container runs with the Pebble webhook (_run_with_pebble), the loop is now opt-in:server.serve()(Pebble webhook) andworker_task()(Pebble worker) always run._freeshard_loop(settings)is scheduled only whensettings.fs_enabledis true.log.infoat startup states whether the loop is enabled or disabled, so container state is visible in the logs.Why
The freeshard loop previously ran unconditionally alongside Pebble. This makes it possible to keep Pebble (and the worker) serving while turning the issue loop off. Defaulting the switch off means the loop must be explicitly enabled via
CLAYDE_FS_ENABLEDin the container's config.env.Tests
test_fs_enabled_defaults_offconfirming the field defaults to False.asyncio.gathertask-selection wiring lives in the async container entrypoint (_run_with_pebble); exercising it directly would require heavy event-loop/uvicorn mocking for little value, so it is covered by manual deploy verification rather than a unit test. The behaviour is a simple conditionaltasks.append.Note
This PR does not change
config.envor redeploy — enabling the loop in the running container is a separate follow-up step.Recommended reading order
src/clayde/config.py— newfs_enabledfield.src/clayde/orchestrator.py— conditional scheduling of_freeshard_loop.tests/test_config.py— default-off test.🤖 Generated with Claude Code