feat(server): improve task CLI with steering, execution order, and planner guidance
- Fix steering notes to check scope task instead of leaf task
- Fix NOT_DONE replan to use scope for bird's eye view
- Pass reason to planner prompt ("Why you were called" section)
- Add execution-order.ts with reusable computeExecutionOrder and buildSortedChildrenMap
- Make 'tree' an alias for 'plan' command
- Add comprehensive help text for run command and acceptance criteria
- Add planner guidance for propagating requirements to subtasks
This commit is contained in:
@@ -161,3 +161,10 @@ export async function waitForAgentIdle(page: Page, timeout = 30000) {
|
||||
const stopButton = page.getByRole('button', { name: /stop|cancel/i });
|
||||
await expect(stopButton).not.toBeVisible({ timeout });
|
||||
}
|
||||
|
||||
export async function getToolCallCount(page: Page): Promise<number> {
|
||||
// Tool calls are rendered as ExpandableBadge components with tool names like Bash, Write, Read, etc.
|
||||
// They appear as pressable badges in the agent stream
|
||||
const toolCallBadges = page.locator('[data-testid="tool-call-badge"]');
|
||||
return toolCallBadges.count();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
allowPermission,
|
||||
denyPermission,
|
||||
waitForAgentIdle,
|
||||
getToolCallCount,
|
||||
} from './helpers/app';
|
||||
import { createTempGitRepo } from './helpers/workspace';
|
||||
|
||||
@@ -37,6 +38,10 @@ test.describe('permission prompts', () => {
|
||||
timeout: 10000,
|
||||
})
|
||||
.toBe(true);
|
||||
|
||||
// Verify exactly one tool call is visible (no duplicate permission badge)
|
||||
const toolCallCount = await getToolCallCount(page);
|
||||
expect(toolCallCount).toBe(1);
|
||||
} finally {
|
||||
await repo.cleanup();
|
||||
}
|
||||
@@ -61,6 +66,10 @@ test.describe('permission prompts', () => {
|
||||
await waitForAgentIdle(page);
|
||||
|
||||
expect(existsSync(filePath)).toBe(false);
|
||||
|
||||
// Verify exactly one tool call is visible (no duplicate permission badge)
|
||||
const toolCallCount = await getToolCallCount(page);
|
||||
expect(toolCallCount).toBe(1);
|
||||
} finally {
|
||||
await repo.cleanup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user