mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 16:02:37 +00:00
fix(opencode): submit admitted native startup briefs without overwriting input (#24762)
* fix: wait for OpenCode worker composer before first dispatch Reuse captured composer readiness on local and paired execution hosts and revoke launching-shell paste anchors. Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> * feat(opencode): probe execution-host CLI capabilities * fix(opencode): select plugin default for execution host loader * fix(opencode): limit prompt prefill capability to verified release * feat(opencode): probe launch capabilities on the execution host * fix(opencode): select plugin loader for the launched host binary * fix(opencode): match WSL probe cwd and declared guest environment * fix(opencode): preserve launch environment deletion boundaries * wip(opencode): authorize native startup prompt intent at execution owner * fix(opencode): atomically replace status plugin entrypoints * fix(opencode): retain plugin permissions across restrictive umasks * test(opencode): resolve permission fixture from primary cwd * feat(opencode): install startup prompt plugin independently of status hooks * fix(opencode): wait for admitted startup intent and preserve failed-launch briefs * fix(opencode): unsubscribe hook settings during async host shutdown * STRICT launch CI contract correction * CAPS launch CI contract correction * INTENT launch CI contract correction * test: initialize Claude prompt state in output retention fixture * Wait for OpenCode location hydration in intent startup * Bind OpenCode startup readiness to the current location in intent startup * Retry interrupted OpenCode startup prompt claims --------- Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Co-authored-by: Ahmed Nagy <ahmednagy25t@gmail.com> Co-authored-by: Orca startup hydration review <agents@stably.ai> Co-authored-by: Orca <dev@stably.ai>
This commit is contained in:
co-authored by
Brennan Benson
Ahmed Nagy
Orca startup hydration review
Orca
parent
58bd15fa3f
commit
e8310d5a4f
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { tokenizeStartupCommand } from './tui-agent-startup-shell'
|
||||
import { tokenizeCommandLine } from './agent-command-line-entrypoint'
|
||||
import { isOpenCodeRunCommand } from './opencode-headless-command'
|
||||
|
||||
@@ -24,3 +25,66 @@ describe('isOpenCodeRunCommand', () => {
|
||||
expect(matches('opencode --log-level run')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('wrapped OpenCode run command position', () => {
|
||||
it.each([
|
||||
'CUSTOM_CONFIG=private opencode --log-level debug run --standalone',
|
||||
'env CUSTOM_CONFIG=private opencode run --standalone',
|
||||
'CUSTOM_CONFIG=private /usr/bin/env -- EXTRA_CONFIG=kept opencode run --standalone'
|
||||
])('recognizes only the executable behind supported POSIX prefixes: %s', (command) => {
|
||||
expect(matches(command)).toBe(true)
|
||||
})
|
||||
|
||||
it('recognizes a PowerShell call operator before a quoted executable', () => {
|
||||
const parsed = tokenizeStartupCommand(
|
||||
'& "C:\\Program Files\\opencode\\opencode.exe" run --standalone',
|
||||
'powershell'
|
||||
)
|
||||
expect(parsed.ok).toBe(true)
|
||||
if (!parsed.ok) {
|
||||
throw new Error(parsed.error)
|
||||
}
|
||||
expect(isOpenCodeRunCommand(parsed.tokens, 'powershell')).toBe(true)
|
||||
expect(isOpenCodeRunCommand(parsed.tokens, 'cmd')).toBe(false)
|
||||
})
|
||||
|
||||
it.each([
|
||||
'env -u FOO opencode run',
|
||||
'env -uFOO opencode run',
|
||||
'env --unset FOO opencode run',
|
||||
'env --unset=FOO opencode run',
|
||||
'env -i PRIVATE_CONFIG=kept opencode run',
|
||||
'env --ignore-environment PRIVATE_CONFIG=kept opencode run',
|
||||
'env - PRIVATE_CONFIG=kept opencode run',
|
||||
'env -C /workspace opencode run',
|
||||
'env -C/workspace opencode run',
|
||||
'env --chdir /workspace opencode run',
|
||||
'env --chdir=/workspace opencode run',
|
||||
'env -P /private/bin opencode run',
|
||||
'env -P/private/bin opencode run',
|
||||
'CONFIG=kept /usr/bin/env -i -u FOO -C /workspace -- OTHER=kept opencode run'
|
||||
])('recognizes an executable after env options: %s', (command) => {
|
||||
expect(matches(command)).toBe(true)
|
||||
})
|
||||
|
||||
it.each([
|
||||
'env -u',
|
||||
'env -C',
|
||||
'env -u opencode run',
|
||||
'env -C opencode run',
|
||||
'env -u FOO echo opencode run',
|
||||
'env --unset=FOO echo run',
|
||||
'env -S "opencode run"',
|
||||
'env --unknown opencode run'
|
||||
])('does not mistake env option arguments for the executable: %s', (command) => {
|
||||
expect(matches(command)).toBe(false)
|
||||
})
|
||||
|
||||
it('does not find executable names inside other commands or prompt arguments', () => {
|
||||
expect(matches('env CUSTOM_CONFIG=private echo opencode run')).toBe(false)
|
||||
expect(matches('env CUSTOM_CONFIG=private echo run')).toBe(false)
|
||||
expect(matches('CUSTOM_CONFIG=private opencode --prompt "opencode run"')).toBe(false)
|
||||
expect(matches('env -- opencode serve --title run')).toBe(false)
|
||||
expect(matches('opencode attach http://host/run')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user