From e54eecca51cbc3b55ca27e2aa9900ea96e37a54e Mon Sep 17 00:00:00 2001
From: Gal Zahavi <38544478+galz10@users.noreply.github.com>
Date: Thu, 2 Apr 2026 22:22:21 -0700
Subject: [PATCH] feat(cli): minimalist sandbox status labels (#24582)
---
.../cli/src/ui/components/Footer.test.tsx | 27 ++++++++++++++++---
packages/cli/src/ui/components/Footer.tsx | 24 ++++++-----------
2 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx
index e21db7940b..8c62434e61 100644
--- a/packages/cli/src/ui/components/Footer.test.tsx
+++ b/packages/cli/src/ui/components/Footer.test.tsx
@@ -81,6 +81,7 @@ const mockConfigPlain = {
isTrustedFolder: () => true,
getExtensionRegistryURI: () => undefined,
getContentGeneratorConfig: () => ({ authType: undefined }),
+ getSandboxEnabled: () => false,
};
const mockConfig = mockConfigPlain as unknown as Config;
@@ -364,7 +365,7 @@ describe('', () => {
unmount();
});
- it('should display custom sandbox info when SANDBOX env is set', async () => {
+ it('should display "current process" for custom sandbox when SANDBOX env is set', async () => {
vi.stubEnv('SANDBOX', 'gemini-cli-test-sandbox');
const { lastFrame, unmount } = await renderWithProviders(, {
config: mockConfig,
@@ -374,12 +375,12 @@ describe('', () => {
sessionStats: mockSessionStats,
},
});
- expect(lastFrame()).toContain('test');
+ expect(lastFrame()).toContain('current process');
vi.unstubAllEnvs();
unmount();
});
- it('should display macOS Seatbelt info when SANDBOX is sandbox-exec', async () => {
+ it('should display "current process" for macOS Seatbelt when SANDBOX is sandbox-exec', async () => {
vi.stubEnv('SANDBOX', 'sandbox-exec');
vi.stubEnv('SEATBELT_PROFILE', 'test-profile');
const { lastFrame, unmount } = await renderWithProviders(, {
@@ -387,7 +388,7 @@ describe('', () => {
width: 120,
uiState: { isTrustedFolder: true, sessionStats: mockSessionStats },
});
- expect(lastFrame()).toMatch(/macOS Seatbelt.*\(test-profile\)/s);
+ expect(lastFrame()).toContain('current process');
vi.unstubAllEnvs();
unmount();
});
@@ -405,6 +406,24 @@ describe('', () => {
unmount();
});
+ it('should display "all tools" when tool sandboxing is enabled and agent is local', async () => {
+ vi.stubEnv('SANDBOX', '');
+ const { lastFrame, unmount } = await renderWithProviders(, {
+ config: Object.assign(
+ Object.create(Object.getPrototypeOf(mockConfig)),
+ mockConfig,
+ {
+ getSandboxEnabled: () => true,
+ },
+ ),
+ width: 120,
+ uiState: { isTrustedFolder: true, sessionStats: mockSessionStats },
+ });
+ expect(lastFrame()).toContain('all tools');
+ vi.unstubAllEnvs();
+ unmount();
+ });
+
it('should prioritize untrusted message over sandbox info', async () => {
vi.stubEnv('SANDBOX', 'gemini-cli-test-sandbox');
const { lastFrame, unmount } = await renderWithProviders(, {
diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx
index 4bc868fb04..6719ae7c82 100644
--- a/packages/cli/src/ui/components/Footer.tsx
+++ b/packages/cli/src/ui/components/Footer.tsx
@@ -67,26 +67,19 @@ interface SandboxIndicatorProps {
const SandboxIndicator: React.FC = ({
isTrustedFolder,
}) => {
+ const config = useConfig();
+ const sandboxEnabled = config.getSandboxEnabled();
if (isTrustedFolder === false) {
return untrusted;
}
const sandbox = process.env['SANDBOX'];
- if (sandbox && sandbox !== 'sandbox-exec') {
- return (
- {sandbox.replace(/^gemini-(?:cli-)?/, '')}
- );
+ if (sandbox) {
+ return current process;
}
- if (sandbox === 'sandbox-exec') {
- return (
-
- macOS Seatbelt{' '}
-
- ({process.env['SEATBELT_PROFILE']})
-
-
- );
+ if (sandboxEnabled) {
+ return all tools;
}
return no sandbox;
@@ -311,9 +304,8 @@ export const Footer: React.FC = () => {
let str = 'no sandbox';
const sandbox = process.env['SANDBOX'];
if (isTrustedFolder === false) str = 'untrusted';
- else if (sandbox === 'sandbox-exec')
- str = `macOS Seatbelt (${process.env['SEATBELT_PROFILE']})`;
- else if (sandbox) str = sandbox.replace(/^gemini-(?:cli-)?/, '');
+ else if (sandbox) str = 'current process';
+ else if (config.getSandboxEnabled()) str = 'all tools';
addCol(
id,