fix: auto-truncate question option labels exceeding 30 characters
When AI generates AskUserQuestion tool calls with option labels longer than 30 characters, opencode validation rejects them with "too_big" error. This fix adds a pre-tool-use hook that automatically truncates labels to 30 characters (with "..." suffix) before the validation occurs. Fixes the error: "The question tool was called with invalid arguments: expected string to have <=30 characters" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,3 +30,4 @@ export { createTaskResumeInfoHook } from "./task-resume-info";
|
||||
export { createStartWorkHook } from "./start-work";
|
||||
export { createAtlasHook } from "./atlas";
|
||||
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
||||
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
||||
|
||||
Reference in New Issue
Block a user