Skip to content

Gate freeshard loop behind CLAYDE_FS_ENABLED (default off)#100

Merged
max-tet merged 2 commits into
mainfrom
feat/fs-enabled-gate
Jun 30, 2026
Merged

Gate freeshard loop behind CLAYDE_FS_ENABLED (default off)#100
max-tet merged 2 commits into
mainfrom
feat/fs-enabled-gate

Conversation

@ClaydeCode

Copy link
Copy Markdown
Owner

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) and worker_task() (Pebble worker) always run.
  • _freeshard_loop(settings) is scheduled only when settings.fs_enabled is true.
  • A one-line log.info at 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_ENABLED in the container's config.env.

Tests

  • Added test_fs_enabled_defaults_off confirming the field defaults to False.
  • Full suite green: 364 passed.
  • The asyncio.gather task-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 conditional tasks.append.

Note

This PR does not change config.env or redeploy — enabling the loop in the running container is a separate follow-up step.

Recommended reading order

  1. src/clayde/config.py — new fs_enabled field.
  2. src/clayde/orchestrator.py — conditional scheduling of _freeshard_loop.
  3. tests/test_config.py — default-off test.

🤖 Generated with Claude Code

Test Bot and others added 2 commits June 30, 2026 10:26
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>
@ClaydeCode ClaydeCode requested a review from max-tet June 30, 2026 10:27
@max-tet max-tet merged commit 4b968f2 into main Jun 30, 2026
3 checks passed
@max-tet max-tet deleted the feat/fs-enabled-gate branch June 30, 2026 10:30
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.

2 participants