Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions packages/cli/src/gemini.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,25 +541,37 @@ describe('gemini.tsx main function', () => {
// only daemon-stamped children (QWEN_CODE_SERVE) scrub, direct editor ACP
// integrations and non-ACP launches keep their own loader vars.
it.each([
['scrubs for a daemon-spawned child', { acp: true } as CliArgs, true, true],
['scrubs for a daemon-spawned child', { acp: true } as CliArgs, '1', true],
[
'keeps for a direct (editor) ACP child',
{ acp: true } as CliArgs,
undefined,
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
false,
],
[
'keeps when the daemon marker is zero',
{ acp: true } as CliArgs,
'0',
false,
],
[
'keeps when the daemon marker is false',
{ acp: true } as CliArgs,
'false',
false,
],
['keeps for a non-ACP launch', {} as CliArgs, false, false],
['keeps for a non-ACP launch', {} as CliArgs, undefined, false],
])(
'inherited loader env vars past the ACP handoff (%s)',
async (_mode, argv, daemonStamped, expectScrubbed) => {
async (_mode, argv, daemonMarker, expectScrubbed) => {
vi.stubEnv(
'NODE_OPTIONS',
'--import file:///other-checkout/register.mjs',
);
vi.stubEnv('NODE_PATH', '/other-checkout/node_modules');
vi.stubEnv('QWEN_CODE_NO_RELAUNCH', 'true');
if (daemonStamped) {
vi.stubEnv('QWEN_CODE_SERVE', '1');
if (daemonMarker !== undefined) {
vi.stubEnv('QWEN_CODE_SERVE', daemonMarker);
}
Comment thread
yiliang114 marked this conversation as resolved.
Resolved

const { parseArguments, loadCliConfig } = await import(
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/gemini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export async function main() {
}
}

if (isAcpMode && process.env[QWEN_CODE_SERVE_ENV]) {
if (isAcpMode && process.env[QWEN_CODE_SERVE_ENV] === '1') {
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
// A daemon-spawned ACP child hosts sessions for arbitrary workspaces.
// Loader vars from the daemon's launch environment were only needed to
// boot this process (e.g. the dev harness tsx loader); left in
Expand Down
Loading