mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
Fix Agent Teams CI coverage checks
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
+30
-27
@@ -254,38 +254,41 @@ describe('orca cli worktree awareness', () => {
|
||||
expect(logSpy).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('prepares and starts Claude Agent Teams in the current Orca terminal', async () => {
|
||||
process.env.ORCA_PANE_KEY = 'tab-1:11111111-1111-4111-8111-111111111111'
|
||||
queueFixtures(
|
||||
callMock,
|
||||
okFixture('req_agent_teams_prepare', {
|
||||
launch: {
|
||||
env: {
|
||||
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
||||
TMUX: '/tmp/orca-claude-agent-teams/team-1,0,1',
|
||||
TMUX_PANE: '%1',
|
||||
PATH: '/tmp/orca-shim:/usr/bin'
|
||||
it.skipIf(process.platform === 'win32')(
|
||||
'prepares and starts Claude Agent Teams in the current Orca terminal',
|
||||
async () => {
|
||||
process.env.ORCA_PANE_KEY = 'tab-1:11111111-1111-4111-8111-111111111111'
|
||||
queueFixtures(
|
||||
callMock,
|
||||
okFixture('req_agent_teams_prepare', {
|
||||
launch: {
|
||||
env: {
|
||||
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
||||
TMUX: '/tmp/orca-claude-agent-teams/team-1,0,1',
|
||||
TMUX_PANE: '%1',
|
||||
PATH: '/tmp/orca-shim:/usr/bin'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
await main(['claude-teams'], '/tmp/repo')
|
||||
await main(['claude-teams'], '/tmp/repo')
|
||||
|
||||
expect(callMock).toHaveBeenCalledWith('agentTeams.prepareLaunch', {
|
||||
paneKey: 'tab-1:11111111-1111-4111-8111-111111111111',
|
||||
env: expect.objectContaining({
|
||||
ORCA_PANE_KEY: 'tab-1:11111111-1111-4111-8111-111111111111'
|
||||
expect(callMock).toHaveBeenCalledWith('agentTeams.prepareLaunch', {
|
||||
paneKey: 'tab-1:11111111-1111-4111-8111-111111111111',
|
||||
env: expect.objectContaining({
|
||||
ORCA_PANE_KEY: 'tab-1:11111111-1111-4111-8111-111111111111'
|
||||
})
|
||||
})
|
||||
})
|
||||
expect(spawnMock).toHaveBeenCalledWith('claude', ['--teammate-mode', 'auto'], {
|
||||
stdio: 'inherit',
|
||||
env: expect.objectContaining({
|
||||
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
||||
TMUX_PANE: '%1'
|
||||
expect(spawnMock).toHaveBeenCalledWith('claude', ['--teammate-mode', 'auto'], {
|
||||
stdio: 'inherit',
|
||||
env: expect.objectContaining({
|
||||
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
||||
TMUX_PANE: '%1'
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
it('rejects remote `worktree current` without listing worktrees from client cwd', async () => {
|
||||
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
|
||||
|
||||
@@ -124,7 +124,10 @@ export function agentHasOrchestrationSkill(
|
||||
}
|
||||
|
||||
export function sortOrchestrationAgents(agents: readonly TuiAgent[]): TuiAgent[] {
|
||||
const order = new Map(TUI_AGENT_AUTO_PICK_ORDER.map((agent, index) => [agent, index]))
|
||||
const order = new Map<TuiAgent, number>()
|
||||
for (const [index, agent] of TUI_AGENT_AUTO_PICK_ORDER.entries()) {
|
||||
order.set(agent, index)
|
||||
}
|
||||
return [...agents].sort(
|
||||
(left, right) =>
|
||||
(order.get(left) ?? Number.MAX_SAFE_INTEGER) - (order.get(right) ?? Number.MAX_SAFE_INTEGER)
|
||||
|
||||
@@ -14,8 +14,11 @@ describe('pickQuickWorkspaceAgent', () => {
|
||||
|
||||
it('uses the first enabled catalog agent while detection is pending', () => {
|
||||
expect(pickQuickWorkspaceAgent(null, null, [])).toBe('claude')
|
||||
expect(pickQuickWorkspaceAgent(null, null, ['claude'])).toBe('openclaude')
|
||||
expect(pickQuickWorkspaceAgent(null, null, ['claude', 'openclaude'])).toBe('codex')
|
||||
expect(pickQuickWorkspaceAgent(null, null, ['claude'])).toBe('claude-agent-teams')
|
||||
expect(pickQuickWorkspaceAgent(null, null, ['claude', 'claude-agent-teams'])).toBe('openclaude')
|
||||
expect(
|
||||
pickQuickWorkspaceAgent(null, null, ['claude', 'claude-agent-teams', 'openclaude'])
|
||||
).toBe('codex')
|
||||
})
|
||||
|
||||
it('respects blank and disabled preferred agents', () => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { isTuiAgent } from './tui-agent-config'
|
||||
// automatic fallback priority when the user has not chosen a default agent.
|
||||
export const TUI_AGENT_AUTO_PICK_ORDER = [
|
||||
'claude',
|
||||
'claude-agent-teams',
|
||||
'openclaude',
|
||||
'codex',
|
||||
'grok',
|
||||
|
||||
Reference in New Issue
Block a user