Skip to content

acq run: acq run --name X -- CMD (no agent positional) silently no-ops instead of failing closed #253

Closed

Description

@mogul

Summary

acq run with a --name but no known-agent positional (e.g. acq run --name s2verify -- sh -lc '…') produces no output, creates no sandbox, and drops the post--- command entirely. It should fail closed with a clear message.

Reproduce

./acq --backend msb run --name s2verify -- sh -lc 'echo hi'
# -> prints nothing, creates nothing; `msb ls` shows "No sandboxes found."

Root cause

In the run) dispatch (acq), args are split at -- into create_args and agent_args. first=$(first_positional "$create_args") skips flags and their values, so with only --name s2verify there is no positional and first is empty. That fails both is_known_agent "$first" and acq_backend_exists "$first", so control reaches the final else "pass through" branch:

else
  # Pass through.
  acq_backend_attach "${create_args[@]+\"${create_args[@]}\"}"

This calls acq_backend_attach --name s2verify — never provisions, silently discards agent_args, and attaching a nonexistent sandbox no-ops. Net: a silent no-op.

Expected

acq run is create-and-attach for a known agent (acq run opencode …). When invoked without a resolvable agent/sandbox, it should fail closed (non-zero) with an actionable message, e.g.:

acq: run: no agent specified. Usage: acq run <agent|sandbox-name> [create-args] [-- CMD].
     To create a non-agent sandbox use `acq create …`; to run a command in an
     existing sandbox use `acq exec <name> -- CMD`.

This aligns with AGENTS.md "fail closed on ambiguity — never guess / no silent failures."

Notes

AI-assisted (OpenCode); human-reviewed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions