fix(container): keep the browser env alive where image ENV is dropped - #1035
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryAdds a login-shell profile fallback so browser configuration remains available in sandbox runtimes that discard Docker image environment metadata.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified. The generated profile supplies the intended browser defaults when image environment metadata is absent while retaining nonempty runtime overrides, and the changed build step validates the primary fallback. Important Files Changed
Reviews (1): Last reviewed commit: "fix(container): keep the browser env ali..." | Re-trigger Greptile |
Summary
The
AGENT_BROWSER_*settings in this image areENVlines, which some sandboxruntimes never deliver to the guest: they build their own rootfs from the image
filesystem and boot their own init, so the image's
ENVis simply absent. In arunning sandbox of that kind:
Everything configured here is silently inert there — the idle timeout that
reclaims abandoned browsers, the automation-hardening flags in
AGENT_BROWSER_ARGS, the user agent, the screenshot dir.Agent commands do run through a login shell, so the values are additionally
emitted as a profile script, generated at build time from the
ENVlines sothere is still one source of truth:
Each entry keeps the
:-fallback, so an explicitly-passed value still wins andplain
docker run -e ...behaves exactly as before. The build asserts the resultunder
env -i bash -lc, i.e. with the environment emptied the way such a runtimeempties it.
Verified end to end in a real sandbox built from this image: before, the timeout
and args were
UNSETin both a plain command and a detachedsetsidchild;after, both report
180000and the full arg list, an abandoned browser sessionis reclaimed at 180s (22 → 11 Chromium processes, 751 → 543 MB) while a session
touched every 45s survives, and the reclaimed one relaunches on its next command.
Link to Devin session: https://app.devin.ai/sessions/dad023e379e942f287bcf6822463b7a4
Requested by: @0xallam