fix(agent-hooks): force C numeric locale on POSIX curl timeouts (#19600)

* fix(agent-hooks): force C numeric locale on POSIX curl timeouts

curl parses --connect-timeout/--max-time with locale-sensitive strtod, so comma-decimal locales reject 0.5 and every hook silently falls into the restart spool.

Fixes #19578

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(agent-hooks): neutralize LC_ALL before setting LC_NUMERIC=C on POSIX curl

Signed-off-by: siddiqui irshad <mohdirshad1306@gmail.com>

* style(agent-hooks): format scoped curl commands

* test(hooks): expect scoped curl locale in Muse install script

---------

Signed-off-by: siddiqui irshad <mohdirshad1306@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Neil <neil@stably.ai>
This commit is contained in:
Mohd Irshad
2026-10-24 02:17:08 -07:00
committed by GitHub
co-authored by Cursor Neil
parent 1e341b6edf
commit 5ce9d58b2d
22 changed files with 166 additions and 19 deletions
@@ -1,3 +1,4 @@
import { posixCurlCommand } from '../agent-hooks/hook-post-command'
import { buildWindowsAgentHookPostCommand } from '../agent-hooks/installer-utils'
import {
buildPosixHookPayloadCapture,
@@ -122,7 +123,7 @@ export function buildCommandCodeManagedScript(
' exit 0',
'fi',
// Bound stalled posts and pipe large payloads through stdin to avoid EDR command-line false positives.
'printf \'%s\' "$payload" | curl -sS -X POST "http://127.0.0.1:${ORCA_AGENT_HOOK_PORT}/hook/command-code" \\',
`printf '%s' "$payload" | ${posixCurlCommand()} -sS -X POST "http://127.0.0.1:\${ORCA_AGENT_HOOK_PORT}/hook/command-code" \\`,
' --connect-timeout 0.5 --max-time 1.5 \\',
' -H "Content-Type: application/x-www-form-urlencoded" \\',
' -H "X-Orca-Agent-Hook-Token: ${ORCA_AGENT_HOOK_TOKEN}" \\',