Skip to content

fix(cli): wire --permission-mode as a true alias for --mode#159

Merged
oratis merged 1 commit into
mainfrom
fix/cli-permission-mode-alias
Jun 4, 2026
Merged

fix(cli): wire --permission-mode as a true alias for --mode#159
oratis merged 1 commit into
mainfrom
fix/cli-permission-mode-alias

Conversation

@oratis
Copy link
Copy Markdown
Owner

@oratis oratis commented Jun 4, 2026

Problem

--permission-mode was parsed and validated in parse-args.ts but stored into a
separate ParsedArgs.permissionMode field that cli.ts never reads — only
args.mode is forwarded to the agent (headless + REPL). So
deepcode --permission-mode plan was accepted but silently ran in the default
mode, with no feedback to the user. docs/BEHAVIOR_PARITY.md already listed the
combined --mode / --permission-mode row as ✅, ahead of the code.

Fix

  • --permission-mode now sets out.mode directly — a true alias for --mode,
    matching the documented "Alias for --mode (Claude Code parity)" help text.
  • Dropped the dead permissionMode?: Mode field from ParsedArgs.
  • Last flag wins when both --mode and --permission-mode are passed.

Tests

  • New parse-args.test.ts cases: the alias sets mode (+ invalid value →
    unknownFlags), and --mode / --permission-mode last-flag-wins precedence.
  • Full CLI suite green (135 tests), tsc -b clean, prettier clean.

Makes the existing ✅ in docs/BEHAVIOR_PARITY.md accurate rather than aspirational.

🤖 Generated with Claude Code

Previously --permission-mode was parsed and validated but stored into a separate ParsedArgs.permissionMode field that cli.ts never read (only args.mode is forwarded to the agent), so "deepcode --permission-mode plan" silently ran in the default mode with no feedback. It now sets out.mode directly, matching the documented "alias for --mode" semantics, and the dead permissionMode field is removed. Last flag wins when both --mode and --permission-mode are given. Adds parse-args tests for the alias and the last-wins precedence. docs/BEHAVIOR_PARITY.md already marks the combined --mode / --permission-mode row as supported; this fix makes that accurate.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@oratis oratis merged commit aad5b07 into main Jun 4, 2026
3 checks passed
@oratis oratis deleted the fix/cli-permission-mode-alias branch June 4, 2026 13:06
oratis added a commit that referenced this pull request Jun 7, 2026
)

Both flags were parsed (and parse-tested) but ignored:
- --bare: suppress the REPL startup banner (▎ DeepCode line + "Working in" +
  "Type /help") for scripting / minimal output.
- --no-plugins: skip plugin discovery (empty contributions) + wirePlugins —
  faster start, or to bypass a broken plugin.

Threaded through ReplOpts → startRepl. Also flips stale BEHAVIOR_PARITY rows:
--permission-mode → ✅ (already wired in #159), --bare → ✅, --no-plugins → 🟡
(--strict still parsed-only).

Parsing is covered by the existing parse-args "boolean flags" test; the wiring
is smoke-verified against a throwaway HOME (--bare → 0 banner lines vs 1 without;
--bare/--no-plugins both run + exit cleanly). cli 137.

Co-authored-by: t <t@t>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant