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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user