Summary
Investigating #374 / PR #377 (the agent-box-env-exec native build failure)
surfaced a bigger gap: the native (non-NixOS) backend never got the env-store
CLI at all.
modules/agent-box.nix.in builds envStoreCli (agent-box-envstore) from
src/lib/envstore.py + src/envstore-cli.py, and exports
AGENT_BOX_ENVSTORE_BIN=${envStoreCli}/bin/agent-box-envstore in three
places (nix/runtime.nix has no equivalent — agent-box-envstore is not
in unitPayloads or cliPayloads at all).
modules/src/session-cli.sh, modules/src/profile-cli.sh, and
modules/src/webhook-spawn.sh all hard-require it:
ENVSTORE="${AGENT_BOX_ENVSTORE_BIN:?the env-store CLI is pinned by the generated wrapper; run this through the installed command}".
bin/agentbox (the native apply renderer) sets AGENT_BOX_ENV_EXEC,
AGENT_BOX_GREP_BIN, AGENT_BOX_FIND_BIN, AGENT_BOX_FLOCK_BIN,
AGENT_BOX_HOSTNAME_BIN, etc. in the unit drop-in, but never
AGENT_BOX_ENVSTORE_BIN.
agent-box-profile (modules/src/profile-cli.sh) is not built by
nix/runtime.nix at all — the binary doesn't exist on a native box.
Net effect on a native box: agent-box-session env set/ls/rm and the
webhook spawner (webhook-spawn.sh) fail immediately with "the env-store CLI
is pinned by the generated wrapper; run this through the installed command",
and agent-box-profile is missing entirely — no per-user secrets/env
management, no profiles, on the backend nix/runtime.nix targets.
Where the fix likely goes
nix/runtime.nix: add an envStoreCli payload mirroring the module's
(writers.writePython3Bin "agent-box-envstore" over
src/lib/envstore.py + src/envstore-cli.py), and ship agent-box-profile
the same way agent-box-session-bare is shipped.
bin/agentbox: set AGENT_BOX_ENVSTORE_BIN in user_dropins() alongside
the other AGENT_BOX_*_BIN exports.
How this was found
While fixing #374 (PR #377), agent-box-env-exec needed the same
"envstore.py spliced in above" treatment envExecWrapper gets in the
module. Checking who else depends on AGENT_BOX_ENVSTORE_BIN turned up that
none of it exists on the native side. Not fixed here — it's a separate,
larger gap than the single-binary build failure #374/#377 addresses.
Summary
Investigating #374 / PR #377 (the
agent-box-env-execnative build failure)surfaced a bigger gap: the native (non-NixOS) backend never got the env-store
CLI at all.
modules/agent-box.nix.inbuildsenvStoreCli(agent-box-envstore) fromsrc/lib/envstore.py+src/envstore-cli.py, and exportsAGENT_BOX_ENVSTORE_BIN=${envStoreCli}/bin/agent-box-envstorein threeplaces (
nix/runtime.nixhas no equivalent —agent-box-envstoreis notin
unitPayloadsorcliPayloadsat all).modules/src/session-cli.sh,modules/src/profile-cli.sh, andmodules/src/webhook-spawn.shall hard-require it:ENVSTORE="${AGENT_BOX_ENVSTORE_BIN:?the env-store CLI is pinned by the generated wrapper; run this through the installed command}".bin/agentbox(the nativeapplyrenderer) setsAGENT_BOX_ENV_EXEC,AGENT_BOX_GREP_BIN,AGENT_BOX_FIND_BIN,AGENT_BOX_FLOCK_BIN,AGENT_BOX_HOSTNAME_BIN, etc. in the unit drop-in, but neverAGENT_BOX_ENVSTORE_BIN.agent-box-profile(modules/src/profile-cli.sh) is not built bynix/runtime.nixat all — the binary doesn't exist on a native box.Net effect on a native box:
agent-box-session env set/ls/rmand thewebhook spawner (
webhook-spawn.sh) fail immediately with "the env-store CLIis pinned by the generated wrapper; run this through the installed command",
and
agent-box-profileis missing entirely — no per-user secrets/envmanagement, no profiles, on the backend
nix/runtime.nixtargets.Where the fix likely goes
nix/runtime.nix: add anenvStoreClipayload mirroring the module's(
writers.writePython3Bin "agent-box-envstore"oversrc/lib/envstore.py+src/envstore-cli.py), and shipagent-box-profilethe same way
agent-box-session-bareis shipped.bin/agentbox: setAGENT_BOX_ENVSTORE_BINinuser_dropins()alongsidethe other
AGENT_BOX_*_BINexports.How this was found
While fixing #374 (PR #377),
agent-box-env-execneeded the same"envstore.py spliced in above" treatment
envExecWrappergets in themodule. Checking who else depends on
AGENT_BOX_ENVSTORE_BINturned up thatnone of it exists on the native side. Not fixed here — it's a separate,
larger gap than the single-binary build failure #374/#377 addresses.