Idle filter: suppress when watched process (claude) is running in distro
Probes wsl.exe -d <distro> -- pgrep -x claude before flagging a WSL pane idle, with a 3s per-distro cache on the Rust side. If claude is running anywhere in the distro, all panes in that distro stay out of the idle set (per-pane granularity is out of scope — PIDs aren't observable from Windows). PowerShell + SSH panes skip the probe and keep the legacy always-notify behaviour.
This commit is contained in:
parent
5b970f8b48
commit
f51033a142
7 changed files with 352 additions and 11 deletions
|
|
@ -5,11 +5,13 @@ mod creds;
|
|||
mod hosts;
|
||||
mod mcp;
|
||||
mod mcp_policy;
|
||||
mod probe;
|
||||
mod pty;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::mcp::{McpServerHandle, McpState, PendingActions};
|
||||
use crate::probe::ProbeCache;
|
||||
use crate::pty::PtyManager;
|
||||
|
||||
pub fn run() {
|
||||
|
|
@ -40,6 +42,9 @@ pub fn run() {
|
|||
// Pending action registry — separate managed state so mcp_action_reply can
|
||||
// grab it without needing to lock McpState or reach into TileService.
|
||||
let pending_actions: Arc<PendingActions> = Arc::new(PendingActions::default());
|
||||
// Idle-filter probe cache: shared across all is_watch_process_running
|
||||
// calls so a per-distro answer is reused for a few seconds. See probe.rs.
|
||||
let probe_cache: Arc<ProbeCache> = Arc::new(ProbeCache::new());
|
||||
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
|
|
@ -48,6 +53,7 @@ pub fn run() {
|
|||
.manage(mcp_state)
|
||||
.manage(McpServerHandle::default())
|
||||
.manage(pending_actions)
|
||||
.manage(probe_cache)
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::list_distros,
|
||||
commands::spawn_pane,
|
||||
|
|
@ -70,6 +76,7 @@ pub fn run() {
|
|||
commands::mcp_policy_load,
|
||||
commands::mcp_policy_save,
|
||||
commands::mcp_hard_deny_labels,
|
||||
commands::is_watch_process_running,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue