skills: prefer agent-first worktree launch; avoid empty shell tabs (#7957)
* skills: prefer agent-first worktree launch; avoid empty shell tabs Document Orca's first-terminal behavior so agents do not leave dead shell tabs: --agent runs in the first terminal (one tab), bare worktree create + terminal create leaves shell + agent (two tabs). Also: re-resolve live handles via terminal list after create, message one handle only, and prefer orchestration check --inject over terminal send for pure orchestration pings. Aligns with CLI docs (--agent launches the selected agent in the first terminal). * fix skill guidance for agent-first worktrees --------- Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
This commit is contained in:
@@ -45,6 +45,28 @@ describe('orca CLI skill guidance', () => {
|
||||
expect(skill).toContain('send the prompt, and stop')
|
||||
})
|
||||
|
||||
it('prefers agent-first workers without duplicating terminal delivery', () => {
|
||||
const skill = readSkill()
|
||||
|
||||
expect(skill).toContain('Prefer agent-first create for agent workers')
|
||||
expect(skill).toContain('fallback shell plus a later `terminal create')
|
||||
expect(skill).toContain('Repo setup or default-terminal settings may still add tabs or splits')
|
||||
expect(skill).toContain(
|
||||
'when no repo default-terminal configuration supplies a primary terminal'
|
||||
)
|
||||
expect(skill).toContain('Configured default tabs are materialized instead')
|
||||
expect(skill).toContain(
|
||||
'only after `terminal list` or `terminal show` confirms it is an unused shell'
|
||||
)
|
||||
expect(skill).not.toContain('bare `worktree create` (no `--agent`) still opens')
|
||||
expect(skill).not.toContain('ends with **one** tab')
|
||||
expect(skill).toContain('Use `startupTerminal.handle` as the sole agent handle')
|
||||
expect(skill).toContain('never dual-send to old and replacement handles')
|
||||
expect(skill).toContain(
|
||||
"this checks the caller's inbox and does not remotely deliver input to another terminal"
|
||||
)
|
||||
})
|
||||
|
||||
it('keeps browser injection guidance narrow and avoids literal secret examples', () => {
|
||||
const skill = readSkill()
|
||||
|
||||
|
||||
@@ -188,4 +188,34 @@ describe('orchestration skill guidance', () => {
|
||||
expect(skill).not.toContain('post-completion polling messages')
|
||||
expect(skill).not.toContain('every 2 minutes')
|
||||
})
|
||||
|
||||
it('keeps agent-first launch, handle recovery, and inbox injection distinct', () => {
|
||||
const skill = readSkill()
|
||||
const messaging = getSection(skill, 'Messaging')
|
||||
const workerTerminals = getSection(skill, 'Worker Terminals')
|
||||
const agentFirstExample = workerTerminals.match(
|
||||
/```bash\norca worktree create --name <task-name> --agent codex --json\n[\s\S]*?```/
|
||||
)?.[0]
|
||||
|
||||
expect(workerTerminals).toContain('Agent-first (required for ordinary agent workers)')
|
||||
expect(workerTerminals).toContain('fallback shell + agent pair')
|
||||
expect(workerTerminals).toContain(
|
||||
'Repo setup or default-terminal settings may still add tabs or splits'
|
||||
)
|
||||
expect(workerTerminals).toContain('without configured default tabs')
|
||||
expect(workerTerminals).toContain(
|
||||
'only after `terminal list` or `terminal show` confirms it is an unused shell'
|
||||
)
|
||||
expect(workerTerminals).not.toContain('bare create opens a default shell')
|
||||
expect(workerTerminals).not.toContain('ends with **one** agent tab')
|
||||
expect(agentFirstExample).toBeDefined()
|
||||
expect(agentFirstExample).not.toContain('orca terminal list')
|
||||
expect(agentFirstExample).toContain('startupTerminal.handle')
|
||||
expect(messaging).toContain(
|
||||
'Use `startupTerminal.handle` from the create response when present'
|
||||
)
|
||||
expect(messaging).toContain('continue with the replacement only')
|
||||
expect(messaging).toContain('it does not remotely wake another terminal')
|
||||
expect(messaging).toContain('Use `orchestration dispatch --inject` to deliver a tracked task')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user