Skip to content

feat: runtime kill-switch via marker file or env var (v3.3.0)#21

Open
royosherove wants to merge 1 commit into
mainfrom
feat/runtime-kill-switch
Open

feat: runtime kill-switch via marker file or env var (v3.3.0)#21
royosherove wants to merge 1 commit into
mainfrom
feat/runtime-kill-switch

Conversation

@royosherove

Copy link
Copy Markdown
Member

Adds an immediate runtime kill-switch so external tooling (e.g. roundhouse /toggle-enforce-branches) can disable enforcement without restarting the agent.

Mechanism

Checked on every bash tool_call, before any tier runs:

  • File-based (persistent): ~/.pi-branch-enforcer/disabled exists → fail-open
  • Env var (process-scope): PI_BRANCH_ENFORCER_DISABLED=1 → fail-open

Effect is immediate — next bash command sees the new state. No agent restart needed.

Why a marker file (not just env var)

  • Survives agent restarts
  • Works for already-running processes
  • Lets a separate tool (Telegram command in roundhouse) flip the switch
  • Stable contract: just a file path, no IPC

Changes

  • index.ts: isDisabled() check at top of tool_call handler
  • README.md: 'Disabling at runtime' section
  • CHANGELOG.md: 3.3.0 entry
  • .gitignore: added (was missing — node_modules was untracked clutter)

Out of scope

The Telegram /toggle-enforce-branches command lives in roundhouse (PR coming separately). This repo just exposes the marker file as a stable contract.

- Check ~/.pi-branch-enforcer/disabled or PI_BRANCH_ENFORCER_DISABLED=1
  on every bash tool_call; if set, return immediately (fail-open)
- Lets external tooling (e.g. roundhouse /toggle-enforce-branches)
  disable enforcement immediately without restarting the agent
- File-based switch persists across agent restarts
- Add .gitignore (node_modules, package-lock, dist)
- README documents both file and env-var paths

Bump 3.2.2 -> 3.3.0
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.

1 participant