refactor(hooks): replace direct output.args mutation with replaceToolArgs (question/webfetch/null-byte)

Replace Object.assign(output.args, truncatedArgs), output.args.url = resolution.url,
and output.args.command = ... .replace(/\x00/g, "") with replaceToolArgs() calls
in question-label-truncator, webfetch-redirect-guard, and plugin/tool-execute-before.

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:40:10 +09:00
parent af66b8de0b
commit 13d8857415
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import type { PluginInput } from "@opencode-ai/plugin"
import { log } from "../../shared"
import { log, replaceToolArgs } from "../../shared"
import {
MAX_WEBFETCH_REDIRECTS,
WEBFETCH_REDIRECT_ERROR_PATTERNS,
@@ -85,7 +85,7 @@ export function createWebFetchRedirectGuardHook(_ctx: PluginInput) {
})
if (resolution.type === "resolved") {
output.args.url = resolution.url
replaceToolArgs(output, { url: resolution.url })
return
}