fix(dev): inherit non-expiring sandbox JWT in local gateway scripts - #2636
Open
pimlock wants to merge 1 commit into
Open
fix(dev): inherit non-expiring sandbox JWT in local gateway scripts#2636pimlock wants to merge 1 commit into
pimlock wants to merge 1 commit into
Conversation
The local gateway launcher scripts hardcode gateway_jwt.ttl_secs = 3600, which overrides the non-expiring default introduced in #1721. Local Docker, Podman, and VM sandboxes are still unrecoverable when the gateway is down longer than that TTL: the on-disk token expires and only the Kubernetes ServiceAccount path can rebootstrap, so the supervisor crash-loops on policy fetch and the sandbox never leaves Provisioning. Drop the override so local drivers inherit the default. gateway.sh also serves the kubernetes driver, which is a shared deployment and must keep a positive TTL, so it now emits ttl_secs only for that driver. The e2e regression test added in #1721 does not catch this because the e2e harness uses its own configs, which already set ttl_secs = 0. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
pimlock
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
August 6, 2026 18:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
For local gateways, we removed the
ttl_secsfor the supervisor JWT before, since for these it's possible the user closes their laptop, opens it again and the sandbox JWT expired and cannot be refreshed anymore, making the sandbox unusable.That was changed in #1721 to have JWTs not expire for local gateways.
However, local gateways started through our dev scripts still use
3600as TTL, so gateways started through these run into the same issue. This is a fix for that.Observed on a local Docker gateway: two sandboxes at ~5,600 restarts each over 8 days, both stuck in
Provisioning.The
ttl_secs = 3600lines predate the fix - all three were added by fa84e43 (#1575, 2026-05-26), eight days before e4bcfdf (#1721, 2026-06-03). They are leftovers the fix missed, not a deliberate later mitigation.Related Issue
Relates to #1603 and #1721. #1721 fixed the gateway default and the Kubernetes/Helm path; this covers the dev-workflow launchers it left behind. #1603 is closed, so this is the remaining follow-up rather than new accepted work - happy to open a fresh issue if maintainers prefer that.
Changes
tasks/scripts/gateway-docker.sh,tasks/scripts/gateway-vm.sh: removed the hardcodedttl_secs = 3600. Both are local-driver-only, so they now inherit the non-expiring default fromcrates/openshell-server/src/defaults.rs.tasks/scripts/gateway.sh: this script also serves thekubernetesdriver, which is a shared deployment and must keep a positive TTL, so a plain removal would have been wrong. The value is now emitted conditionally for that driver only, appended after the heredoc but before thecasewrites any[openshell.drivers.*]header so it still lands in thegateway_jwttable.Removing the line rather than setting
ttl_secs = 0keeps one source of truth, so a future change to the default propagates on its own.Testing
mise run pre-commitpassesChecklist
architecture/gateway.mdanddocs/reference/gateway-config.mdxalready documentttl_secs = 0as the local default, and this change makes the scripts match what is documented