Repository navigation
feat(sdk): bake box-authored OCI ENTRYPOINT/CMD + quadlet HostName= parity - #129
Conversation
…arity The sdk half of the AgentTeams manager crash-loop fix (spec → sdk → main). Consumes the opt-in entrypoint:/cmd: box wire fields (spec v0.2026224.403) and emits them into the image's OCI config, so a box whose children are spawned directly from its baked OCI config (no charly deploy in the loop) can bake the command they run. The Containerfile emitter writes ENTRYPOINT/CMD (with an auto-CMD [] when an entrypoint is declared without a cmd, so the entrypoint runs bare — a default box still ships NO baked command). The quadlet path emits the valid camelCase HostName= key (the lowercase Hostname= is unsupported and quadlet skips the whole unit), giving in-container hostname = the charly-network DNS name under every deploy path. Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)
pr-validator — APPROVED ✅Change class: charly/sdk Go (wire-shape/contract consumer — the OCI Head SHA validated: Checklist (every rule)
Comments considered: none — the PR carries no comments and no reviews. Cross-PR interactions considered: none open — Decision: PASS. The change is in full compliance with the project rulebook and the loaded skills. The R10 evidence chain was independently re-derived from the on-disk bed artifacts, the generated Containerfile, the manager image's OCI config, and the rebuilt binary — not taken from the author's word. Proceeding to merge-time CalVer finalization, squash-merge, and tag. Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated) |
Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)
pr-validator — mergedPhase 3 completed: merge-time CalVer finalized, squash-merged, tagged.
The main-repo PR (the third leg of the spec → sdk → main cutover) can now bump its sdk gitlink to Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated) |
…nd the pod bed (Unit 3) The main-repo leg of the three-repo fix (spec → sdk → main, B6 producer→consumer order) for the AgentTeams manager container crash-loop, landing **Unit 3** of the AgentTeams integration: the controller candy, the top composition, the manager image, and the `check-agentteams-pod` bed. Consumes the opt-in `entrypoint:`/`cmd:` box wire fields (spec v0.2026224.403, PR opencharly/spec#23) and the sdk's OCI ENTRYPOINT/CMD emission + quadlet `HostName=` parity (sdk v0.2026224.422, PR opencharly/sdk#129). **Root cause being fixed:** the AgentTeams controller spawns child manager/worker containers **directly from their baked OCI config** (`dockerCreatePayload` sends no Cmd/Entrypoint), with no charly deploy in the loop to inject the init command — and charly images baked none. The spawned manager therefore ran bare `bash` (the base image's default `/usr/bin/bash`), exited 0, and restarted forever. The fix lands the box-authored OCI packaging end to end: the `agentteams-manager` box declares `entrypoint: [supervisord, -n, -c, /etc/supervisord.conf]`, the sdk emitter bakes it into the image's OCI config, and the controller's spawn now boots supervisord. **Concrete edits (all 15 files accounted for):** - `candy/agentteams-controller/charly.yml` (new): builds `agentteams-controller` + `agt` from the pinned AgentTeams v1.2.2 source tarball, downloads kube-apiserver v1.31.3, installs the CRD manifests + builtin agent trees, and runs the controller as a rootless supervisord service on :8090 with the kine-backed embedded kube-apiserver. The charly-owned `start-controller.sh` resolves the shared credentials from the `/data` volume and execs the controller — no upstream install script, no root. - `candy/agentteams/charly.yml` (new): the top composition — the five foundation candies (minio, matrix, element, higress, controller) into one box. - `candy/agentteams-manager/charly.yml` (new): the manager image (`tag: manager`) — the openclaw gateway runtime built from the pinned upstream source commit, plus mc and the agt REST client, with the box-level `entrypoint:` that fixes the crash-loop. - `charly.yml`: the `agentteams` box + `agentteams-manager` box + the `check-agentteams-pod` bed (replaces `check-agentteams-core-pod`): binds the host rootless podman socket into the box, pins `AGENTTEAMS_MANAGER_IMAGE` to the pre-built manager image, and adds the manager-spawn check — the controller creates the default Manager CR and the check polls `/api/v1/managers` until the manager reaches `"phase":"Running"`. - `candy/plugin-deploy-pod/config_setup_helpers.go`: the direct-run `charly start` argv now emits `--hostname <name>` — parity with the quadlet `HostName=` key (the sdk leg's fix), so the in-container hostname = the charly-network DNS name on BOTH deploy paths. - `candy/plugin-box/inspect_list.go` + test: the `listServices` root-cause fix — the predicate now reads `init_systems` (non-empty = at least one init system triggers) instead of the dead `has_init` aggregate the resolution pipeline never populates. - `candy/agentteams-minio/charly.yml` + `candy/agentteams-matrix/charly.yml`: small fixes surfaced during the Unit-3 bed runs (minio health-check path, matrix env). - `charly/go.mod` + `candy/plugin-deploy-pod/go.mod`: `require github.com/opencharly/spec` bumped to `v0.2026224.403` (the merged spec tag). - `sdk` + `spec` submodule gitlinks: pinned to the merged SHAs (`b49946e`, `9e52340`). - `CHANGELOG/2026.224.0510.md` (new): the Unit-3 release entry (CalVer stamped at merge). Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)
Summary of changes
The sdk leg of the three-repo fix (spec → sdk → main, B6 producer→consumer order) for the AgentTeams manager container crash-loop. Consumes the opt-in
entrypoint:/cmd:box wire fields (spec v0.2026224.403, PR opencharly/spec#23) and emits them into the image's OCI config — the second repo of the three-repo fix.Root cause being fixed: the AgentTeams controller spawns child manager/worker containers directly from their baked OCI config (
dockerCreatePayloadsends no Cmd/Entrypoint), with no charly deploy in the loop to inject the init command — and charly images baked none. The spawned manager therefore ran barebash(the base image's default/usr/bin/bash), exited 0, and restarted forever.Concrete edits (all 10 files accounted for):
deploykit/generate.go(Containerfile emitter): writesENTRYPOINT <json>when the box declares an entrypoint andCMD <json>when it declares a cmd — opt-in, empty by default (a normal charly image bakes no command; the deploy-time init injects it).cmd: []clears a base image's inherited default command; a declared entrypoint with nocmdemits an auto-CMD []so the entrypoint runs bare instead of double-launching the base image's default command.deploykit/quadlet.go: the quadlet[Container]key isHostName=(camelCase) — the lowercaseHostname=is NOT a supported key and quadlet SKIPS the entire unit over it (systemctl --user startfails exit 5 "Unit not found"). Emission now writes the validHostName=key (mapped by quadlet to podman's--hostname), giving the in-container hostname = the charly-network DNS name — parity with the direct-run--hostname <name>argv the main-repo pod plugin emits. Golden test pins the emitted unit byte-exact.buildkit/config_resolve.go+deploykit/resolved_project.go+deploykit/spec_resolved_box_adapter.go: project the box-authoredEntrypoint/Cmdthrough the resolved-box forms so the plugin-build resolve leg re-emits them without the live candy graph.deploykit/oci_packaging_test.go: three tests — emitted-as-OCI-ENTRYPOINT/CMD, declared-empty-cmd-clears-base-cmd, and the blast-radius guard: a default box ships NO baked command. All fail without the change.go.mod/go.sum:require github.com/opencharly/specbumpedv0.2026223.1018→v0.2026224.403(mandatory — the sdk module has NO replace, so the pin is what standalone consumers resolve against;GOWORK=off go build ./... && go test ./...green against the new pin).CHANGELOG/2026.224.0404.md: staged (placeholder CalVer, finalized at merge).Change class
charly-or-sdk Go (wire/contract consumer repo), cross-repo:
opencharly/spec(LANDED, v0.2026224.403) →opencharly/sdk(this PR) →opencharly/charly(manager boxentrypoint:+${HOSTNAME}+--hostnameparity + submodule gitlink pins — NOT yet open; depends on this merge + tag).How R10-tested — exact gate, commands, and pasted output
charly check run check-agentteams-pod(main repo,disposable: true) — the R10-gate-by-change-class matrix maps a wire-shape contract change onto the bed that composes it, because the sdk emitter only has observable behavior through the main box that consumes it.check-agentteams-pod | pod | ok | 13 steps | 399s(run calver2026.224.0319, binary2026.223.2215— the worktree-localbin/charlyrebuilt with the full three-repo tree, so the sdk emission code reached the emitter). Theupdatestep ran a freshcharly updateandcheck-live-rebuild+feature-run-rebuildre-verified the fresh deployment.task build:binaryrebuilt the worktreebin/charly(charly version=2026.223.2215) from the three-repo tree including this sdk commit's emission code; the bed ran on it, then on a freshcharly update— ZERO warnings across every log.entrypoint: [supervisord, -n, -c, /etc/supervisord.conf], the sdk emitter (this commit) baked it into the manager image's OCI config (ENTRYPOINT ["supervisord","-n","-c","/etc/supervisord.conf"]+CMD [], verified viacharly box inspect), the controller spawned the manager from that image through the bound rootless podman socket, and the manager reached"phase":"Running"— the exact failure mode this fix addresses. Two earlier runs show the pre-fix state:2026.224.0211(ok: false— manager REST API unreachable, the crash-loop symptom) and2026.224.0302(startstepok: false— the quadletHostname=unsupported-key unit-skip, root-caused and fixed in this leg). The quadletHostName=emission ran live in everystartstep of the final bed.N/A— the emission is pure render (no shared-state path); the bed ran on the combined tree with no surfaced failure.Attribution tier
fully tested and validated — the cutover's NEW code path executed live against the fresh rebuild: the emitter baked the manager image's
ENTRYPOINT+CMD [], the quadletHostName=ran in thestartstep, andagentteams-manager-runningPASSed (exit 0) on thecheck-agentteams-podbed — 13 steps, zero warnings, ondisposable: true, plus a freshcharly updatere-verification leg. Output pasted above.Harness rulebook compliance — state HOW each is satisfied (or
N/A — <reason>)/charly-internals:plugin(the emitter is a deploykit pure render —Mmechanism, no host I/O; the box fields arrive via the spec wire types);/charly-check:checkR10-gate-by-change-class;/charly-internals:git-workflowtwo-step landing.dockerCreatePayload+ charly images baking none). The bed shows zero warnings; the two earlier failed runs (2026.224.0211,2026.224.0302) are the documented pre-fix states. The quadletHostname=→HostName=unsupported-key unit-skip was root-caused and fixed in this leg (golden test pinned byte-exact).deploykit/generate.go); the auto-CMD []guard lives beside it; no<name>-host/<name>-podsiblings.N/A— no destructive git action; the branch advanced by adding commits only (no force-push).charly check run check-agentteams-pod, 13 steps, exit 0) — not justgo test.ENTRYPOINT/CMDContainerfile sections (pinned byTestOCIPackaging_EmittedAsOCIEntrypointAndCmd), theHostName=quadlet key (goldenquadlet_test.go), andcharly box inspectverified the real manager image carriesENTRYPOINT ["supervisord",...]+CMD [].charly version=2026.223.2215) and ran the bed; the spec pin bump is mandatory for standalone consumers and verified underGOWORK=off(no new runtime OS deps).disposable: true(check-agentteams-pod), fresh rebuild, zero warnings; the new tests (TestOCIPackaging_*) FAIL without the change.TestGenReproduciblegreen there); the sdk consumes them via the pinned module, no hand-typed wire struct. RDD: the composition-at-latest-versions assumption was bed-proven (check-agentteams-pod). ADE:N/A— no candies authored in the sdk repo.deploykit(an sdk kit) — a pure render mechanism with no registry coupling; the spec fields arrive via the pinned wire module. Correct layer.disposable: truebed.gofmt -l .empty,go vet ./...clean,golangci-lint run ./...= 0 issues,go test ./...green (workspace +GOWORK=off).CHANGELOG/2026.224.0404.mdstaged (placeholder CalVer, finalized by the pr-validator at merge).Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)