Skip to content

Bug: --yolo flag gets overridden by mobile app's permissionMode #150

@Yehonatan-Bar

Description

@Yehonatan-Bar

Description

When running happy --yolo, the permission bypass works initially, but gets overwritten when a message is sent from the mobile app.

Steps to Reproduce

  1. Run happy --yolo from terminal
  2. Send a message from the mobile app (Kingdom of Claudes)
  3. Claude tries to use Edit/Bash tool
  4. Permission prompt appears (should be auto-approved)

Expected Behavior

Permission mode should stay as bypassPermissions for the entire session when started with --yolo.

Actual Behavior

Mobile app sends permissionMode: "default" with every message, which overwrites the yolo setting.

Root Cause

Found in the logs:

[08:53:19.397] Starting happy CLI with args: ["...","--yolo"]
...
{
  "role": "user",
  "meta": {
    "sentFrom": "android",
    "permissionMode": "default",   <-- Mobile hardcodes this
  }
}
[08:54:27.602] [loop] Permission mode updated from user message to: default

Two issues:

  1. Arg parsing: When --yolo is parsed, it only pushes --dangerously-skip-permissions to Claude args, but doesn't set options.permissionMode

  2. Message handler: onUserMessage blindly accepts permissionMode from mobile without checking if session was started with bypass mode

Proposed Fix

  1. Set options.permissionMode = "bypassPermissions" when --yolo is parsed
  2. Don't allow mobile messages to downgrade from bypassPermissions

Patch Available

I've created a working patch: https://github.com/Yehonatan-Bar/happy-patch

Happy to submit a PR if preferred.

Environment

  • Happy CLI: v0.13.0
  • Platform: Windows 11
  • Mobile: Android (Kingdom of Claudes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions