Skip to content

bug(start): preserve argv boundaries instead of re-shelling joined command #5

@pinion05

Description

@pinion05

Summary

agentty start currently collapses the original argv into a single space-joined string and the worker runs it via shell -lc.

Why this is a problem

  • Quoted arguments lose their original boundaries.
  • Empty arguments cannot be represented correctly.
  • Commands containing spaces or literal quotes can be reinterpreted by the shell.

Impact

Common invocations like agentty start python3 -c "print("a b")" can behave differently from the user's original intent.

Suggested direction

  • Keep the command as file + args[] through the CLI/runtime boundary.
  • Spawn the target command directly instead of re-parsing a reconstructed shell string.
  • Add regression tests for quoted args, empty args, and literal quotes.

Relevant code

  • src/index.ts#parseStartOptions
  • src/worker.ts#spawn(shell, ["-lc", spec.command], ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions