From 3aacb5dc136a189e87a1752b5f3ad02f3cb8ad84 Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:17:34 +0000 Subject: [PATCH 01/14] docs(#7229): record OpenShell exec/stop signal contract in ADR 0030 PR #7208 spent five review cycles on a SIGINT-via-sandbox-exec side-channel so cancelled runs could flush total_cost_usd. Upstream OpenShell cannot deliver that signal: sandbox exec is fire-and-forget (NVIDIA/OpenShell#3159, not planned) and sandbox stop sends SIGKILL, not SIGINT (#2855 / #3036). That knowledge lived only in the closed PR thread. Annotate Accepted ADR 0030 with the exec/stop signal contract, cite the upstream issues, and cross-reference the token-count partial fix (#6936 / PR #6938) and the abandoned dollar-cost attempt (PR #7208). The Commands: SSH decision is unchanged. Note: pre-commit run could not complete (git fetch of hook repos returned HTTP 403). Matching hooks were run directly and passed: lint-adr-status, lint-adr-numbers, lint-adr-frontmatter, lint-docs-links, lychee, gitleaks, trailing-whitespace, end-of-file, and detect-private-key. Closes #7229 --- ...030-openshell-sandbox-interaction-model.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/ADRs/0030-openshell-sandbox-interaction-model.md b/docs/ADRs/0030-openshell-sandbox-interaction-model.md index 4f18b95631..f6419b0c9c 100644 --- a/docs/ADRs/0030-openshell-sandbox-interaction-model.md +++ b/docs/ADRs/0030-openshell-sandbox-interaction-model.md @@ -77,6 +77,11 @@ ssh-config`, use standard `ssh`/`scp`/`rsync`. Supports stdout streaming. file transfer. No SSH binary or config needed — all communication goes through the gateway's gRPC API. +> **Note (2026-09, [#7229](https://github.com/fullsend-ai/fullsend/issues/7229)):** +> Native `sandbox exec` / `sandbox stop` cannot deliver SIGINT into the invoked +> process tree. See +> [Signal and lifecycle semantics](#signal-and-lifecycle-semantics). + ### Credential delivery **A. OpenShell providers with bare-key form.** Register providers on the gateway @@ -160,6 +165,36 @@ entry command (`true`) exits; fullsend explicitly deletes after extraction. > `--detach -- sleep infinity` instead of `-- true`. The rest of the sequence, > and the reason `--keep` is passed, are unchanged. +### Signal and lifecycle semantics + +> **Note (2026-09, [#7229](https://github.com/fullsend-ai/fullsend/issues/7229)):** +> Annotation of a constraint discovered after this ADR was accepted; the +> Commands decision above is unchanged. + +`openshell sandbox exec` is fire-and-forget with respect to termination: it +does not return an exec id, does not propagate host-side signals into the +invoked process tree, and closing the client does not stop the in-sandbox +command. Upstream declined to add a per-exec kill +([NVIDIA/OpenShell#3159](https://github.com/NVIDIA/OpenShell/issues/3159), +closed as not planned). + +`openshell sandbox stop` is not a graceful alternative. Stop sends SIGKILL, +not SIGINT. On the pinned OpenShell 0.0.116 release, the stop waits ~45s for a +SIGTERM that never arrives (`CAP_KILL` dropped, +[NVIDIA/OpenShell#2855](https://github.com/NVIDIA/OpenShell/issues/2855)) +and then SIGKILLs the container. +[NVIDIA/OpenShell#3036](https://github.com/NVIDIA/OpenShell/pull/3036) +restores SIGTERM to the canonical process group, but still not SIGINT, and +exec'd process trees still receive SIGKILL. Neither primitive supports +graceful in-sandbox shutdown for telemetry-flush purposes. + +Token-count persistence is the accepted partial fix for cancelled-run +telemetry ([#6936](https://github.com/fullsend-ai/fullsend/issues/6936) / +[PR #6938](https://github.com/fullsend-ai/fullsend/pull/6938)). +[PR #7208](https://github.com/fullsend-ai/fullsend/pull/7208) attempted a +secondary `sandbox exec` as a SIGINT side-channel for `total_cost_usd` and +was closed unmerged once this contract was confirmed. + ## Consequences - Fullsend depends only on the OpenShell CLI, `ssh`, `scp`, and `rsync` — no From f3df6eded60e8c5ea6f4a5ff138b424a93be5536 Mon Sep 17 00:00:00 2001 From: fullsend-fix <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:46:22 +0000 Subject: [PATCH 02/14] docs(#7229): correct ADR 0030 signal contract and callout formatting Addresses fullsend-ai-review findings on PR #7233: - The annotation overstated OpenShell's signal contract: it read as if no in-sandbox SIGINT delivery is possible, when only the original sandbox exec channel cannot propagate host-side signals. A second, independent sandbox exec that runs kill -INT against a known guest PID does deliver the signal - E2E-verified in PR #7208 and already used in production (killStrayProcessesTemplate in internal/runtime/stray_processes.go) for TERM/KILL. Rewrote the Command-execution pointer and the Signal and lifecycle semantics subsection to distinguish the two exec paths, and corrected the stated reason PR #7208 was closed (unsupported side-channel outside OpenShell's contract, Claude-only PID-file coverage, and total_cost_usd being a non-authoritative estimate - not failed signal delivery). - The new subsection mixed a 3-line blockquoted note with ~20 lines of unmarked prose, inconsistent with this file's existing post-acceptance annotation convention (the #6691 note). Wrapped the entire subsection in the blockquote so it reads unambiguously as an annotation rather than a new peer Decision subsection. Addresses #7233 --- ...030-openshell-sandbox-interaction-model.md | 69 ++++++++++++------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/docs/ADRs/0030-openshell-sandbox-interaction-model.md b/docs/ADRs/0030-openshell-sandbox-interaction-model.md index f6419b0c9c..c7b1910e00 100644 --- a/docs/ADRs/0030-openshell-sandbox-interaction-model.md +++ b/docs/ADRs/0030-openshell-sandbox-interaction-model.md @@ -78,8 +78,9 @@ file transfer. No SSH binary or config needed — all communication goes through the gateway's gRPC API. > **Note (2026-09, [#7229](https://github.com/fullsend-ai/fullsend/issues/7229)):** -> Native `sandbox exec` / `sandbox stop` cannot deliver SIGINT into the invoked -> process tree. See +> `sandbox exec` cannot deliver a signal to the process it started, and +> `sandbox stop` sends SIGKILL, not SIGINT — but a *second* `sandbox exec` +> that runs `kill -INT ` against a known guest PID does work. See > [Signal and lifecycle semantics](#signal-and-lifecycle-semantics). ### Credential delivery @@ -170,30 +171,46 @@ entry command (`true`) exits; fullsend explicitly deletes after extraction. > **Note (2026-09, [#7229](https://github.com/fullsend-ai/fullsend/issues/7229)):** > Annotation of a constraint discovered after this ADR was accepted; the > Commands decision above is unchanged. - -`openshell sandbox exec` is fire-and-forget with respect to termination: it -does not return an exec id, does not propagate host-side signals into the -invoked process tree, and closing the client does not stop the in-sandbox -command. Upstream declined to add a per-exec kill -([NVIDIA/OpenShell#3159](https://github.com/NVIDIA/OpenShell/issues/3159), -closed as not planned). - -`openshell sandbox stop` is not a graceful alternative. Stop sends SIGKILL, -not SIGINT. On the pinned OpenShell 0.0.116 release, the stop waits ~45s for a -SIGTERM that never arrives (`CAP_KILL` dropped, -[NVIDIA/OpenShell#2855](https://github.com/NVIDIA/OpenShell/issues/2855)) -and then SIGKILLs the container. -[NVIDIA/OpenShell#3036](https://github.com/NVIDIA/OpenShell/pull/3036) -restores SIGTERM to the canonical process group, but still not SIGINT, and -exec'd process trees still receive SIGKILL. Neither primitive supports -graceful in-sandbox shutdown for telemetry-flush purposes. - -Token-count persistence is the accepted partial fix for cancelled-run -telemetry ([#6936](https://github.com/fullsend-ai/fullsend/issues/6936) / -[PR #6938](https://github.com/fullsend-ai/fullsend/pull/6938)). -[PR #7208](https://github.com/fullsend-ai/fullsend/pull/7208) attempted a -secondary `sandbox exec` as a SIGINT side-channel for `total_cost_usd` and -was closed unmerged once this contract was confirmed. +> +> `openshell sandbox exec` is fire-and-forget with respect to the process it +> started: it does not return an exec id, does not propagate host-side +> signals into that invoked process tree, and closing the client does not +> stop the in-sandbox command. Upstream declined to add a per-exec kill +> ([NVIDIA/OpenShell#3159](https://github.com/NVIDIA/OpenShell/issues/3159), +> closed as not planned) — its stated position is that callers should not +> expect exec'd processes to exit when the caller does, the same contract as +> `podman exec` / `kubectl exec`. +> +> This does not make signal delivery impossible: a *second*, independent +> `sandbox exec` that runs `kill -INT ` against a known guest PID does +> deliver the signal, because it targets the guest PID directly rather than +> relying on the original exec channel to propagate anything. [PR +> #7208](https://github.com/fullsend-ai/fullsend/pull/7208) E2E-verified this +> path (`total_cost_usd: 0.7879`, was `0`), and production already relies on +> the same second-exec-plus-in-guest-kill pattern in +> `killStrayProcessesTemplate` (`internal/runtime/stray_processes.go`) to +> send TERM/KILL to known guest PIDs. +> +> `openshell sandbox stop` is not a graceful alternative to either exec path. +> Stop sends SIGKILL, not SIGINT. On the pinned OpenShell 0.0.116 release, +> the stop waits ~45s for a SIGTERM that never arrives (`CAP_KILL` dropped, +> [NVIDIA/OpenShell#2855](https://github.com/NVIDIA/OpenShell/issues/2855)) +> and then SIGKILLs the container. +> [NVIDIA/OpenShell#3036](https://github.com/NVIDIA/OpenShell/pull/3036) +> restores SIGTERM to the canonical process group, but still not SIGINT, and +> exec'd process trees still receive SIGKILL. +> +> Token-count persistence is the accepted partial fix for cancelled-run +> telemetry ([#6936](https://github.com/fullsend-ai/fullsend/issues/6936) / +> [PR #6938](https://github.com/fullsend-ai/fullsend/pull/6938)). +> [PR #7208](https://github.com/fullsend-ai/fullsend/pull/7208) added a +> second-exec SIGINT side-channel to also capture `total_cost_usd` on +> cancellation, and signal delivery itself worked. It was closed unmerged +> anyway: the side-channel bypasses OpenShell's supported stop lifecycle, the +> PID-file mechanism it depends on only reliably targets the runtime process +> for callers that `exec` into it (Claude) and not the others (Codex, Pi), +> and `total_cost_usd` is a list-price estimate rather than an authoritative +> billing figure — not worth the added complexity and risk. ## Consequences From 4e49bd169aba6b0df85977300fdb866452f8f506 Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Sat, 26 Sep 2026 09:26:08 -0400 Subject: [PATCH 03/14] feat(#7229): run on OpenShell 0.1.1 Bump the pinned OpenShell to v0.1.1 and write the schema v2 gateway config (compute_driver under [openshell.gateway], supervisor_image and health checks under [openshell.drivers.podman]) in action.yml and the functional tests. 0.1.x is a clean break with 0.0.x, so nothing keeps 0.0.116 working: - Scaffold providers no longer carry the _NOOP_* placeholder credentials (OpenShell#1978, closed): 0.1.x creates a credential-less provider and rejects a credential its profile does not declare. - The run-scoped OpenAI provider is created with its value and the expiry is attached in the next call; 0.1.x refuses an empty value for a declared credential, so the empty-create step is gone. Assisted-by: Claude Signed-off-by: Wayne Sun --- .github/scripts/openshell-version.sh | 4 +- .github/workflows/functional-tests.yml | 6 ++- action.yml | 6 ++- internal/cli/run_openai.go | 35 +++------------- internal/cli/run_openai_test.go | 40 +++++-------------- .../providers/atlassian-cloud.yaml | 3 -- .../providers/github-artifacts.yaml | 3 -- .../fullsend-repo/providers/github-ro.yaml | 3 -- .../fullsend-repo/providers/github.yaml | 3 -- .../fullsend-repo/providers/gitleaks.yaml | 3 -- .../providers/package-registries.yaml | 3 -- .../fullsend-repo/providers/vertex-ai.yaml | 3 -- 12 files changed, 27 insertions(+), 85 deletions(-) diff --git a/.github/scripts/openshell-version.sh b/.github/scripts/openshell-version.sh index 927fcaff32..838842bad9 100755 --- a/.github/scripts/openshell-version.sh +++ b/.github/scripts/openshell-version.sh @@ -14,8 +14,8 @@ # Usage: # source .github/scripts/openshell-version.sh -OPENSHELL_VERSION=0.0.116 -OPENSHELL_SHA=d1155aa70042d3e2ee49dbfa15346b108b7c1d92 +OPENSHELL_VERSION=0.1.1 +OPENSHELL_SHA=4ce767fc0cadad773c398e15109c0286f4b7aa30 export OPENSHELL_VERSION OPENSHELL_SHA diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index fb693dfae5..528cbfa5a4 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -174,10 +174,14 @@ jobs: echo "OPENSHELL_BIND_ADDRESS=0.0.0.0" > "$HOME/.config/openshell/gateway.env" cat > "$HOME/.config/openshell/gateway.toml" << EOF [openshell] - version = 1 + version = 2 [openshell.gateway] + compute_driver = "podman" + + [openshell.drivers.podman] supervisor_image = "ghcr.io/nvidia/openshell/supervisor:${OPENSHELL_VERSION}" + health_check_interval_secs = 10 EOF - name: Install OpenShell CLI diff --git a/action.yml b/action.yml index 9ed38708da..61986e3823 100644 --- a/action.yml +++ b/action.yml @@ -387,10 +387,14 @@ runs: EOF cat > $HOME/.config/openshell/gateway.toml << EOF [openshell] - version = 1 + version = 2 [openshell.gateway] + compute_driver = "podman" + + [openshell.drivers.podman] supervisor_image = "ghcr.io/nvidia/openshell/supervisor:${OPENSHELL_VERSION}" + health_check_interval_secs = 10 EOF - name: Install OpenShell CLI diff --git a/internal/cli/run_openai.go b/internal/cli/run_openai.go index 6f7804dc17..9c3003e544 100644 --- a/internal/cli/run_openai.go +++ b/internal/cli/run_openai.go @@ -524,17 +524,6 @@ func ensureOpenAIProfile(ctx context.Context, profileID string, printer *ui.Prin return nil } -// emptyCredentialRefusedRe matches the gateway's rejection of an empty -// credential value on create — today "provider.credentials must not be -// empty" (only for an empty map); a future value-level check is expected -// to keep the words. Anything else is a real failure, not a cue to send the -// value without its expiry. -var emptyCredentialRefusedRe = regexp.MustCompile(`(?i)credential[^\n]*(empty|required|missing|invalid)`) - -func emptyCredentialRefused(err error) bool { - return err != nil && emptyCredentialRefusedRe.MatchString(err.Error()) -} - // openAICredentialKeys returns the credential keys the run-scoped provider // carries. The profile declares exactly one, OPENAI_API_KEY, and that is all // a definition may ask for: the token is never copied under another name @@ -738,28 +727,16 @@ func ensureOpenAIProvider(ctx context.Context, pd harness.ProviderDef, sandboxNa start := time.Now() printer.StepStart("Ensuring run-scoped provider: " + name) - // Two steps, so the value is never on the gateway without its expiry: - // create the instance with empty credentials (nothing secret involved), - // then store value and expiry together in one update. + // OpenShell requires a declared credential's value on create and takes + // an expiry only on update, so the value is stored first and its expiry + // in the very next call. empty := make(map[string]string, len(keys)) for _, k := range keys { empty[k] = "" } - if err := sandbox.EnsureProviderLiteral(ctx, name, pd.Type, empty); err != nil { - // OpenShell 0.0.115 accepts an empty credential value on create - // (only an empty credential *map* is rejected — the same gap the - // _NOOP_* providers use). Should a later release validate values, - // fall back to creating with the value and attaching the expiry in - // the very next call: a one-call window instead of a hard failure. - if !emptyCredentialRefused(err) { - printer.StepFail("Failed to create run-scoped provider " + name) - return openAIProviderHandle{}, fmt.Errorf("ensuring provider %q: %w", name, err) - } - printer.StepWarn("Gateway refused an empty credential on create; creating with the value and attaching the expiry immediately") - if err := sandbox.EnsureProviderLiteral(ctx, name, pd.Type, creds); err != nil { - printer.StepFail("Failed to create run-scoped provider " + name) - return openAIProviderHandle{}, fmt.Errorf("ensuring provider %q: %w", name, err) - } + if err := sandbox.EnsureProviderLiteral(ctx, name, pd.Type, creds); err != nil { + printer.StepFail("Failed to create run-scoped provider " + name) + return openAIProviderHandle{}, fmt.Errorf("ensuring provider %q: %w", name, err) } if err := sandbox.UpdateProviderLiteralWithExpiry(ctx, name, creds, cred.expiresAt); err != nil { // The caller only registers the deferred delete once this function diff --git a/internal/cli/run_openai_test.go b/internal/cli/run_openai_test.go index 669d0b47b7..792c7e6a5f 100644 --- a/internal/cli/run_openai_test.go +++ b/internal/cli/run_openai_test.go @@ -231,15 +231,15 @@ func TestEnsureOpenAIProvider_WIF(t *testing.T) { args, err := os.ReadFile(argsLog) require.NoError(t, err) lines := strings.Split(strings.TrimSpace(string(args)), "\n") - require.Len(t, lines, 2, "empty create, then value and expiry together: %q", lines) - assert.Equal(t, "provider create --name openai-0123456789ab --type fullsend-openai --credential OPENAI_API_KEY=", lines[0], "the instance is created without a credential") + require.Len(t, lines, 2, "create with the value, then the expiry: %q", lines) + assert.Equal(t, "provider create --name openai-0123456789ab --type fullsend-openai --credential OPENAI_API_KEY", lines[0], "bare-key form: the value is in the child environment only") assert.Equal(t, "provider update openai-0123456789ab --credential OPENAI_API_KEY --credential-expires-at OPENAI_API_KEY=2026-08-27T20:00:00Z", lines[1], "bare-key form with the expiry in the same call") env, err := os.ReadFile(envLog) require.NoError(t, err) envLines := strings.Split(strings.TrimSpace(string(env)), "\n") - assert.NotEqual(t, "tok-$literal$-value-9f8e7d", envLines[0], "the token is not handed to the create call") - assert.Equal(t, "tok-$literal$-value-9f8e7d", envLines[1], "the value reaches the update child verbatim, `$` intact") + assert.Equal(t, "tok-$literal$-value-9f8e7d", envLines[0], "the value reaches the create child verbatim, `$` intact") + assert.Equal(t, "tok-$literal$-value-9f8e7d", envLines[1], "and the update child") res := security.NewSecretRedactor().Scan("log line with tok-$literal$-value-9f8e7d inside") assert.False(t, res.Safe) @@ -266,8 +266,8 @@ func TestEnsureOpenAIProvider_StaticGetsBoundedExpiry(t *testing.T) { args, err := os.ReadFile(argsLog) require.NoError(t, err) lines := strings.Split(strings.TrimSpace(string(args)), "\n") - require.Len(t, lines, 2, "empty create, then the key with a bounded expiry: %q", lines) - assert.Equal(t, "provider create --name openai-feedface --type fullsend-openai --credential OPENAI_API_KEY=", lines[0]) + require.Len(t, lines, 2, "create with the key, then its bounded expiry: %q", lines) + assert.Equal(t, "provider create --name openai-feedface --type fullsend-openai --credential OPENAI_API_KEY", lines[0]) require.Regexp(t, `^provider update openai-feedface --credential OPENAI_API_KEY --credential-expires-at OPENAI_API_KEY=\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$`, lines[1]) stamp := strings.TrimPrefix(strings.Fields(lines[1])[6], "OPENAI_API_KEY=") at, err := time.Parse(time.RFC3339, stamp) @@ -291,7 +291,7 @@ func TestEnsureOpenAIProvider_StoreFailureDeletesProvider(t *testing.T) { args, readErr := os.ReadFile(argsLog) require.NoError(t, readErr) lines := strings.Split(strings.TrimSpace(string(args)), "\n") - require.Len(t, lines, 3, "empty create, failed store, delete: %q", lines) + require.Len(t, lines, 3, "create, failed expiry store, delete: %q", lines) assert.True(t, strings.HasPrefix(lines[1], "provider update openai-feedface --credential OPENAI_API_KEY --credential-expires-at")) assert.Equal(t, "provider delete openai-feedface", lines[2], "a provider whose credential could not be stored with its expiry is not left behind") } @@ -575,8 +575,8 @@ func TestRunAgent_OpenAIProviderIsRunScopedAndDeleted(t *testing.T) { } require.NotEmpty(t, profileLine, "the runner imports the fullsend-openai profile from its embedded scaffold: %q", lines) require.NotEmpty(t, createLine, "provider created: %q", lines) - assert.Regexp(t, `^provider create --name openai-[0-9a-f]{12} --type fullsend-openai --credential OPENAI_API_KEY=$`, createLine, - "run-scoped name, created without a credential") + assert.Regexp(t, `^provider create --name openai-[0-9a-f]{12} --type fullsend-openai --credential OPENAI_API_KEY$`, createLine, + "run-scoped name, value by bare key") assert.NotContains(t, strings.Join(lines, "\n"), "sk-local-static-key-for-test", "the value never reaches a command line") scoped := strings.Fields(createLine)[3] @@ -919,28 +919,6 @@ func TestOpenAIKeyIsNotExpandable(t *testing.T) { assert.NotContains(t, shellSafeExpandEnv("prefix-${OPENAI_API_KEY}-suffix"), "sk-local-static-key") } -func TestEnsureOpenAIProvider_FallsBackWhenEmptyCreateIsRefused(t *testing.T) { - argsLog, envLog := fakeOpenshellRecorder(t, "--type fullsend-openai --credential OPENAI_API_KEY=") - for _, k := range []string{"FULLSEND_OPENAI_AUDIENCE", "FULLSEND_OPENAI_IDENTITY_PROVIDER_ID", "FULLSEND_OPENAI_SERVICE_ACCOUNT_ID"} { - t.Setenv(k, "") - } - t.Setenv("OPENAI_API_KEY", "sk-local-static-key") - t.Setenv("GITHUB_ACTIONS", "") - var buf strings.Builder - h, err := ensureOpenAIProvider(context.Background(), harness.ProviderDef{Name: "openai", Type: openAIProviderType}, "fs-cod-feedface", config.OpenAIWIFConfig{}, piBackend(), ui.New(&buf)) - require.NoError(t, err) - assert.Equal(t, "openai-feedface", h.name) - lines := readArgLines(t, argsLog) - // The refused empty create is not retried (non-transient); the fallback - // creates with the value and the expiry follows immediately. - require.GreaterOrEqual(t, len(lines), 3, "%q", lines) - assert.Equal(t, "provider create --name openai-feedface --type fullsend-openai --credential OPENAI_API_KEY", lines[len(lines)-2], "fallback create carries the value by bare key") - assert.True(t, strings.HasPrefix(lines[len(lines)-1], "provider update openai-feedface --credential OPENAI_API_KEY --credential-expires-at OPENAI_API_KEY=")) - env := readArgLines(t, envLog) - assert.Equal(t, "sk-local-static-key", env[len(env)-2], "the value reaches the fallback create child") - assert.Contains(t, buf.String(), "refused an empty credential on create") -} - func TestEnsureOpenAIProvider_IgnoresExtraCredentialKeys(t *testing.T) { argsLog, _ := fakeOpenshellRecorder(t) for _, k := range []string{"FULLSEND_OPENAI_AUDIENCE", "FULLSEND_OPENAI_IDENTITY_PROVIDER_ID", "FULLSEND_OPENAI_SERVICE_ACCOUNT_ID"} { diff --git a/internal/scaffold/fullsend-repo/providers/atlassian-cloud.yaml b/internal/scaffold/fullsend-repo/providers/atlassian-cloud.yaml index 0ca698463f..fdbbae9ce2 100644 --- a/internal/scaffold/fullsend-repo/providers/atlassian-cloud.yaml +++ b/internal/scaffold/fullsend-repo/providers/atlassian-cloud.yaml @@ -1,6 +1,3 @@ --- name: atlassian-cloud type: fullsend-atlassian-cloud -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_ATLASSIAN_CLOUD: "" diff --git a/internal/scaffold/fullsend-repo/providers/github-artifacts.yaml b/internal/scaffold/fullsend-repo/providers/github-artifacts.yaml index 089eba9acd..c1c9c90151 100644 --- a/internal/scaffold/fullsend-repo/providers/github-artifacts.yaml +++ b/internal/scaffold/fullsend-repo/providers/github-artifacts.yaml @@ -1,6 +1,3 @@ --- name: github-artifacts type: fullsend-github-artifacts -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_GITHUB_ARTIFACTS: "" diff --git a/internal/scaffold/fullsend-repo/providers/github-ro.yaml b/internal/scaffold/fullsend-repo/providers/github-ro.yaml index 97527b561c..d1bd07b99b 100644 --- a/internal/scaffold/fullsend-repo/providers/github-ro.yaml +++ b/internal/scaffold/fullsend-repo/providers/github-ro.yaml @@ -1,6 +1,3 @@ --- name: github-ro type: fullsend-github-ro -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_GITHUB_RO: "" diff --git a/internal/scaffold/fullsend-repo/providers/github.yaml b/internal/scaffold/fullsend-repo/providers/github.yaml index 99de048551..6454272f1b 100644 --- a/internal/scaffold/fullsend-repo/providers/github.yaml +++ b/internal/scaffold/fullsend-repo/providers/github.yaml @@ -1,6 +1,3 @@ --- name: github type: fullsend-github -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_GITHUB: "" diff --git a/internal/scaffold/fullsend-repo/providers/gitleaks.yaml b/internal/scaffold/fullsend-repo/providers/gitleaks.yaml index 9170dec83c..f7cd37436f 100644 --- a/internal/scaffold/fullsend-repo/providers/gitleaks.yaml +++ b/internal/scaffold/fullsend-repo/providers/gitleaks.yaml @@ -1,6 +1,3 @@ --- name: gitleaks type: fullsend-gitleaks -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_GITLEAKS: "" diff --git a/internal/scaffold/fullsend-repo/providers/package-registries.yaml b/internal/scaffold/fullsend-repo/providers/package-registries.yaml index b69ee8032c..111ad8ec56 100644 --- a/internal/scaffold/fullsend-repo/providers/package-registries.yaml +++ b/internal/scaffold/fullsend-repo/providers/package-registries.yaml @@ -1,6 +1,3 @@ --- name: package-registries type: fullsend-package-registries -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_PACKAGE_REGISTRIES: "" diff --git a/internal/scaffold/fullsend-repo/providers/vertex-ai.yaml b/internal/scaffold/fullsend-repo/providers/vertex-ai.yaml index fd1f72ecb9..d4500f5e10 100644 --- a/internal/scaffold/fullsend-repo/providers/vertex-ai.yaml +++ b/internal/scaffold/fullsend-repo/providers/vertex-ai.yaml @@ -1,6 +1,3 @@ --- name: vertex-ai type: fullsend-vertex-ai -# Workaround: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _NOOP_VERTEX_AI: "" From 68e5b5fd28ddf340dba44912e984dc32fb45257b Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Sat, 26 Sep 2026 09:30:54 -0400 Subject: [PATCH 04/14] docs(#7229): update local setup, provider examples and ADR 0030 for OpenShell 0.1 - running-agents-locally: pin 0.1.1, the schema v2 gateway config and the clean upgrade from 0.0.x. - bring-your-own-agent, gate-binaries: providers without a secret carry no credentials; a token a provider does carry must be declared by its profile. - ADR 0030: stop SIGTERMs the canonical process group in under a second from 0.1.0; execs run in their own process group. - stray_processes.go: the process view on 0.1.1 (PID 1 is openshell-sandbox as the sandbox user, spared as an ancestor), re-verified with the real sweep against a planted orphan. Assisted-by: Claude Signed-off-by: Wayne Sun --- ...030-openshell-sandbox-interaction-model.md | 18 ++++++------ docs/guides/infrastructure/gate-binaries.md | 10 ++----- docs/guides/user/bring-your-own-agent.md | 5 ++-- docs/guides/user/running-agents-locally.md | 28 ++++++++++++++++++- internal/runtime/stray_processes.go | 16 +++++------ 5 files changed, 50 insertions(+), 27 deletions(-) diff --git a/docs/ADRs/0030-openshell-sandbox-interaction-model.md b/docs/ADRs/0030-openshell-sandbox-interaction-model.md index c7b1910e00..7f08573610 100644 --- a/docs/ADRs/0030-openshell-sandbox-interaction-model.md +++ b/docs/ADRs/0030-openshell-sandbox-interaction-model.md @@ -79,7 +79,7 @@ the gateway's gRPC API. > **Note (2026-09, [#7229](https://github.com/fullsend-ai/fullsend/issues/7229)):** > `sandbox exec` cannot deliver a signal to the process it started, and -> `sandbox stop` sends SIGKILL, not SIGINT — but a *second* `sandbox exec` +> `sandbox stop` never sends SIGINT — but a *second* `sandbox exec` > that runs `kill -INT ` against a known guest PID does work. See > [Signal and lifecycle semantics](#signal-and-lifecycle-semantics). @@ -191,14 +191,16 @@ entry command (`true`) exits; fullsend explicitly deletes after extraction. > `killStrayProcessesTemplate` (`internal/runtime/stray_processes.go`) to > send TERM/KILL to known guest PIDs. > -> `openshell sandbox stop` is not a graceful alternative to either exec path. -> Stop sends SIGKILL, not SIGINT. On the pinned OpenShell 0.0.116 release, -> the stop waits ~45s for a SIGTERM that never arrives (`CAP_KILL` dropped, +> `openshell sandbox stop` is not a graceful alternative to either exec path: +> it never sends SIGINT. On OpenShell 0.0.x it waited ~45s for a SIGTERM +> that never arrived (`CAP_KILL` dropped, > [NVIDIA/OpenShell#2855](https://github.com/NVIDIA/OpenShell/issues/2855)) -> and then SIGKILLs the container. -> [NVIDIA/OpenShell#3036](https://github.com/NVIDIA/OpenShell/pull/3036) -> restores SIGTERM to the canonical process group, but still not SIGINT, and -> exec'd process trees still receive SIGKILL. +> and then SIGKILLed the container. From 0.1.0 +> ([NVIDIA/OpenShell#3036](https://github.com/NVIDIA/OpenShell/pull/3036)) +> it SIGTERMs the canonical process group and returns in under a second +> (0.15–0.28s measured on 0.1.1 with podman). Each exec'd process tree now +> runs in its own process group rather than the supervisor's; whether stop +> signals those trees gracefully has not been measured. > > Token-count persistence is the accepted partial fix for cancelled-run > telemetry ([#6936](https://github.com/fullsend-ai/fullsend/issues/6936) / diff --git a/docs/guides/infrastructure/gate-binaries.md b/docs/guides/infrastructure/gate-binaries.md index a7d7f13067..d10c1a9721 100644 --- a/docs/guides/infrastructure/gate-binaries.md +++ b/docs/guides/infrastructure/gate-binaries.md @@ -207,15 +207,11 @@ Create a provider definition that references the profile by its `id`: ```yaml # providers/gate-query.yaml +# The gate binary handles its own authentication or needs no credentials, so +# the provider carries none: it exists only to attach the profile's network +# policy. name: gate-query type: gate-query -# The gate binary handles its own authentication or needs no credentials. -# This placeholder credential exists only to satisfy OpenShell's requirement -# that every provider declares at least one credential key. The provider -# definition's sole purpose is to attach the network policy from the profile. -# See: https://github.com/NVIDIA/OpenShell/issues/1978 -credentials: - _PLACEHOLDER_GATE_QUERY: "" ``` ### Harness configuration diff --git a/docs/guides/user/bring-your-own-agent.md b/docs/guides/user/bring-your-own-agent.md index a95b9f066f..24d39736b3 100644 --- a/docs/guides/user/bring-your-own-agent.md +++ b/docs/guides/user/bring-your-own-agent.md @@ -168,10 +168,11 @@ timeout_minutes: 15 ```yaml name: vertex-ai type: fullsend-vertex-ai -credentials: - _NOOP_VERTEX_AI: "" ``` +A provider that carries a token lists it under `credentials:` (for example `GH_TOKEN: "${GH_TOKEN}"`), +and its profile must declare that key; OpenShell refuses a credential the profile does not declare. + **`profiles/fullsend-vertex-ai.yaml`** — profile definition (tells OpenShell what endpoints the `fullsend-vertex-ai` type grants access to). `agent new` writes this; by hand, copy it from [fullsend-ai/agents](https://github.com/fullsend-ai/agents), which holds the fleet's copy: ```yaml id: fullsend-vertex-ai diff --git a/docs/guides/user/running-agents-locally.md b/docs/guides/user/running-agents-locally.md index b032823d9e..2fc6370416 100644 --- a/docs/guides/user/running-agents-locally.md +++ b/docs/guides/user/running-agents-locally.md @@ -53,11 +53,37 @@ fullsend is pinned to — the source of truth is in the fullsend repo at your release tag (also printed on Fullsend workflow runs). ```bash -export OPENSHELL_VERSION=0.0.116 # check the pin file for the current version +export OPENSHELL_VERSION=0.1.1 # check the pin file for the current version curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/v${OPENSHELL_VERSION}/install.sh | OPENSHELL_VERSION=v${OPENSHELL_VERSION} sh openshell --version ``` +The gateway reads a schema v2 config. With podman, pin the compute driver and the supervisor image +that matches the CLI: + +```toml +# ~/.config/openshell/gateway.toml (Homebrew on macOS: /opt/homebrew/var/openshell/gateway.toml +# is used when this file does not exist) +[openshell] +version = 2 + +[openshell.gateway] +compute_driver = "podman" + +[openshell.drivers.podman] +supervisor_image = "ghcr.io/nvidia/openshell/supervisor:0.1.1" +health_check_interval_secs = 10 +``` + +Restart the gateway after editing it (`brew services restart openshell` on macOS). `openshell sandbox +list` answering `No sandboxes found.` means the CLI reaches it. + +**Upgrading from OpenShell 0.0.x.** 0.1 cannot read 0.0.x gateway state or a schema v1 config. +Delete your sandboxes first (`openshell sandbox delete --all`), move `~/.config/openshell/gateway.toml` +and the gateway state directory (`~/.local/state/openshell/gateway`) aside, then run the installer +with `OPENSHELL_ACK_BREAKING_UPGRADE=1` and write the config above. fullsend recreates its providers and +profiles on the next run. + ## Get Google Cloud Platform credentials Fullsend uses GCP's VertexAI to run inference, so you need a GCP project. After authenticating on `gcloud` run: diff --git a/internal/runtime/stray_processes.go b/internal/runtime/stray_processes.go index da17600ab9..b57fdc4638 100644 --- a/internal/runtime/stray_processes.go +++ b/internal/runtime/stray_processes.go @@ -34,15 +34,13 @@ const killStrayProcessesTimeout = 15 * time.Second // where such a survivor keeps files open, burns CPU/memory and writes into // the workspace the next iteration reads. // -// Process-view assumptions, verified against OpenShell 0.0.116 and its -// source: `sandbox exec` runs `sh -c ` as the sandbox user after -// the supervisor drops privileges -// (crates/openshell-supervisor-process/src/process.rs). With the podman -// driver the supervisor is PID 1 owned by root -// (crates/openshell-driver-podman/src/container.rs sets `user: "0:0"` and -// the supervisor entrypoint), so it never appears in `ps -u `; -// on any driver it is an ancestor of this shell, which is what the -// ancestry walk below spares — the root/PID 1 detail is not load-bearing. +// Process-view assumptions, verified live on OpenShell 0.1.1 with podman: +// `sandbox exec` runs `sh -c ` as the sandbox user, each exec in +// its own process group, parented to the workload's PID 1 +// (`openshell-sandbox --bootstrap ...`), which also runs as the sandbox user +// and so appears in `ps -u`. PID 1 is an ancestor of this shell, which is +// what the ancestry walk below spares; the supervisor runs in a separate +// container and is not visible here. // The keep-alive main process (sandbox.KeepAliveCommand) does run as the // sandbox user with ppid 1, indistinguishable from a reparented stray by // tree shape, so it is excluded by argv: the command word is compared From 366455c416ab3d419e562ff5434984a39185e0ba Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Sat, 26 Sep 2026 09:43:30 -0400 Subject: [PATCH 05/14] feat(#7229): port the GitLab runner VM tooling to OpenShell 0.1 OpenShell 0.1 only accepts a schema-v2 gateway.toml and its install.sh refuses to upgrade a pre-0.1 install without an explicit ack. - pin_supervisor_image (gateway.sh) now writes supervisor_image under [openshell.drivers.podman] in a v2 file; a v1 or version-less file is moved aside to gateway.toml.pre-0.1, and a missing file is seeded from the packaged v2 default (literal fallback mirrors action.yml) so compute_driver is kept. setup.sh's configure_gateway reuses it. - Both install.sh paths (setup.sh via install-openshell.sh, and the per-job install_openshell_at_version) set OPENSHELL_ACK_BREAKING_UPGRADE=1. setup.sh tears down the gateway (store, TLS, sandboxes, CLI entry) after an install so pre-0.1 state is not reused; the per-job path already wipes it in start_fresh_openshell_gateway. - Fallback OPENSHELL_VERSION in setup.sh and create-*-vm.sh follows the pin (0.1.1). - Tests assert the v2 layout, the move-aside, the ack env, and the state wipe; fixtures move to 0.1.1 with a 0.0.x -> 0.1.x compare case. Assisted-by: Claude Signed-off-by: Wayne Sun --- hack/gitlab-runner-vm/create-gcp-vm.sh | 3 +- hack/gitlab-runner-vm/create-openshift-vm.sh | 3 +- hack/gitlab-runner-vm/executor/gateway.sh | 44 ++++- .../gitlab-runner-vm/executor/gateway_test.sh | 164 ++++++++++++++++-- .../executor/prepare_validation_test.sh | 2 +- hack/gitlab-runner-vm/podman-prune_test.sh | 9 +- hack/gitlab-runner-vm/setup.sh | 52 ++---- hack/gitlab-runner-vm/setup_test.sh | 109 +++++++++++- 8 files changed, 325 insertions(+), 61 deletions(-) diff --git a/hack/gitlab-runner-vm/create-gcp-vm.sh b/hack/gitlab-runner-vm/create-gcp-vm.sh index 535e6da313..08eee48881 100755 --- a/hack/gitlab-runner-vm/create-gcp-vm.sh +++ b/hack/gitlab-runner-vm/create-gcp-vm.sh @@ -130,7 +130,8 @@ if [ -f "${_openshell_version_sh}" ]; then # shellcheck source=../../.github/scripts/openshell-version.sh source "${_openshell_version_sh}" fi -OPENSHELL_VERSION="${OPENSHELL_VERSION:-0.0.116}" +# Fallback only when the pin file is absent; keep in step with openshell-version.sh. +OPENSHELL_VERSION="${OPENSHELL_VERSION:-0.1.1}" PREFIX="fullsend-gitlab-runner" # Validate GCP_USE_IAP early — it controls flag construction below, so an diff --git a/hack/gitlab-runner-vm/create-openshift-vm.sh b/hack/gitlab-runner-vm/create-openshift-vm.sh index cb0766be50..8c52c3d27d 100755 --- a/hack/gitlab-runner-vm/create-openshift-vm.sh +++ b/hack/gitlab-runner-vm/create-openshift-vm.sh @@ -103,7 +103,8 @@ if [ -f "${_openshell_version_sh}" ]; then # shellcheck source=../../.github/scripts/openshell-version.sh source "${_openshell_version_sh}" fi -OPENSHELL_VERSION="${OPENSHELL_VERSION:-0.0.116}" +# Fallback only when the pin file is absent; keep in step with openshell-version.sh. +OPENSHELL_VERSION="${OPENSHELL_VERSION:-0.1.1}" TEMPLATE="${SCRIPT_DIR}/vm.yaml" PREFIX="fullsend-gitlab-runner" diff --git a/hack/gitlab-runner-vm/executor/gateway.sh b/hack/gitlab-runner-vm/executor/gateway.sh index e188ddbd26..dbc0f40b28 100755 --- a/hack/gitlab-runner-vm/executor/gateway.sh +++ b/hack/gitlab-runner-vm/executor/gateway.sh @@ -321,18 +321,45 @@ start_fresh_openshell_gateway() { echo "OpenShell gateway is running with an empty profile registry" } +# Packaged schema-v2 default (OpenShell >= 0.1 RPM). Overridable for tests. +OPENSHELL_PACKAGED_GATEWAY_TOML="${OPENSHELL_PACKAGED_GATEWAY_TOML:-/usr/share/openshell-gateway/gateway.toml.default}" + +gateway_toml_is_v2() { + grep -Eq '^[[:space:]]*version[[:space:]]*=[[:space:]]*2[[:space:]]*(#.*)?$' "$1" +} + +# Pin supervisor_image under [openshell.drivers.podman] in a schema-v2 +# gateway.toml. OpenShell 0.1 rejects v1 and version-less files at startup, +# so such a file (written for 0.0.x) is moved aside to gateway.toml.pre-0.1. +# A missing file is seeded from the packaged default so compute_driver is +# kept (without it the gateway auto-detects Kubernetes before Podman); the +# literal fallback mirrors that default and action.yml. pin_supervisor_image() { local ver="$1" local gateway_toml="${HOME}/.config/openshell/gateway.toml" local supervisor_image supervisor_image="$(openshell_supervisor_image "${ver}")" mkdir -p "${HOME}/.config/openshell" - if [ -f "${gateway_toml}" ] && grep -q "supervisor_image" "${gateway_toml}"; then - sed -i "s|supervisor_image = .*|supervisor_image = \"${supervisor_image}\"|" "${gateway_toml}" - elif [ -f "${gateway_toml}" ] && grep -q '^\[openshell\.gateway\]' "${gateway_toml}"; then - sed -i "/^\[openshell\.gateway\]/a supervisor_image = \"${supervisor_image}\"" "${gateway_toml}" - elif [ -f "${gateway_toml}" ]; then - printf '\n[openshell.gateway]\nsupervisor_image = "%s"\n' "${supervisor_image}" >> "${gateway_toml}" + + if [ -f "${gateway_toml}" ] && ! gateway_toml_is_v2 "${gateway_toml}"; then + echo "Moving pre-0.1 OpenShell gateway config aside to ${gateway_toml}.pre-0.1" + mv -f "${gateway_toml}" "${gateway_toml}.pre-0.1" + fi + + if [ ! -f "${gateway_toml}" ]; then + if [ -f "${OPENSHELL_PACKAGED_GATEWAY_TOML}" ] && gateway_toml_is_v2 "${OPENSHELL_PACKAGED_GATEWAY_TOML}"; then + install -m 0644 "${OPENSHELL_PACKAGED_GATEWAY_TOML}" "${gateway_toml}" + else + printf '[openshell]\nversion = 2\n\n[openshell.gateway]\ncompute_driver = "podman"\n\n[openshell.drivers.podman]\nhealth_check_interval_secs = 10\n' > "${gateway_toml}" + fi + fi + + if grep -q '^[[:space:]]*supervisor_image[[:space:]]*=' "${gateway_toml}"; then + sed -i "s|^[[:space:]]*supervisor_image[[:space:]]*=.*|supervisor_image = \"${supervisor_image}\"|" "${gateway_toml}" + elif grep -q '^\[openshell\.drivers\.podman\]' "${gateway_toml}"; then + sed -i "/^\[openshell\.drivers\.podman\]/a supervisor_image = \"${supervisor_image}\"" "${gateway_toml}" + else + printf '\n[openshell.drivers.podman]\nsupervisor_image = "%s"\n' "${supervisor_image}" >> "${gateway_toml}" fi } @@ -360,8 +387,11 @@ install_openshell_at_version() { url="$(openshell_install_script_url "${sha}")" local max_attempts=3 attempt=1 delay=5 while true; do + # install.sh refuses a pre-0.1 -> 0.1 upgrade without the ack. The + # incompatible pre-0.1 gateway store is discarded by the caller's + # start_fresh_openshell_gateway (wipe_openshell_gateway_store). if curl -LsSf --retry 3 --retry-delay 5 "${url}" \ - | OPENSHELL_VERSION="v${ver}" sh; then + | OPENSHELL_ACK_BREAKING_UPGRADE=1 OPENSHELL_VERSION="v${ver}" sh; then break fi if [ "${attempt}" -ge "${max_attempts}" ]; then diff --git a/hack/gitlab-runner-vm/executor/gateway_test.sh b/hack/gitlab-runner-vm/executor/gateway_test.sh index ebe64c2126..d676477afd 100755 --- a/hack/gitlab-runner-vm/executor/gateway_test.sh +++ b/hack/gitlab-runner-vm/executor/gateway_test.sh @@ -16,6 +16,25 @@ fail() { FAILURES=$((FAILURES + 1)) } +# assert_v2_gateway_toml