Send OpenCode source-control prompts over stdin (#4859)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-06-07 21:00:20 -07:00
committed by GitHub
co-authored by Orca
parent 4a3db11e16
commit bed394ca11
4 changed files with 197 additions and 8 deletions
+33 -4
View File
@@ -33,7 +33,7 @@ describe('planCommitMessageGeneration', () => {
})
})
it('plans OpenCode run with prompt in argv and model variant', () => {
it('plans OpenCode run with prompt on stdin and model variant', () => {
const result = planCommitMessageGeneration(
{
agentId: 'opencode',
@@ -56,10 +56,39 @@ describe('planCommitMessageGeneration', () => {
'--format',
'default',
'--variant',
'high',
'PROMPT'
'high'
],
stdinPayload: null,
stdinPayload: 'PROMPT',
label: 'OpenCode'
}
})
})
it('keeps OpenCode preset command overrides while sending the prompt on stdin', () => {
const result = planCommitMessageGeneration(
{
agentId: 'opencode',
model: 'opencode/gpt-5.4-mini',
agentCommandOverride: 'npx opencode'
},
'PROMPT'
)
expect(result).toEqual({
ok: true,
plan: {
binary: 'npx',
args: [
'opencode',
'run',
'--model',
'opencode/gpt-5.4-mini',
'--agent',
'build',
'--format',
'default'
],
stdinPayload: 'PROMPT',
label: 'OpenCode'
}
})