mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
Merge master b189f586d into Codex runner default candidate
Preserve master transport, lifecycle, and release verification controls alongside macOS qualification. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
commit
f4abdc2cfc
749 files changed
+124181
-68418
No files matched your search
@@ -59,6 +59,7 @@ interface IssueCreateOptions extends BaseClientOptions {
|
||||
projectId?: string;
|
||||
goalId?: string;
|
||||
parentId?: string;
|
||||
standalone?: boolean;
|
||||
requestDepth?: string;
|
||||
billingCode?: string;
|
||||
}
|
||||
@@ -286,10 +287,17 @@ export function registerIssueCommands(program: Command): void {
|
||||
.option("--project-id <id>", "Project ID")
|
||||
.option("--goal-id <id>", "Goal ID")
|
||||
.option("--parent-id <id>", "Parent issue ID")
|
||||
.option(
|
||||
"--standalone",
|
||||
"Create a top-level issue. Without --parent-id, an agent run's issue otherwise becomes the parent.",
|
||||
)
|
||||
.option("--request-depth <n>", "Request depth integer")
|
||||
.option("--billing-code <code>", "Billing code")
|
||||
.action(async (opts: IssueCreateOptions) => {
|
||||
try {
|
||||
if (opts.standalone && opts.parentId) {
|
||||
throw new Error("--standalone cannot be combined with --parent-id");
|
||||
}
|
||||
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
||||
const payload = createIssueSchema.parse({
|
||||
title: opts.title,
|
||||
@@ -299,7 +307,7 @@ export function registerIssueCommands(program: Command): void {
|
||||
assigneeAgentId: opts.assigneeAgentId,
|
||||
projectId: opts.projectId,
|
||||
goalId: opts.goalId,
|
||||
parentId: opts.parentId,
|
||||
parentId: opts.standalone ? null : opts.parentId,
|
||||
requestDepth: parseOptionalInt(opts.requestDepth),
|
||||
billingCode: opts.billingCode,
|
||||
});
|
||||
|
||||
@@ -150,11 +150,14 @@ async function loopbackPortAvailable(port: number): Promise<boolean> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function resolveTestDriveServerPort(preferredPort = 3100): Promise<number> {
|
||||
for (let port = preferredPort; port <= 65_535; port += 1) {
|
||||
if (await loopbackPortAvailable(port)) return port;
|
||||
export async function resolveTestDriveServerPort(preferredPort = 3100, available = loopbackPortAvailable): Promise<number> {
|
||||
if (await available(preferredPort)) return preferredPort;
|
||||
// A saved high port can be occupied. Search the ordinary range instead of
|
||||
// trapping the restarted test drive at the top of the TCP port space.
|
||||
for (let port = 3100; port <= 65_535; port += 1) {
|
||||
if (port !== preferredPort && await available(port)) return port;
|
||||
}
|
||||
throw new Error(`No available loopback port found at or above ${preferredPort}.`);
|
||||
throw new Error("No available loopback port found at or above 3100.");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +197,15 @@ export async function prepareTestDriveEnvironment(
|
||||
process.env.PAPERCLIP_DEPLOYMENT_EXPOSURE = "private";
|
||||
process.env.PAPERCLIP_BIND = "loopback";
|
||||
process.env.HOST = "127.0.0.1";
|
||||
process.env.PORT = String(await resolveTestDriveServerPort());
|
||||
let preferredPort = 3100;
|
||||
try {
|
||||
preferredPort = readConfig(process.env.PAPERCLIP_CONFIG)?.server.port ?? preferredPort;
|
||||
} catch {
|
||||
// The normal startup doctor owns invalid-config diagnostics and repair.
|
||||
}
|
||||
// Reusing a test drive must preserve callback and enrollment origins when
|
||||
// its saved port is available. Only move forward if that port is occupied.
|
||||
process.env.PORT = String(await resolveTestDriveServerPort(preferredPort));
|
||||
|
||||
return { dataDir, linkedWorktree };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user