Skip to content

fix: add tri-state skill_inject.mode — manual/auto/disabled (PILOT-395)#17

Merged
TeoSlayer merged 2 commits into
mainfrom
openclaw/pilot-395-20260616-124115
Jun 16, 2026
Merged

fix: add tri-state skill_inject.mode — manual/auto/disabled (PILOT-395)#17
TeoSlayer merged 2 commits into
mainfrom
openclaw/pilot-395-20260616-124115

Conversation

@matthew-pilot

Copy link
Copy Markdown
Collaborator

What changed

Replaced the boolean skill_inject.enabled flag in ~/.pilot/config.json with a tri-state skill_inject.mode string: manual, auto, or disabled.

Files changed:

  • config.go — Added GetMode/SetMode, retired EnabledFlag in favor of ModeFlag, kept IsEnabled/SetEnabled as deprecated backward-compat shims
  • skillinject.goTick() uses GetMode instead of IsEnabled; Run() returns after startup tick when mode is manual (no ticker)
  • zz_more_test.go — Added 8 new tests for the mode API

Behavior per mode

Mode Startup tick Reconcile ticker Comparable to
manual ❌ (exits after first tick) One-shot install
auto ✅ every 15 min Current behavior
disabled Old SetEnabled(false)

Verification

  • go build ./...
  • go vet ./...
  • go test -count=1 ./... ✅ (all existing + new tests pass)

Backward compatibility

  • Existing configs with {\\skill_inject\: {\enabled\: true}} are read correctly → ModeAuto
  • SetEnabled(bool) is preserved as a shim → SetMode
  • Missing config defaults to ModeAuto (same as before)

Closes PILOT-395

Add tests for:
- GetMode/SetMode round-trip through disk (manual/auto/disabled)
- Empty config defaults to auto (backward compat)
- Legacy enabled format backward compat
- Empty/invalid mode defaults to auto
- SetMode preserves other config keys
- New mode format preferred over legacy format
…led (PILOT-395)

Replace the boolean skill_inject.enabled flag with a tri-state mode
string (manual | auto | disabled) stored at ~/.pilot/config.json under
skill_inject.mode.

Behavior:
- manual (DEFAULT for new installs): install once on daemon startup
  + refresh on Pilot update, no 15-min reconcile ticker.
- auto: current always-live behavior with 15-min reconcile ticker.
- disabled: no ticks, equivalent to the old SetEnabled(false).

Backward compatibility:
- GetMode() falls back to the legacy EnabledFlag format when no mode
  is set, so existing installs with skill_inject.enabled keep working.
- SetEnabled(bool) is retained as a deprecated shim that maps to
  SetMode (true -> auto, false -> disabled).
- Missing config defaults to ModeAuto (unchanged from before).

New API:
- GetMode(home) string — returns manual/auto/disabled
- SetMode(home, mode) error — persists the mode

Closes PILOT-395
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TeoSlayer TeoSlayer merged commit a008df2 into main Jun 16, 2026
4 checks passed
@TeoSlayer TeoSlayer deleted the openclaw/pilot-395-20260616-124115 branch June 16, 2026 17:49
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