Make workspace, agent, and schedule automation consistent (#2186)
* feat(workspaces): align agent and schedule automation Make workspace identity the shared placement boundary for MCP and CLI, while caller identity determines parentage. Keep heartbeats minimal and cron-based without changing legacy rolling interval semantics. * test(cli): expect canonical schedule cadence * fix(automation): preserve workspace and schedule compatibility * fix(automation): preserve compatibility edges * fix(workspaces): align MCP lifecycle resolution * fix(workspaces): preserve creation intent * fix(workspaces): preserve branch and schedule identity
This commit is contained in:
@@ -723,7 +723,7 @@ test("sends new-agent run options when creating schedules", async () => {
|
||||
const createPromise = client.scheduleCreate({
|
||||
requestId: "request-1",
|
||||
prompt: "Run the task",
|
||||
cadence: { type: "every", everyMs: 60_000 },
|
||||
cadence: { type: "cron", expression: "* * * * *" },
|
||||
target: {
|
||||
type: "new-agent",
|
||||
config: {
|
||||
@@ -741,7 +741,7 @@ test("sends new-agent run options when creating schedules", async () => {
|
||||
type: "schedule/create",
|
||||
requestId: "request-1",
|
||||
prompt: "Run the task",
|
||||
cadence: { type: "every", everyMs: 60_000 },
|
||||
cadence: { type: "cron", expression: "* * * * *" },
|
||||
target: {
|
||||
type: "new-agent",
|
||||
config: {
|
||||
@@ -1991,7 +1991,7 @@ test("normalizes workspace_setup_progress into a workspace-scoped daemon event",
|
||||
});
|
||||
});
|
||||
|
||||
test("sends create_agent_request with string workspace ids", async () => {
|
||||
test("sends create_agent_request with workspace and caller identity", async () => {
|
||||
const logger = createMockLogger();
|
||||
const mock = createMockTransport();
|
||||
|
||||
@@ -2012,6 +2012,7 @@ test("sends create_agent_request with string workspace ids", async () => {
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project/.paseo/worktrees/feature-a",
|
||||
workspaceId: "ws-feature-a",
|
||||
callerAgentId: "parent-agent",
|
||||
title: "Compat agent",
|
||||
modeId: "default",
|
||||
});
|
||||
@@ -2022,6 +2023,7 @@ test("sends create_agent_request with string workspace ids", async () => {
|
||||
expect.objectContaining({
|
||||
type: "create_agent_request",
|
||||
workspaceId: "ws-feature-a",
|
||||
callerAgentId: "parent-agent",
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -338,6 +338,7 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
||||
cwd?: string;
|
||||
env?: CreateAgentRequestMessage["env"];
|
||||
workspaceId?: string;
|
||||
callerAgentId?: string;
|
||||
initialPrompt?: string;
|
||||
clientMessageId?: string;
|
||||
outputSchema?: Record<string, unknown>;
|
||||
@@ -346,6 +347,8 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
||||
git?: GitSetupOptions;
|
||||
worktree?: CreateAgentRequestMessage["worktree"];
|
||||
autoArchive?: CreateAgentRequestMessage["autoArchive"];
|
||||
// COMPAT(createAgentWorktree): low-level old callers may still send the
|
||||
// create-agent worktree field. Added in v0.2.0; remove after 2027-01-17.
|
||||
worktreeName?: string;
|
||||
requestId?: string;
|
||||
labels?: Record<string, string>;
|
||||
@@ -739,16 +742,11 @@ export interface StopLoopOptions {
|
||||
export interface CreateScheduleOptions {
|
||||
prompt: string;
|
||||
name?: string | null;
|
||||
cadence:
|
||||
| {
|
||||
type: "every";
|
||||
everyMs: number;
|
||||
}
|
||||
| {
|
||||
type: "cron";
|
||||
expression: string;
|
||||
timezone?: string;
|
||||
};
|
||||
cadence: {
|
||||
type: "cron";
|
||||
expression: string;
|
||||
timezone?: string;
|
||||
};
|
||||
target:
|
||||
| {
|
||||
type: "self";
|
||||
@@ -800,16 +798,11 @@ export interface UpdateScheduleOptions {
|
||||
id: string;
|
||||
name?: string | null;
|
||||
prompt?: string;
|
||||
cadence?:
|
||||
| {
|
||||
type: "every";
|
||||
everyMs: number;
|
||||
}
|
||||
| {
|
||||
type: "cron";
|
||||
expression: string;
|
||||
timezone?: string;
|
||||
};
|
||||
cadence?: {
|
||||
type: "cron";
|
||||
expression: string;
|
||||
timezone?: string;
|
||||
};
|
||||
newAgentConfig?: UpdateScheduleNewAgentConfig;
|
||||
maxRuns?: number | null;
|
||||
expiresAt?: string | null;
|
||||
@@ -2290,6 +2283,7 @@ export class DaemonClient {
|
||||
config,
|
||||
...(options.env ? { env: options.env } : {}),
|
||||
...(options.workspaceId !== undefined ? { workspaceId: options.workspaceId } : {}),
|
||||
...(options.callerAgentId !== undefined ? { callerAgentId: options.callerAgentId } : {}),
|
||||
...(options.initialPrompt ? { initialPrompt: options.initialPrompt } : {}),
|
||||
...(options.clientMessageId ? { clientMessageId: options.clientMessageId } : {}),
|
||||
...(options.outputSchema ? { outputSchema: options.outputSchema } : {}),
|
||||
|
||||
@@ -168,13 +168,13 @@ export interface PaseoAgentCreateOptions extends PaseoAgentConfigOverrides {
|
||||
provider?: CreateAgentRequestMessage["config"]["provider"];
|
||||
cwd?: string;
|
||||
workspaceId?: string;
|
||||
callerAgentId?: string;
|
||||
initialPrompt?: string;
|
||||
clientMessageId?: string;
|
||||
outputSchema?: Record<string, unknown>;
|
||||
images?: CreateAgentRequestMessage["images"];
|
||||
attachments?: CreateAgentRequestMessage["attachments"];
|
||||
git?: CreateAgentRequestMessage["git"];
|
||||
worktreeName?: string;
|
||||
requestId?: string;
|
||||
labels?: Record<string, string>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user