aws / aws/bedrock-agentcore-sdk-python

[FEATURE] Support offline custom dependencies for Code Interpreter sessions

Aperta
#657 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
761
Fork
147
Merge medio
1g 23h
PR unite (30g)
7

Descrizione

**Is your feature request related to a problem? Please describe.**

AgentCore Code Interpreter provides a fixed set of pre-installed libraries. The
SDK's `install_packages()` helper runs a normal `pip install`, which requires
access to PyPI or another package index.

Code Interpreter sessions running in an isolated VPC without NAT cannot use
this mechanism. Enabling public internet access solely to install dependencies
increases cost and weakens the sandbox's network isolation.

Code Interpreter supports mounting S3 Files and EFS through
`filesystemConfigurations`, but there is no first-class way to declare an
offline dependency bundle or initialization step. Applications must currently:

1. Mount or upload a wheelhouse.
2. Execute `pip install --no-index` manually after every session starts.
3. Configure `sys.path` and `PYTHONPATH` separately for `executeCode` and
`executeCommand`.
4. Detect initialization failures themselves before allowing agent code to run.

This creates duplicated bootstrap logic and makes session readiness ambiguous.

**Describe the solution you'd like**

Add first-class support for application-defined, offline dependencies when
creating a Code Interpreter or starting a session.

One possible API shape would be:

```python
client.start(
identifier=interpreter_id,
filesystem_configurations=[dependency_mount],
dependency_configuration={
"python": {
"requirementsPath": "/mnt/dependencies/requirements.txt",
"wheelhousePath": "/mnt/dependencies/wheels",
"offline": True,
}
},
)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal percorso di creazione delle sessioni di Code Interpreter e dall’helper install_packages() dell’SDK, quindi confronta come filesystemConfigurations viene passato alle sessioni. Il lavoro è completato quando le applicazioni possono dichiarare una configurazione delle dipendenze offline, le sessioni la inizializzano senza accesso agli indici pubblici dei pacchetti e gli errori di inizializzazione vengono segnalati prima dell’esecuzione del codice dell’agente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.