Repository navigation
Description
Operating system
Windows
Orca version
1.4.77
Details
Short summary: Orca's managed Claude hook installs a PermissionRequest handler, which is normalized to the waiting state. The completion coordinator treats waiting as a completion signal and immediately dispatches an agent-task-complete system notification — even though the agent has not finished and is in fact waiting for the user to approve a tool call. Every time Claude requests permission for a Bash/Edit/etc. tool, the user sees a "task complete" toast/sound, while the agent is still mid-task.
What happened?
While Claude was in the middle of a multi-step task, I received repeated "task complete" notifications. The notifications fired at the exact moments Claude was about to call a tool that required permission. The agent was not done.
Root cause (verified against main @ 048fc8c):
- Orca auto-injects 7 events into
~/.claude/settings.jsonon every launch, includingPermissionRequest—src/main/claude/hook-settings.ts:27-51.shouldInstallManagedHooksis hard-coded totrue(src/main/startup/configure-process.ts:215-223), so the user cannot opt out without disablingagentStatusHooksEnabledentirely. normalizeClaudeEventmapsPermissionRequest → state: 'waiting'—src/shared/agent-hook-listener.ts:1939-1940.isCompletionHookStatetreatsdone | waiting | blockedas completion inputs —src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts:45-47:function isCompletionHookState(state: ParsedAgentStatusPayload['state']): boolean { return state === 'done' || state === 'waiting' || state === 'blocked' }
- In
observeHookStatus, onlystate === 'done' && workingStatusObservedgoes through the 1.5 sHOOK_DONE_QUIET_MSdebounce window (line 622). Thewaiting/blockedbranch falls through todispatchCompletion('hook', ...)immediately at lines 640-644 — no quiet window, noworking → idlecross-check. - That dispatch flows to
agent-hook-completion-notifications.ts:153→notifications:dispatch→new Notification(...).show().
So Claude requesting permission for a tool — a fundamentally mid-task signal — fires a "task complete" notification.
How can we reproduce it?
- Run Claude Code inside an Orca terminal pane, with default Orca settings (
agentStatusHooksEnabled: true,agentTaskCompletenotification source on). - Give Claude a task that will require a Bash / file-edit / permission-prompted tool call (e.g. ask it to run
npm installor edit a file outside the allow-list). - When Claude requests permission for the tool, Orca fires an
agent-task-completesystem notification, while the agent is still working and merely waiting on user input. - Approve and let Claude continue; another notification fires at the next permission prompt.
Suggested fix (minimal):
Either restrict isCompletionHookState to done only:
function isCompletionHookState(state: ParsedAgentStatusPayload['state']): boolean {
return state === 'done'
}…or route waiting / blocked through a distinct agent-attention-needed notification source with its own settings toggle (so the existing UI affordances for "needs attention" don't go away, but the user can disable the toast independently of "task complete").
Tests to add in agent-hook-completion-notifications.test.ts:
working → waitingdoes not dispatchagent-task-complete.working → waiting → working → donedispatches exactly once ondone.working → blockedfollows the chosen policy.
Open question: blocked semantics across non-Claude agents (Codex, Devin, OpenClaude, Hermes, Gemini, etc.) should be verified before flipping it off — the listener mappings live in src/shared/agent-hook-listener.ts. If blocked ever means "terminated", it should still surface as a completion-like event; if it means "waiting for user", it should be excluded just like waiting.
Related:
- Hooks injection lives in
src/main/claude/hook-service.ts:183-209andsrc/main/agent-hooks/installer-utils.ts:229. - Notification dispatch gate in
src/main/ipc/notifications.ts:251-431. - Possibly related to the broader hook-managed completion path touched by feat(devin): managed hooks, sleeping resume, AI Vault #5380 / Fix duplicate agent completion notifications after worktree switch #5572 / Fix stale agent attention indicators #5517 / Suppress stale agent completion replay after new work #5620.
Activity
Stop PermissionRequest/blocked/waiting hook states from firing agent-…
brennanb2025 commentedon Jun 28, 2026
will be in next release, usually within 24 hours
Stop PermissionRequest/blocked/waiting hook states from firing agent-…
test(agent-completion): assert attention fires alongside done-after-w…
fix(agent-completion): stop PermissionRequest hooks from firing false…
Stop PermissionRequest/blocked/waiting hook states from firing agent-…
fix(agent-completion): stop PermissionRequest hooks from firing false…