Skip to content

WTI code-executing agent may omit json import before serializing results #181

Description

@mbrotos

Summary

The WTI code-executing agent generated a sandbox script that called json.dumps(results) without first importing json.

Reproduction

Run Step 4 of implementations/energy_oil_forecasting/02_intro_agentic_predictor.ipynb. A successful forecast run emitted:

NameError: name 'json' is not defined\n```\n\nThe final structured forecast was still returned, but the sandbox code execution reported an avoidable error.\n\n## Expected\n\nGenerated code should include all required imports.\n\n## Possible fix\n\nAdd an explicit instruction/example to import `json` whenever generated code serializes output with `json.dumps`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions