fix: keep agent-core install script from joining fiif - #82
Open
stctheproducer wants to merge 1 commit into
Open
Conversation
Swift multiline strings drop the last newline. The fd shim then starts with if, so ash sees fiif and rejects the script.
stctheproducer
marked this pull request as draft
August 27, 2026 13:50
stctheproducer
marked this pull request as ready for review
August 28, 2026 08:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dory sandbox createalways installs theagent-corerecipe in the guest.The guest
/bin/shthen stops with a syntax error.The command does not make a usable sandbox.
The error is:
This is a defect in Dory 0.4.5.
Procedure
Do this procedure to show the defect.
Actual result
The CLI starts a Linux machine.
The CLI then runs
dorydctl machine provision NAME --recipe agent-core.The guest
/bin/shrejects the install script.The CLI tries the same script one more time.
The CLI then stops and deletes the machine.
The incident log records this sequence:
machine.createmachine.startmachine.execwith/bin/shmachine.provision_failed(two times)machine.stopmachine.deleteThe two
provision_failedevents occur in about 0.1 s.The script does not start
apk.The failure is a parse error.
Expected result
The recipe must send a valid POSIX script to
/bin/sh -lc.The guest must install the
agent-corepackages.The command must keep a named Agent-ready sandbox.
Cause
dory sandbox createalways adds--agent-ready.The Agent-ready profile always adds the
agent-coretool.sandbox_provision_profile_toolinHelpers/dorythen runs:MachineRecipeProvisionerbuilds the install script from two strings.String 1 is
packageInstallScript(alpine:debian:).Swift multiline strings drop the newline before the closing delimiter.
That string ends with
fiand no newline.String 2 is the
fdshim.That string starts with
ifand no leading newline.The runtime join is:
fiifis not the keywordfi.The first
ifstays open.Ash then finds
thenand reportsunexpected "then" (expecting "fi").The provisioner sends the script as:
The C strings in Dory 0.4.5
dorydctlmatch this join.The last fragment of the package script is
exit 69\nfiwith no trailing newline.The
fdfragment starts withif ! command -v fd.Change
packageInstallScriptnow adds an explicit"\n"afterfi.A later
ifthen starts on a new line.The new test
testAgentCoreInstallScriptDoesNotJoinFiIntoTheFdShimchecks three facts:fiiffi\nif ! command -v fdexit 69\nfi\nWorkaround
Do not use
dory sandbox create.That command always enables Agent-ready mode.
Use a named sandbox without
--agent-ready:This VM does not get the
agent-coretoolkit.Validation
scripts/build.shpassed.Related issues
These issues are not this defect:
I found no open or closed issue for this
fiifsyntax error.