MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ha_deadline_ms

Function ha_deadline_ms

src/cli/hook_augment.c:76–92  ·  view source on GitHub ↗

#858: the original 300ms budget silently self-terminated on real cold * starts (SQLite/mmap open under load), so augmentation never appeared in * real sessions (0/24 observed) while manual warm invocations worked. The * budget is now generous by default and env-configurable; the settings.json * hook "timeout" remains the outer backstop (and alone governs Windows, * where this whole in-process

Source from the content-addressed store, hash-verified

74 * hook "timeout" remains the outer backstop (and alone governs Windows,
75 * where this whole in-process deadline block is compiled out). */
76static int ha_deadline_ms(void) {
77 /* A value this reader cannot read gets the DEFAULT, never the floor. atoi
78 * used to answer 0 for a typo, 0 is below the minimum, and the clamp then
79 * handed back the shortest deadline the setting allows — the opposite of
80 * what somebody raising CBM_HOOK_DEADLINE_MS is asking for. */
81 long v = 0;
82 if (!cbm_env_long("CBM_HOOK_DEADLINE_MS", &v)) {
83 return HA_DEADLINE_DEFAULT_MS;
84 }
85 if (v < HA_DEADLINE_MIN_MS) {
86 return HA_DEADLINE_MIN_MS;
87 }
88 if (v > HA_DEADLINE_MAX_MS) {
89 return HA_DEADLINE_MAX_MS;
90 }
91 return (int)v;
92}
93
94static int g_ha_crumb_fd = -1;
95static char g_ha_crumb_msg[160];

Calls 1

cbm_env_longFunction · 0.85

Tested by

no test coverage detected