Skip to content

Feature intervention popup#39

Open
MercuryJ29 wants to merge 8 commits into
mainfrom
feature_intervention_popup
Open

Feature intervention popup#39
MercuryJ29 wants to merge 8 commits into
mainfrom
feature_intervention_popup

Conversation

@MercuryJ29

Copy link
Copy Markdown
Collaborator

完成弹窗功能实现,但存在以下两点需要进行确认:

1、合并main分支代码时存在冲突,我fix后检查了功能,看起来没有影响,需要确认。
2、我这边应用内agent管理中显示本地claude code agent显示环境异常,我让claude code做了修复,需要确认这个修复是否是必要的,改动在本次pr的最初两次commit中。

MercuryJ29 and others added 8 commits June 9, 2026 22:42
On Windows, npm installs Claude Code as a .cmd script that wraps the
real claude.exe. Node.js child_process.spawn() cannot execute .cmd files
directly (returns EINVAL), causing the @agentclientprotocol/claude-agent-acp
adapter to fail with "spawn EINVAL" on session/new.

Add resolve_cmd_to_exe() to parse npm-generated .cmd wrappers and extract
the underlying .exe path. Integrate into find_executable_in_path() and
spawn_adapter() so the CLAUDE_CODE_EXECUTABLE env var always points to a
real executable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…on Windows

- Remove use_local_claude gate from spawn_adapter so the env var is set
  regardless of the user preference, letting the ACP adapter skip its
  bundled launcher binary that fails on Windows.
- Reorder find_executable_in_path on Windows to check .exe and .cmd
  (resolved → real .exe) before the bare name, so extensionless npm
  global shims are never returned as the resolved executable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tervention

Inject intervention_notifier callback into App (following acp_live_update
pattern). When orchestrator pauses a run for manual check, permission, or
error, the callback sends a Windows toast notification via notify-rust and
emits a Tauri event to the frontend queue.

- Add InterventionNotification struct and InterventionType enum
- Add NodeDsl::label() for node display names
- Add notify_intervention() helper in orchestrator at all 5 pause points
- Add NotificationDedup for preventing duplicate notifications
- Add useInterventionNotifications hook for frontend queue management
- Add i18n keys (zh-CN + en) for notification titles and actions
- Emit intervention-resolved events on submit/continue/retry/kill

Co-Authored-By: Claude <noreply@anthropic.com>
…buttons, fix navigation

- Replace Toast::POWERSHELL_APP_ID with Tauri identifier as AUMID
- Register Start Menu shortcut and AUMID DisplayName="码灵" at startup
- Switch Windows notifications to tauri-winrt-notification for button support
- Add "查看详情" and "忽略" action buttons to toast notifications
- Fix intervention-navigate event to include roundId (fixes "操作失败" error)
- Simplify notification body: show node_id instead of full label
- Add app title prefix "码灵" to notification titles

Co-Authored-By: Claude <noreply@anthropic.com>
Use Gold Band icon.png as toast notification app logo via tauri-winrt-notification
icon() method.

Co-Authored-By: Claude <noreply@anthropic.com>
…popup

# Conflicts:
#	src-tauri/Cargo.toml
#	src-tauri/src/commands.rs
#	src-tauri/src/main.rs
#	src-tauri/src/state.rs
#	src/app/mod.rs
…cross all run commands

- Add intervention notifier to start_run, continue_run, submit_manual_check, and retry_run
- Replace app_with_acp_live_update with app_with_metrics consistently
- Fix missing semicolon in continue_run that broke compilation
- Remove duplicate app construction in submit_manual_check

Co-Authored-By: Claude <noreply@anthropic.com>
…toast not navigating

Three bugs fixed in the intervention/permission popup system:

1. Permission decision event ID mismatch: append_permission_decision_artifacts
   overwrote event.id with "permission-{request_id}", preventing the session
   builder's latest_permission_events HashMap from replacing the "pending"
   event with the "selected" event. Frontend kept showing the card.

2. request_id normalization: Frontend passes request_id with "permission-"
   prefix from stale event data, but ACP client's wait_for_permission_response
   polls for the raw RPC id (e.g. "0" vs "permission-0"). Response file was
   written to the wrong name, so the polling loop never found it. Added
   strip_prefix("permission-") normalization in respond_acp_permission.

3. First OS toast "查看详情" button not navigating: PowerShell shortcut
   creation was fire-and-forget (.spawn()), but Windows Toast on_activated
   requires the Start Menu shortcut with correct AUMID to exist. First toast
   fired before shortcut was ready. Changed to synchronous .status() wait.

Also includes the PauseReason propagation fix (NodeState.pause_reason field)
from the design doc, ensuring PermissionRequested/WaitingForUserInput are
correctly distinguished from ProcessInterrupted in notifications.

Co-Authored-By: Claude <noreply@anthropic.com>
@MercuryJ29 MercuryJ29 requested review from SixenWang and diodeme June 12, 2026 08:25
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