refactor(hooks): replace direct output.args mutation with replaceToolArgs (env + prompt injectors)

Replace output.args.command and output.args.prompt direct assignments
with replaceToolArgs() in non-interactive-env, prometheus-md-only,
and sisyphus-junior-notepad hooks.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-18 12:37:45 +09:00
parent f72bb3fe8f
commit af66b8de0b
3 changed files with 6 additions and 4 deletions
@@ -1,6 +1,6 @@
import type { PluginInput } from "@opencode-ai/plugin"
import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants"
import { log, buildEnvPrefix } from "../../shared"
import { log, buildEnvPrefix, replaceToolArgs } from "../../shared"
import { detectShellType, type ShellType } from "../../shared/shell-env"
export * from "./constants"
@@ -97,7 +97,7 @@ export function createNonInteractiveEnvHook(_ctx: PluginInput) {
return
}
output.args.command = `${envPrefix} ${command}`
replaceToolArgs(output, { command: `${envPrefix} ${command}` })
log(`[${HOOK_NAME}] Prepended non-interactive env vars to git command`, {
sessionID: input.sessionID,