elegant-crayon-70232
11/18/2026, 4:49 PMmodern-fireman-99755
11/18/2026, 4:53 PMmodern-fireman-99755
11/18/2026, 6:28 PMfresh-machine-37269
11/18/2026, 6:29 PMfresh-machine-37269
11/18/2026, 6:31 PMHookExecutor.execute() builds the hook's subprocess env from sanitized_env() plus a few OPENHANDS_* vars (project dir, session id, event type, tool name) — the conversation's SecretRegistry is never consulted, and there are zero references to secrets anywhere in openhands/sdk/hooks/. So $MY_API_KEY in a hook command resolves to empty, even though the same secret works when the agent runs it via execute_command (which name-scans commands and injects matching secrets). Agent hooks also spawn their sub-conversation without forwarding secrets. The frustrating part is that SecretRegistry.get_all_secrets_as_env_vars() already exists exactly for opaque consumers that can't be name-scanned (the ACP CLI uses it) — hooks are the same kind of consumer but the hook path never calls it.
I verified no existing issue covered this and filed one: github.com/OpenHands/software-agent-sdk/issues/6966 (labeled bug + hooks). It includes the code-level findings, repro steps, and a suggested fix (thread the conversation's SecretRegistry through create_hook_callback → HookManager → HookExecutor, inject via get_all_secrets_as_env_vars(), and route through track_exported_values() so hook stdout stays masked in HookExecutionEvent).elegant-crayon-70232
11/18/2026, 7:33 PMelegant-crayon-70232
11/18/2026, 7:34 PMelegant-crayon-70232
11/18/2026, 7:34 PMmodern-fireman-99755
11/18/2026, 8:55 PMmodern-fireman-99755
11/18/2026, 8:55 PMelegant-crayon-70232
11/18/2026, 8:55 PMelegant-crayon-70232
11/20/2026, 1:43 AMmodern-fireman-99755
11/22/2026, 6:29 PMelegant-crayon-70232
11/25/2026, 11:48 PMelegant-crayon-70232
11/25/2026, 11:49 PMmodern-fireman-99755
11/26/2026, 1:35 PM