Repository navigation
feat: allow install dir as a param - #1
Merged
Merged
Conversation
This was referenced Jun 10, 2026
gewenyu99
added a commit
that referenced
this pull request
Jul 7, 2026
…_skill halt
Three field fixes from the 2026-07-07 triage, all aimed at agents spiraling instead of adapting:
1. YARA repeat-block guard (code, not prompt): the runtime notes already say "retrying the same edit will just block again", but post-2.38.1 data shows ~4.2 blocks per affected run — the prompt alone doesn't hold. Both fences now track the exact payloads they block (tool + content hash). An identical retry gets an escalated reason ("this exact content was ALREADY blocked — change the code, not the retry"), and from the third attempt on the agent is told to note it in the setup report and move on. Wired into the pi security extension's pre-execution scan (bash/write/edit) and the anthropic PreToolUse Bash hook; the tracker lives in yara-hooks so both share one implementation.
2. PI_RUNTIME_NOTES: tell the agent not to delete .posthog-events.json (the host removes it after the run; `rm` is the #1 bash denial at ~31/week) and to `write` new files directly instead of `read`ing a missing path first (the fence errors on reads of nonexistent files and the read doesn't count).
3. posthog-integration prompt STEP 2: if install_skill fails, emit [ERROR-RESOURCE-MISSING] and halt — same pattern STEP 1 already has for load_skill_menu — instead of freelancing the integration without the skill.
Generated-By: PostHog Code
Task-Id: bcb96bcb-e37f-421d-841d-738647c73b8e
gewenyu99
added a commit
that referenced
this pull request
Jul 7, 2026
… capture-and-continue on skill install failure Reworks three pieces of this PR per review: 1. rm .posthog-events.json shouldn't be fence-blocked (it isn't on anthropic): Bash sits in BASE_ALLOWED_TOOLS, so the claude-agent-sdk auto-approves it and canUseTool is never consulted — the install/build allowlist only ever bites on pi, where this rm was the #1 denial. wizardCanUseTool now allows exactly `rm [-f] [./].posthog-events.json` (after the operator checks, so chaining still dies), and the "don't delete it" prompt note is gone. The pi host-side cleanup stays as a safety net. 2. The read-before-write pi note treated a self-inflicted problem as a harness fence: pi's write/edit have NO read requirement (verified in pi 0.79.8 source — write is mkdir+writeFile, edit fuzzy-matches oldText; no read tracking exists). The wizard's own shared prompt line ("You must read a file immediately before attempting to write it, even if you have previously read it") is what sent agents to read nonexistent paths. That line now states the accurate rule — read existing files before editing/overwriting; never read a path that doesn't exist yet — and the pi note is deleted. 3. install_skill failure no longer halts. A freestyled integration beats an outright failure, but the run must be measurable: new [SKILL-INSTALL-FAILED] signal, STEP 2 tells the agent to emit it and continue from its own knowledge (noting the missing skill in the setup report), and both harnesses capture a `wizard: agent continued without skill` event with the detail — complementing the tool-level `wizard: skill install failed` event from #807. Generated-By: PostHog Code Task-Id: bcb96bcb-e37f-421d-841d-738647c73b8e
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.
We use this locally when testing, so it's helpful to have it as a param rather than as an env var so you can switch between test apps.