Setup session assumes a shell and sleep binary the Kit contract does not guarantee #1322

Closed
opened 2026-10-27 13:39:55 +00:00 by sam · 1 comment
Owner

The setup session starts its container with Worker ["sleep", "infinity"] (internal/infrastructure/kitrun/launcher.go) and opens the PTY with ["sh", "-l"] (internal/infrastructure/harnesssession/harnesssession.go). Neither binary is guaranteed by anything archie accepts.

The spec capability whose floor is a shell and bash is com.docker.sandbox/sbx@1: its own comment says the kit's half is "a shell, bash, and a resolvable user — which the kit conformance suite judges from the artifact" (sandbox-kit-spec spec/types.go, CapabilitySbx). Archie's supported map (internal/infrastructure/kit/kit.go) does not list it, so a Kit declaring it required is refused and an optional one is skipped: archie never requires the floor and never guarantees it.

Existing code depends on sh only conditionally: writeKitFile runs sh -c, but only when lifecycle files, credential files or agent-context files are written; runHook runs its argv directly. So a Kit with none of those never exercises sh, and the setup session is the first path that needs a shell unconditionally.

Impact: a Kit image without sleep dies at container start; without sh the PTY exec fails. Both surface as an opaque session error rather than a named one.

Fix: the already-built archie-agent binary is archie's own static binary and can be mounted into the setup container; give it a small hold subcommand and use it as the entrypoint, removing the sleep dependency. Before opening the PTY, probe for bash or sh and return a clear error naming the image when neither exists. Alternatively adopt the sbx@1 floor for Kit profiles that need a terminal.

Done when: the keepalive needs no image-provided binary, and opening the setup terminal on an image with no shell fails with an error that names the image rather than a container-exit or exec failure.

Acceptance criteria

Setup keepalive requires no image-provided binary, and a missing shell produces an image-specific terminal error.


Imported from beads archie-core-fr90 · GitHub #1543 · type bug · priority P2 · created 2026-10-09

The setup session starts its container with Worker ["sleep", "infinity"] (internal/infrastructure/kitrun/launcher.go) and opens the PTY with ["sh", "-l"] (internal/infrastructure/harnesssession/harnesssession.go). Neither binary is guaranteed by anything archie accepts. The spec capability whose floor is a shell and bash is com.docker.sandbox/sbx@1: its own comment says the kit's half is "a shell, bash, and a resolvable user — which the kit conformance suite judges from the artifact" (sandbox-kit-spec spec/types.go, CapabilitySbx). Archie's supported map (internal/infrastructure/kit/kit.go) does not list it, so a Kit declaring it required is refused and an optional one is skipped: archie never requires the floor and never guarantees it. Existing code depends on sh only conditionally: writeKitFile runs sh -c, but only when lifecycle files, credential files or agent-context files are written; runHook runs its argv directly. So a Kit with none of those never exercises sh, and the setup session is the first path that needs a shell unconditionally. Impact: a Kit image without sleep dies at container start; without sh the PTY exec fails. Both surface as an opaque session error rather than a named one. Fix: the already-built archie-agent binary is archie's own static binary and can be mounted into the setup container; give it a small hold subcommand and use it as the entrypoint, removing the sleep dependency. Before opening the PTY, probe for bash or sh and return a clear error naming the image when neither exists. Alternatively adopt the sbx@1 floor for Kit profiles that need a terminal. Done when: the keepalive needs no image-provided binary, and opening the setup terminal on an image with no shell fails with an error that names the image rather than a container-exit or exec failure. ### Acceptance criteria Setup keepalive requires no image-provided binary, and a missing shell produces an image-specific terminal error. --- _Imported from beads `archie-core-fr90` · GitHub #1543 · type bug · priority P2 · created 2026-10-09_
sam added the mediumbug labels 2026-10-27 13:39:55 +00:00
sam self-assigned this 2026-10-27 13:39:55 +00:00
Author
Owner

Closed: Kit and external agent harness support was removed (#1877), and the product plan in epic #1977 adopts proven infrastructure rather than building more runtime of its own.

Closed: Kit and external agent harness support was removed (#1877), and the product plan in epic #1977 adopts proven infrastructure rather than building more runtime of its own.
sam closed this issue 2026-11-14 14:45:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1322