fix: implement permission handler callbacks and add CodexPermission UI support

Adds onRequest and onComplete callbacks to CodexPermissionHandler to track
permission request/response lifecycle. Includes helper functions to normalize
command and cwd inputs, and displays permission requests in the web UI.
This commit is contained in:
weishu
2026-01-13 11:06:50 +08:00
parent a6e35eaf65
commit 41d8844c00
4 changed files with 106 additions and 5 deletions
@@ -137,6 +137,15 @@ export const knownTools: Record<string, {
},
minimal: true
},
CodexPermission: {
icon: () => <QuestionIcon className={DEFAULT_ICON_CLASS} />,
title: (opts) => {
const tool = getInputStringAny(opts.input, ['tool'])
return tool ? `Permission: ${tool}` : 'Permission request'
},
subtitle: (opts) => getInputStringAny(opts.input, ['command']) ?? null,
minimal: true
},
shell_command: {
icon: () => <TerminalIcon className={DEFAULT_ICON_CLASS} />,
title: (opts) => opts.description ?? 'Terminal',