feat(launcher): add --answer-default #85
No reviewers
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/azkaban!85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/answer-default"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The launcher (
bin/azkaban, run asopencode,claude, orcodex)asks up to three questions when its standard input is a terminal:
whether to use the current directory as the workspace, whether to
approve a new or changed workspace Dockerfile, and, on every launch of
a workspace with an approved
Dockerfile.azkaban, whether to updatethe shared image.
A terminal session manager that starts a client gives it a terminal
with nobody reading it, so each launch stops at a question. The update
question had no way out that kept both the custom image and the
container's TTY:
--skip-custom-imagesruns the default image, andnonterminal standard input takes the TTY, and with it the client's
TUI, away.
What changed
Every command accepts
--answer-default. With it the launcher printseach question on standard error followed by its default answer, the
one the prompt shows in capitals, reads nothing, and goes on:
y);Dockerfile.azkabanreuses its local image, with nopull and no build (
n);n): aclient's file is skipped for the default image, and the shared file
reuses the image of its approved copy or, without one, stops the
launch.
The container still gets its TTY when standard input and output are
terminals. Without the option, and with nonterminal standard input,
launches behave as before. The option exists only on the command line.
_azk_confirmis the one place that reads it. The two messages thatstop a launch with "launch from a terminal" say "launch without
--answer-default" when the option is given on a terminal, and
--dry-runnames what the launch would do in place of "would ask".How to verify
Setup: none beyond a checkout
(Set-up); the tests run against the vendored Podman
stub and need
script(1)for a pseudoterminal.On the branch (
b6c8dc8):Expected, and observed: three tests pass,
test_common_answer_default_uses_the_current_workspace_unasked_and_keeps_the_tty,test_answer_default_reuses_the_approved_shared_image_unasked, andtest_answer_default_leaves_a_new_or_changed_dockerfile_unapproved.Each offers the launcher an answer the option must ignore.
On the base (
e3cc683), with the branch'stests/copied over it, thesame command fails all three at their assertions, as do the extended
test_common_help_is_generated_by_the_active_client_and_documents_wrapper_optionsand
test_missing_shared_image_stops_without_pulling_building_or_running:the base forwards
--answer-defaultto the client and still asks.Untested, since the machine the work ran on has no Podman: on an
installed host, in a workspace with an approved
Dockerfile.azkaban,opencode . --answer-defaultshould printopencode: Update localhost/<image>:latest from Dockerfile.azkaban? [y/N] n,then
reusing local image, and open the TUI without waiting.Checks run on the branch:
make lint,.agents/hooks/shellcheck.sh repo, andmake testpass, 340 tests and0 failures.
Considerations
The option answers no to every approval, by design: the container can
write its workspace, so only a launch without the option, with someone
at the terminal, approves or updates an image.
An identity's files cannot set the option. A session manager passes it
in the command it runs, and a launch by hand keeps its questions.