{"record":{"id":"60e4accf5c49f41a","repo":"Hmbown/CodeWhale","slug":"background-hook-supervisor-queue-is-full","errorCode":null,"errorMessage":"background hook supervisor queue is full","messagePattern":"background hook supervisor queue is full","errorType":"console","errorClass":"BackgroundSupervisorFailure::Full","httpStatus":null,"severity":"warning","filePath":"crates/tui/src/hooks/executor.rs","lineNumber":2456,"sourceCode":"            label: sanitize_hook_label(hook.name.as_deref()),\n            timeout: Duration::from_secs(self.effective_timeout_secs(hook)),\n            plugin_authority: hook.plugin_authority.clone(),\n            project_authority: hook.project_authority.clone(),\n        });\n\n        // The result describes the bounded submission, not the run: no caller\n        // can mistake \"queued\" for \"exited 0\".\n        HookResult {\n            name: hook.name.clone(),\n            background: true,\n            strict: false,\n            success: submission.is_ok(),\n            exit_code: None,\n            stdout: String::new(),\n            stderr: String::new(),\n            duration: started.elapsed(),\n            error: submission.err().map(|failure| match failure {\n                BackgroundSupervisorFailure::Full => {\n                    \"background hook supervisor queue is full\".to_string()\n                }\n                BackgroundSupervisorFailure::Disconnected => {\n                    \"background hook supervisor is unavailable\".to_string()\n                }\n            }),\n        }\n    }\n\n    /// The timeout actually applied to a hook, foreground or background.\n    ///\n    /// `[hooks].default_timeout_secs` *replaces* the per-hook value when set;\n    /// that is the shipped behavior and is documented as such in\n    /// `docs/HOOKS.md`.\n    fn effective_timeout_secs(&self, hook: &Hook) -> u64 {\n        self.config.effective_timeout_secs(hook)\n    }\n}","sourceCodeStart":2438,"sourceCodeEnd":2474,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/hooks/executor.rs#L2438-L2474","documentation":"A background hook could not be submitted because the background hook supervisor's queue was full. The failure is recorded in the hook result's error field with success=false rather than panicking or blocking. It indicates backpressure: hooks are being produced faster than the supervisor executes them.","triggerScenarios":"Submitting a background hook when BackgroundSupervisorFailure::Full is returned — the supervisor's bounded channel has no free slots at submission time (executor.rs hook submission path).","commonSituations":"Many hooks firing in rapid succession (e.g. on every tool call) while hook commands run slowly; a stuck or very slow hook command clogging the queue; hook queue capacity configured too small for the workload.","solutions":["Slow down or reduce the number of hooks registered in configuration.","Find and fix slow/stuck hook commands that are occupying queue slots (check hook stderr/durations in results).","Increase the background supervisor queue capacity if your workload legitimately enqueues many hooks.","Retry the hook; the failure is recorded per-submission and does not corrupt supervisor state."],"exampleFix":"// hook config: reduce fire frequency\n// before: run hook on every PostToolUse event\n// after: debounce or restrict matcher to the specific tools you need\n\"matcher\": \"Bash\"","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let result = run_hook_background(cmd);\nif !result.success && result.error == Some(\"background hook supervisor queue is full\".into()) {\n    run_hook_synchronously(cmd); // degrade to inline execution\n}","preventionTips":["Keep hook commands fast; move heavy work into the hook script itself asynchronously.","Limit the number of registered hooks to what the queue can absorb.","Monitor hook durations and queue depth."],"tags":["hooks","backpressure","queue-full","async"],"backgroundTag":"thread-interrupted","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}