Skip to content

fix: surface top-level metadata on StepResult in typed env clients - #812

Merged
burtenshaw merged 3 commits into
mainfrom
fix/stepresult-metadata-typed-clients
Jun 16, 2026
Merged

fix: surface top-level metadata on StepResult in typed env clients#812
burtenshaw merged 3 commits into
mainfrom
fix/stepresult-metadata-typed-clients

Conversation

@sergiopaniego

Copy link
Copy Markdown
Member

Summary

Follow-up to #805. That PR surfaced a top-level metadata field on StepResult and updated the generic, MCP, and template clients, but the 20 typed env clients (envs/*/client.py) still built StepResult
without it, so result.metadata was None even when the observation carried metadata. This applies the same pattern to every typed client's _parse_result.

Type of Change

  • Bug fix

Alignment Checklist

Before submitting, verify:

  • I have read .claude/docs/PRINCIPLES.md and this PR aligns with our principles
  • I have checked .claude/docs/INVARIANTS.md and no invariants are violated
  • I have run /pre-submit-pr (or bash .claude/hooks/lint.sh and tests) and addressed all issues

RFC Status

  • Not required (bug fix, docs, minor refactoring)

Test Plan

Each _parse_result now mirrors the pattern merged in #805:

  • metadata=payload.get("metadata", obs_data.get("metadata", {})) on the Observation
  • metadata=payload.get("metadata") on the returned StepResult

Backwards compatible: when the server sends no top-level metadata (older servers), it falls back to the nested observation.metadata, so existing behavior is unchanged. Verified all 20 files compile and pass
ruff format. Affected envs: atari, browsergym, chat, chess, calendar, connect4, finrl, dm_control, maze, openapp, reasoning_gym, kernrl, snake, repl, tbench2, openspiel, textarena, websearch, sumo_rl, unity.

Claude Code Review

N/A

@sergiopaniego
sergiopaniego requested a review from burtenshaw June 16, 2026 10:11
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@burtenshaw
burtenshaw merged commit 6f4c1d8 into main Jun 16, 2026
8 checks passed
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.

2 participants