Skip to content

Fix: Remove AMICO_PYTHON from SANDBOX_ENV_PASSTHROUGH - #294

Merged
Rchari1 merged 1 commit into
mainfrom
fix/amico-python-passthrough
Aug 8, 2026
Merged

Fix: Remove AMICO_PYTHON from SANDBOX_ENV_PASSTHROUGH#294
Rchari1 merged 1 commit into
mainfrom
fix/amico-python-passthrough

Conversation

@Rchari1

@Rchari1 Rchari1 commented Aug 8, 2026

Copy link
Copy Markdown
Member

Problem

The tests in test/server_auth.test.ts were failing because AMICO_PYTHON was incorrectly included in SANDBOX_ENV_PASSTHROUGH. This caused it to be passed through from process.env even when opts.amicoPython was not set, violating the contract that AMICO_PYTHON should only be present in the spawn environment when explicitly provided via opts.

Changes

  • Removed AMICO_PYTHON from SANDBOX_ENV_PASSTHROUGH array in src/server_auth.ts

Rationale

AMICO_PYTHON is already handled explicitly in the code at line 223:

...(opts.amicoPython ? { AMICO_PYTHON: opts.amicoPython } : {}),

The passthrough mechanism is meant for sandboxing-related env vars (like AMICO_CLOUD_FILE, AMICO_PASQAL_FILE, etc.), not for parameters that are already explicitly handled. Including it in both places caused the tests to fail when AMICO_PYTHON is set in the host environment.

Test Results

All 905 tests now pass (3 skipped, which were already skipped before).

Fixes the following test failures:

  • 'adds EXACTLY PATH + config + password + the headless plot backends (AC1)'
  • 'carries AMICO_PYTHON iff amicoPython is set'
  • 'no telemetry opt at all → identical to the pre-telemetry builder'

AMICO_PYTHON was incorrectly included in SANDBOX_ENV_PASSTHROUGH, causing it
to be passed through from process.env even when opts.amicoPython was not set.
This violated the contract that AMICO_PYTHON should only be present in the
spawn environment when explicitly provided via opts.

The variable is already handled explicitly at line 223:
  ...(opts.amicoPython ? { AMICO_PYTHON: opts.amicoPython } : {}),

Removing it from the passthrough list ensures the behavior matches test
expectations and prevents host environment pollution.

Fixes test failures:
- 'adds EXACTLY PATH + config + password + the headless plot backends (AC1)'
- 'carries AMICO_PYTHON iff amicoPython is set'
- 'no telemetry opt at all → identical to the pre-telemetry builder'
@Rchari1
Rchari1 merged commit 4ba70ed into main Aug 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant