fix: revert opencode_env config regression and move RLM logic out of cli_agent_env#1042
Merged
mikasenghaas merged 2 commits intomainfrom Mar 19, 2026
Merged
Conversation
…cli_agent_env Revert opencode_env.py config builder to use shell variable expansion instead of hardcoded "intercepted/model" (regression from #1023). Move is_sub_llm_call-aware first-turn prompt check from CliAgentEnv into OpenCodeRLMEnv where it belongs, restoring the simple len(trajectory)==0 check in the base class. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…de config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
snimu
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opencode_env.pyconfig builder to use shell variable expansion (${OPENAI_MODEL%%/*}etc.) instead of hardcoded"intercepted/model"to include the correct model name in the native oc system prompt — regression from opencode_rlm_env #1023is_sub_llm_call-aware first-turn prompt check fromCliAgentEnv.add_model_responseintoOpenCodeRLMEnv, restoring the simplelen(trajectory) == 0check in the base classOpenCodeRLMEnv.add_model_responseusessuper(CliAgentEnv, self)to skip the base class check and callMultiTurnEnvdirectly🤖 Generated with Claude Code
Note
Medium Risk
Changes how OpenCode model/provider config is generated and how first-turn prompts are recorded when sub-LLM calls occur, which can affect model selection and trajectory/prompt correctness during rollouts.
Overview
Fixes an OpenCode config regression by switching
build_opencode_configback to shell-expandedOPENAI_MODELparsing so the generated config uses the real provider/model ($OPENAI_MODEL,${OPENAI_MODEL%%/*},${OPENAI_MODEL##*/}) instead of a hardcodedintercepted/model.Moves the sub-LLM aware “first main turn” prompt update logic out of
CliAgentEnv.add_model_responseintoOpenCodeRLMEnv.add_model_response, ensuringstate["prompt"]is set based on the first non-sub call while keeping the base CLI env’s first-turn check simple.Updates tests to validate the rendered config after shell expansion (provider key, model name, and baseURL) using an explicit
OPENAI_MODEL=myprovider/mymodel.Written by Cursor Bugbot for commit b38775c. This will update automatically on new commits. Configure here.