fix(mods): jev-auto-mode shows the whole action in the Allow / Deny dialog (dialogMaxChars option)

AL
1d ago
+25-4

What

The mod's Allow / Deny dialog cut the action to 80 characters, the same as the log lines (describeAction() in hooks/rules.ts). A long command reached the user as Bash(cd /path && git push --dry-run origin some-bra…), so the user approved text they could not read in full.

judge.ts already says why this matters for the judge (stateText(): "a judge shown half a command could approve what it never saw") and sends it the whole input. This change gives the user the same.

  • describeAction(a, max = 80): the cut is now a parameter. Logs, the status line and /jev-auto-mode log keep 80.
  • New option dialogMaxChars (number, default 0 = the whole action). The dialog uses it; a positive value cuts there instead.
  • README Options list and plugin.json userConfig document it.
  • tests/rules.test.ts: describeAction cuts at 80 by default and shows everything with Infinity.

Behaviour change

The default dialog now shows the whole action instead of 80 characters. Inputs over 20,000 characters are already sent to ask before any rule, so the dialog has an upper bound. Set dialogMaxChars: 80 to get the old dialog.

Checks

  • cd cli-tool/components/mods && npx -y -p typescript@5 tsc -p tsconfig.json: clean.
  • claude plugin test security/jev-auto-mode on Claude Code 2.1.312: 26 pass, 4 fail. The same 4 fail on main without this change (25 pass, 4 fail), all in tests/jev-auto-mode.test.ts and all on the engine's permission answer, not the dialog text:
    • rules deny, allow past the engine prompt, and split compound commands: tool.check gives ask, expected allow
    • the judge decides what no rule covers; headless asks deny, askWith engine hands the ask to the permission mode, audit mode logs what it would do and lets everything run: Permission to use Read/Bash has been denied
  • Live: a ~150-character git push --dry-run … under a git push* ask rule; the dialog showed it to the end.

🤖 Generated with Claude Code


Summary by cubic

Fixes the jev-auto-mode mod's Allow / Deny dialog so it shows the whole action instead of cutting it to 80 characters like the log lines; long commands previously reached the user truncated, so an approval could be given to text the user had never seen in full.

  • describeAction() now takes a max length; logs, the status line, and /jev-auto-mode log keep 80.
  • New dialogMaxChars option (default 0 = whole action) controls the dialog; set it to 80 for the old behavior.
  • Affects cli-tool/components/mods/security/jev-auto-mode only; no new components, so no docs/components.json regeneration, and no new environment variables or secrets.