mirror of
https://github.com/stablyai/orca.git
synced 2026-10-02 00:02:05 +00:00
Send OpenCode source-control prompts over stdin (#4859)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -331,6 +331,60 @@ describe('buildArgs (Codex)', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('buildArgs (OpenCode)', () => {
|
||||
const spec = getCommitMessageAgentSpec('opencode')!
|
||||
|
||||
it('runs `opencode run` without passing the prompt via argv', () => {
|
||||
const prompt = `PROMPT ${'x'.repeat(1024)}`
|
||||
const args = spec.buildArgs({
|
||||
prompt,
|
||||
model: 'opencode/deepseek-v4-flash-free'
|
||||
})
|
||||
|
||||
expect(args).toEqual([
|
||||
'run',
|
||||
'--model',
|
||||
'opencode/deepseek-v4-flash-free',
|
||||
'--agent',
|
||||
'build',
|
||||
'--format',
|
||||
'default'
|
||||
])
|
||||
expect(args).not.toContain(prompt)
|
||||
expect(args).not.toContain('')
|
||||
expect(spec.promptDelivery).toBe('stdin')
|
||||
})
|
||||
|
||||
it('emits --variant <level> when thinking level is supplied', () => {
|
||||
const args = spec.buildArgs({
|
||||
prompt: 'PROMPT',
|
||||
model: 'opencode/gpt-5.4-mini',
|
||||
thinkingLevel: 'high'
|
||||
})
|
||||
|
||||
expect(args).toEqual([
|
||||
'run',
|
||||
'--model',
|
||||
'opencode/gpt-5.4-mini',
|
||||
'--agent',
|
||||
'build',
|
||||
'--format',
|
||||
'default',
|
||||
'--variant',
|
||||
'high'
|
||||
])
|
||||
})
|
||||
|
||||
it('omits --variant when no thinking level is supplied', () => {
|
||||
const args = spec.buildArgs({
|
||||
prompt: 'PROMPT',
|
||||
model: 'opencode/gpt-5.4-mini'
|
||||
})
|
||||
|
||||
expect(args).not.toContain('--variant')
|
||||
})
|
||||
})
|
||||
|
||||
describe('buildArgs (Antigravity)', () => {
|
||||
const spec = getCommitMessageAgentSpec('antigravity')!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user