Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(devbox): default to no prebuild preset (#63578)

Raúl Negrón-Otero3f790b22c19a
diff --git a/tools/hogli-commands/hogli_commands/devbox/coder.py b/tools/hogli-commands/hogli_commands/devbox/coder.py
index 303767df6791..ffcefd5b5d3c 100644
--- a/tools/hogli-commands/hogli_commands/devbox/coder.py
+++ b/tools/hogli-commands/hogli_commands/devbox/coder.py
@@ -35,8 +35,11 @@ DEFAULT_TEMPLATE = "posthog-linux"
# create` that `--yes` does not bypass. Callers must always forward `--preset`
# with a concrete value -- either a preset the template defines, or the literal
# NO_PRESET sentinel below.
-DEFAULT_PRESET = "Default (warm)"
NO_PRESET = "none"
+# Opt out of presets by default so a vanilla `hogli devbox:start` never claims
+# from a prebuild warm pool (a Coder premium feature). Pass `--preset <name>` to
+# select a template preset explicitly where one is defined.
+DEFAULT_PRESET = NO_PRESET
BREW_PACKAGE = "coder/coder/coder"
RUNTIME_SETUP_HINT = "Run `hogli devbox:setup`."
_MANAGED_CODER_DIR = Path.home() / ".hogli" / "bin"
diff --git a/tools/hogli-commands/hogli_commands/tests/test_devbox.py b/tools/hogli-commands/hogli_commands/tests/test_devbox.py
index 06a1b2e8a2c1..51a762a7fcef 100644
--- a/tools/hogli-commands/hogli_commands/tests/test_devbox.py
+++ b/tools/hogli-commands/hogli_commands/tests/test_devbox.py
@@ -909,15 +909,20 @@ class TestWorkspaceCreation:
@pytest.mark.parametrize(
"kwargs, available_presets, expected_template, expected_preset, expected_params",
[
+ # Default opts out of presets so a vanilla create never claims a
+ # prebuild; the resolved preset is the NO_PRESET sentinel.
(
{},
["Default (warm)", "Cold"],
"posthog-linux",
- "Default (warm)",
+ "none",
{"disk_size": "100", "repo": _REPO, "workspace_region": "us-east-1"},
),
+ # An explicit warm preset that the template defines flows through to
+ # the coder argv unchanged, alongside all optional params.
(
{
+ "preset": "Default (warm)",
"git_name": "PostHog Engineer",
"git_email": "[email protected]",
"dotfiles_uri": _DOTFILES,
@@ -938,21 +943,15 @@ class TestWorkspaceCreation:
{"template": "posthog-microvm"},
["Default (warm)"],
"posthog-microvm",
- "Default (warm)",
- {"disk_size": "100", "repo": _REPO, "workspace_region": "us-east-1"},
- ),
- (
- {"preset": "none"},
- ["Default (warm)"],
- "posthog-linux",
"none",
{"disk_size": "100", "repo": _REPO, "workspace_region": "us-east-1"},
),
# Resolution fallback to "none" is exhaustively covered by
# TestTemplatePresetResolution; one case here is enough to prove
- # the resolved value flows through to the coder argv.
+ # the resolved value flows through to the coder argv. The requested
+ # preset is not among the template's presets, so it falls back.
(
- {"template": "posthog-microvm"},
+ {"template": "posthog-microvm", "preset": "Default (warm)"},
["Cold only"],
"posthog-microvm",
"none",
@@ -963,15 +962,14 @@ class TestWorkspaceCreation:
{"region": "eu-central-1"},
["Default (warm)"],
"posthog-linux",
- "Default (warm)",
+ "none",
{"disk_size": "100", "repo": _REPO, "workspace_region": "eu-central-1"},
),
],
ids=[
"defaults",
- "all-optionals",
+ "explicit-preset-all-optionals",
"custom-template",
- "preset-opt-out",
"resolver-fallback-flows-through",
"explicit-region",
],