You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 459fb3f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(opencode): optionally pass the prompt to opencode run verbatim
`opencode run` wraps every message argument that contains a space in
double quotes and escapes inner quotes (anomalyco/opencode#43923), so
opencode_sandboxed_agent and the local CLI path of opencode_agent deliver
`"<prompt>"`, with each `"` as `\"`, instead of the task prompt. A new
`verbatim_prompt` flag on both sends the prompt on stdin instead, which
`opencode run` uses unchanged, as opencode_agent sandbox sessions already
do. It defaults to false, leaving the launched command and every existing
workflow exactly as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: i-vainn <[email protected]>
Copy file name to clipboardExpand all lines: responses_api_agents/opencode_sandboxed_agent/README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,14 @@ checksum before use. Gym uploads it through the sandbox file API and installs it
47
47
alongside OpenCode before execution; no sandbox internet access or root package
48
48
installation is needed. The default is `null`, preserving existing behavior.
49
49
50
+
## Verbatim prompts
51
+
52
+
By default the prompt is the last `opencode run` argument. `opencode run` wraps an argument containing
53
+
spaces in double quotes and escapes inner quotes ([anomalyco/opencode#43923](https://github.com/anomalyco/opencode/issues/43923)),
54
+
so the model sees `"<prompt>"` with every `"` as `\"`. Set `verbatim_prompt: true` to upload the prompt to the
55
+
sandbox and pass it on stdin, which `opencode run` uses unchanged. It is off by default because it changes the
56
+
model's input: results are not comparable with runs made without it.
57
+
50
58
## Offline scientific evaluation with OpenCode or Pi
51
59
52
60
The dedicated `opencode_sandboxed_agent` and `pi_sandboxed_agent` run their native
"Send the task prompt to `opencode run` on stdin instead of as a command-line argument. "
442
+
"OpenCode wraps an argument containing spaces in double quotes and escapes inner quotes "
443
+
"(anomalyco/opencode#43923), so the model otherwise sees an altered prompt. Off by default "
444
+
"so existing results stay comparable."
445
+
),
446
+
)
437
447
438
448
# Sandbox config
439
449
sandbox_provider: str
@@ -860,6 +870,12 @@ async def responses(
860
870
# and there is no way to set it to null.
861
871
# Here, we set an exorbitantly high number that cannot ever be reached.
862
872
# In future versions of OpenCode, this can be directly passed via maxOutputTokens in the limit config above https://github.com/anomalyco/opencode/blob/1b18a50418f730aca32630ccfcde850f2b5fc360/packages/opencode/src/provider/transform.ts#L1418
0 commit comments