Skip to content

Daniel/opencode envs#996

Draft
rasdani wants to merge 113 commits intoopencode-envsfrom
daniel/opencode-envs
Draft

Daniel/opencode envs#996
rasdani wants to merge 113 commits intoopencode-envsfrom
daniel/opencode-envs

Conversation

@rasdani
Copy link
Copy Markdown
Contributor

@rasdani rasdani commented Mar 7, 2026

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

@mikasenghaas mikasenghaas force-pushed the opencode-envs branch 4 times, most recently from c0f44e2 to 3e9ab2e Compare March 19, 2026 23:17
mikasenghaas and others added 11 commits March 20, 2026 22:57
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- normalize_intercepted_tools: avoid redundant model_dump -> model_validate
  round-trip for Tool objects already in the right type. Construct Tool
  directly for OpenAI-format dicts instead of going through _normalize_tool_defs.
- Cache normalized tool_defs per rollout in state — agents send the same
  tool definitions on every request, so we only normalize once.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use aiolimiter.AsyncLimiter (token-bucket) in create_sandbox() via new
sandbox_creation_rate_limit parameter (creations per minute).

When set, create_sandbox() throttles to avoid burst-loading the sandbox
API at high concurrency. Disabled by default (None).

Exposed as a parameter in CliAgentEnv.__init__ for easy configuration
from eval configs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous cache blindly reused the first normalized tool_defs without
checking if the agent sent different definitions on subsequent requests.
Key on len(intercept_tools) as a cheap invalidation check — a false miss
just re-normalizes (idempotent), but avoids silently using stale defs
when the tool set changes mid-rollout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…opencode normalize_response

- Rename sandbox_creation_rate_limit -> sandbox_creations_per_minute for clarity
- Make normalize_response async in cli_agent_env base class
- Comment out opencode_env normalize_response override (disabled for now)
- Import reordering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikasenghaas mikasenghaas force-pushed the opencode-envs branch 2 times, most recently from cd6c2f5 to 0db45e6 Compare March 25, 2026 18:45
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