Add --workspace-status flag to worktree set CLI (#3332)

The `worktree.set` RPC already accepts `workspaceStatus`, but the CLI
handler never forwarded it, so the board status could not be changed
from the command line. Pass the flag through, document it in the spec
and root help, and add a CLI test mirroring the existing --comment case.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Borja
2026-05-31 10:41:10 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent e670193fae
commit 0cf4f6010e
4 changed files with 46 additions and 2 deletions
+1
View File
@@ -161,6 +161,7 @@ export const WORKTREE_HANDLERS: Record<string, CommandHandler> = {
displayName: getOptionalStringFlag(flags, 'display-name'),
linkedIssue: getOptionalNullableNumberFlag(flags, 'issue'),
comment: getOptionalStringFlag(flags, 'comment'),
workspaceStatus: getOptionalStringFlag(flags, 'workspace-status'),
parentWorktree: await getOptionalWorktreeSelector(flags, 'parent-worktree', cwd, client),
noParent: flags.get('no-parent') === true
})
+3 -1
View File
@@ -169,7 +169,7 @@ Common Commands:
orca worktree create --repo <selector> --name <name> [--base-branch <ref>] [--issue <number>] [--comment <text>] [--parent-worktree <selector>] [--no-parent] [--run-hooks] [--activate] [--json]
orca worktree show --worktree <selector> [--json]
orca worktree current [--json]
orca worktree set --worktree <selector> [--display-name <name>] [--issue <number|null>] [--comment <text>] [--parent-worktree <selector>|--no-parent] [--json]
orca worktree set --worktree <selector> [--display-name <name>] [--issue <number|null>] [--comment <text>] [--workspace-status <id>] [--parent-worktree <selector>|--no-parent] [--json]
orca worktree rm --worktree <selector> [--force] [--run-hooks] [--json]
orca worktree ps [--limit <n>] [--json]
orca file open <path> [--worktree <selector>] [--json]
@@ -388,6 +388,8 @@ export function formatFlagHelp(flag: string): string {
worktree:
'--worktree <selector> Worktree selector such as id:<id>, branch:<branch>, issue:<number>, path:<path>, or active/current',
workspace: '--workspace <selector> Existing worktree selector for automation runs',
'workspace-status':
'--workspace-status <id> Board status id (defaults: todo, in-progress, in-review, completed)',
prompt: '--prompt <text> Automation prompt to pass to the agent',
staged: '--staged Open staged source-control changes',
provider: '--provider <agent> Agent id such as codex, claude, or gemini',
+37
View File
@@ -427,11 +427,48 @@ describe('orca cli worktree awareness', () => {
displayName: undefined,
linkedIssue: undefined,
comment: undefined,
workspaceStatus: undefined,
parentWorktree: undefined,
noParent: true
})
})
it('passes workspace status through worktree.set', async () => {
queueFixtures(
callMock,
okFixture('req_set_status', {
worktree: {
...buildWorktree('/tmp/repo/child', 'feature/child'),
workspaceStatus: 'in-review'
}
})
)
vi.spyOn(console, 'log').mockImplementation(() => {})
await main(
[
'worktree',
'set',
'--worktree',
'id:repo::/tmp/repo/child',
'--workspace-status',
'in-review',
'--json'
],
'/tmp/repo'
)
expect(callMock).toHaveBeenCalledWith('worktree.set', {
worktree: 'id:repo::/tmp/repo/child',
displayName: undefined,
linkedIssue: undefined,
comment: undefined,
workspaceStatus: 'in-review',
parentWorktree: undefined,
noParent: false
})
})
it('passes explicit activation through worktree.create', async () => {
queueFixtures(
callMock,
+5 -1
View File
@@ -123,15 +123,19 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [
path: ['worktree', 'set'],
summary: 'Update Orca metadata for a worktree',
usage:
'orca worktree set --worktree <selector> [--display-name <name>] [--issue <number|null>] [--comment <text>] [--parent-worktree <selector>|--no-parent] [--json]',
'orca worktree set --worktree <selector> [--display-name <name>] [--issue <number|null>] [--comment <text>] [--workspace-status <id>] [--parent-worktree <selector>|--no-parent] [--json]',
allowedFlags: [
...GLOBAL_FLAGS,
'worktree',
'display-name',
'issue',
'comment',
'workspace-status',
'parent-worktree',
'no-parent'
],
notes: [
'Workspace status ids match the board columns (defaults: todo, in-progress, in-review, completed); custom statuses use their configured id.'
]
},
{