Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: Python Code Interpreter Result drops non-standard MIME types instead of collecting them into extra

Open Beginner friendly
#1,984 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lemonzoey is already working on this.

Since Oct 15, 2026.

  • #1985 by @lemonzoey — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
devtools

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

bug Code Interpreter python sdk
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), current main
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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from e2b-dev/E2B

All issues in e2b-dev/E2B

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.