Skip to content

fix(devin): keep agent loop running on gate blocks by using no-op + PostToolUse context - #61

Merged
cuzfrog merged 2 commits into
mainfrom
fix_devin_agent_loop
Aug 7, 2026
Merged

fix(devin): keep agent loop running on gate blocks by using no-op + PostToolUse context#61
cuzfrog merged 2 commits into
mainfrom
fix_devin_agent_loop

Conversation

@abao-bot

@abao-bot abao-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Devin CLI's PreToolUse decision: "block" stops the current agent turn, which is undesirable for an autonomous agent.
  • This change rewrites blocked write/edit/apply_patch calls to a safe no-op and reports the denial via a new PostToolUse hook using additionalContext, so the agent loop continues and the LLM receives the gate reason.
  • Added PostToolUse registration to the Devin installer and plugin manifest, and updated README translations.
  • Bumped patch version to 1.1.1.

Test plan

  • npm run test passes (410/410)
  • npm run check passes
  • Manual Devin CLI verification: blocked write, edit, and apply_patch to a readonly file all allowed the agent to continue and report the gate; allowed writes still succeed; no guarded files were modified

cuzfrog and others added 2 commits August 6, 2026 20:49
…ostToolUse context

Devin CLI's PreToolUse decision: 'block' stops the current agent turn.
Instead of blocking, the PreToolUse hook now rewrites a denied
write/edit/apply_patch call to a safe no-op:
- write/edit target a sentinel directory (.devin/module-gates/blocked)
- apply_patch receives an invalid patch string

The denial context is written to a per-session sidecar in /tmp and
emitted by the new PostToolUse hook via additionalContext, so the
LLM receives the gate reason and the agent loop continues.

Also installs a PostToolUse entry and updates READMEs/translations.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cuzfrog
cuzfrog merged commit 5807be4 into main Aug 7, 2026
1 check passed
@cuzfrog
cuzfrog deleted the fix_devin_agent_loop branch August 7, 2026 00:52
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