Skip to content

Cannot create agent when .env contains empty vars #678

@korya

Description

@korya

Creating agent with lk agent create fails when .env contains an empty env var (a var with empty value).

The error is twirp error internal: failed to convert secrets

A sample .env file to reproduce:

FOO=1
BAR=
BAZ=3

Here is the full log:

❯ lk agent create --verbose --secrets-file .env.lk
2025-09-09T23:43:59.521-0400	DEBUG	lk	config/livekit.go:91	loading livekit.toml file
Using project [test]
2025-09-09T23:44:00.809-0400	DEBUG	lk	lk/agent.go:363	Creating agent	{"working-dir": "."}
Using agent configuration [livekit.toml]
Creating new agent
Using secrets file [.env.lk]
Detected project type [python.uv]
Using existing Dockerfile
twirp error internal: failed to convert secrets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions