Skip to content

Native runtime profile: agent-box-envstore missing, agent-box-profile not shipped, AGENT_BOX_ENVSTORE_BIN never set #378

Description

@defangdevs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions