[Bug]: Python Code Interpreter Result drops non-standard MIME types instead of collecting them into extra
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start in e2b_code_interpreter/models.py, at Result.__init__, where **kwargs is accepted but never assigned to extra. Run the reproduction script from the issue to confirm extra is None. Compare with the JS SDK's Result constructor, which collects unknown MIME keys. Done when extra holds the non-standard payload, formats() lists it, and Execution.to_json() includes it.
Written by the indexing model from the issue text.
Description
Describe the bug
Result in the Python Code Interpreter SDK (e2b_code_interpreter/models.py) declares an extra field for data "not part of the standard types", but __init__ drops unknown keys from the kernel message via **kwargs instead of collecting them into extra. Non-standard MIME types the IPython kernel sends — e.g. application/vnd.plotly.v1+json, application/vnd.bokeh+json, application/vnd.vega.v5+json — are silently lost. The JS SDK's Result constructor already sweeps these into extra.
To reproduce
import json
from e2b_code_interpreter.models import Execution, parse_output
execution = Execution()
parse_output(execution, json.dumps({
"type": "result",
"is_main_result": True,
"text": "hello",
"application/vnd.plotly.v1+json": {"data": [{"x": [1, 2]}]},
}))
result = execution.results[0]
print(result.extra) # None — the plotly payload is dropped
print(list(result.formats())) # ['text'] — the custom MIME is missing
print(execution.to_json()) # extra is absent from the serialized output
For comparison, the JS SDK's Result collects the same key into extra, lists it in formats(), and includes it in toJSON().
Expected behavior
result.extra holds the non-standard MIME payload, formats() lists the custom MIME type, and Execution.to_json() preserves it — matching the JS SDK.
Actual behavior
The non-standard MIME type is dropped at construction, so extra is None, formats() omits it, and to_json() loses the data.
Environment
- SDK:
e2b-code-interpreter(Python), currentmain
Additional context
The extra field is documented as "Extra data that can be included. Not part of the standard types." — the intent is to retain these, but __init__ never assigns **kwargs to it. IPython display data commonly carries non-standard MIME types for interactive plots, so this loses real user data.
This is the Python side of the Result serialization surface and is separate from the open cluster: #1939/#1971 (data in toJSON), #1948 (chart in toJSON), #1826/#1893 (chart deserialization). None touch Python Result.__init__'s extra collection.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 1.1k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from e2b-dev/E2B
-
[Bug]: JS SDK: passing `logger` makes every API call fail on Node with "onResponse: must return new Response() when modifying the response"Possibly taken @KarlFredrikssonEthira claimed this 10 days ago. Openbug sdk
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
e2b-dev/E2B#1986 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: JS Code Interpreter Result.formats() omits text and chartPossibly taken @lemonzoey claimed this 11 days ago. Openbug Code Interpreter sdk
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
e2b-dev/E2B#1981 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: Code Interpreter JSON serialization drops Result.dataPossibly taken @pei711 claimed this 22 days ago. Openbug Code Interpreter sdk
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
e2b-dev/E2B#1938 · 2 comments ·
Maintainers usually reply within 1 day
-
JS chart deserializer keeps unrecognized x_scale and y_scalePossibly taken @claxman claimed this 48 days ago. Openbug Code Interpreter javascript sdk
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
e2b-dev/E2B#1839 · 2 comments ·
Maintainers usually reply within 1 day
-
Python chart deserializer raises ValueError for an unrecognized chart typePossibly taken @claxman claimed this 48 days ago. Openbug Code Interpreter sdk
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
e2b-dev/E2B#1834 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkPossibly taken @ocelotl claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cuga-project/cuga-agent#1020 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
microsoft/playwright#43640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day