Skip to content

[bug][AppImage] Agent shell commands are executed via the AppImage binary: a full app instance boots per command, the window steals focus, and the command itself may never run #895

Description

@Josephur

Description

When an agent session executes shell commands on Linux, the command is not run directly by the system interpreter: the exec layer routes it through the ZCode AppImage binary itself. Instead of executing the requested program, the AppImage boots a full desktop-app instance (Electron main process, crash reporter init, zcode:// deep-link protocol registration, user-level desktop-file and icon installation) - repeatedly - and the requested command may never actually run. Each boot raises the ZCode window over the user's other work (focus stealing), making the machine unusable while an agent session runs.

Steps to Reproduce

  1. Install ZCode 3.14.4 as the linux-x64 AppImage, run an agent session on Linux (KDE Plasma / CachyOS here).
  2. Have the agent run a shell command, e.g. python3 tools/foo.py.
  3. Inspect with ps: the process is python3 /home/<user>/.local/bin/ZCode-3.14.4-linux-x64.AppImage tools/foo.py - the AppImage file was interposed into the interpreter's arguments.
  4. Capture the command's stdout/stderr.

Expected Behavior

Agent shell commands execute directly with the system binaries; no app instance is booted per command, no desktop-integration side effects occur, and the ZCode window never raises itself over other windows.

Actual Behavior

  • ps shows the AppImage binary interposed into the command line (argv rewrite) for commands run by the agent.
  • A single command's output contained 9,000+ lines (~280 KB) of ZCode app boot logs instead of the command's output, from multiple waves of new PIDs over several minutes: [main] [crash-capture] configured remoteCrashReporterEnabled=true, [deep-link] 注册协议成功 { scheme: 'zcode' }, [deep-link] Linux AppImage 用户级图标安装完成, [arms] electron initialized env=prod version=3.14.4.
  • In that case the requested long-running script produced zero output - it never executed.
  • The app window raises itself over other applications on command execution (focus stealing the user can see; reported and reproduced repeatedly during one session).

Environment

  • OS: CachyOS (Arch-based), KDE Plasma, X11
  • ZCode 3.14.4 linux-x64 AppImage (~/.local/bin/ZCode-3.14.4-linux-x64.AppImage)
  • Not a system-level shim: /usr/bin and /usr/sbin coreutils have identical checksums, and no shell aliases/functions shadow the interpreter; the rewrite happens in ZCode's command-exec layer.

Suggested fix

Do not route agent shell-command execution through the AppImage binary. Resolve the real system interpreter/binary (or a dedicated runner path) for command execution, and confine desktop-integration (protocol/desktop-file/icon registration) and any window raise to the interactive GUI session only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions