Skip to content

fix(wti): require self-contained code imports - #186

Open
OllieinCanada wants to merge 1 commit into
VectorInstitute:mainfrom
OllieinCanada:agent/181-json-import-guidance
Open

fix(wti): require self-contained code imports#186
OllieinCanada wants to merge 1 commit into
VectorInstitute:mainfrom
OllieinCanada:agent/181-json-import-guidance

Conversation

@OllieinCanada

Copy link
Copy Markdown

Fixes #181

Summary

Require every WTI run_code call to include its own imports, including import json whenever it uses json.dumps.

Sandbox executions are isolated, so an import from an earlier call is not available to a later script. This prompt-level guard prevents the analyst agent from failing during JSON serialization without changing runtime architecture.

Tests

  • Added a focused configuration test for the generated WTI code-execution instruction
  • pytest implementations/tests/energy_oil_forecasting/test_analyst_agent.py -q (1 passed)
  • Ruff check and format check pass on the changed Python files
  • git diff --check passes

This PR was prepared with AI assistance and manually reviewed.

Signed-off-by: Oliver Slapinski <olliefromcanada@gmail.com>
@OllieinCanada
OllieinCanada marked this pull request as ready for review August 20, 2026 02:50
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.

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

1 participant