diff --git a/server/src/__tests__/company-portability.test.ts b/server/src/__tests__/company-portability.test.ts index f394f241dd3..ff65bbee093 100644 --- a/server/src/__tests__/company-portability.test.ts +++ b/server/src/__tests__/company-portability.test.ts @@ -2417,7 +2417,10 @@ describe("company portability", () => { adapterOverrides: { claudecoder: { adapterType: "codex_local", - adapterConfig: {}, + adapterConfig: { + extraArgs: [], + args: ["--legacy-arg"], + }, }, }, }, "user-1"); @@ -2426,6 +2429,7 @@ describe("company portability", () => { adapterType: "codex_local", adapterConfig: expect.objectContaining({ extraArgs: ["--skip-git-repo-check"], + args: ["--legacy-arg"], }), })); expect(agentSvc.create).toHaveBeenLastCalledWith("company-imported", expect.objectContaining({ @@ -2572,7 +2576,12 @@ describe("company portability", () => { "issue-imported", "Paperclip needs a disposition before this issue can continue.", { agentId: undefined, userId: undefined }, - { authorType: "system", presentation, metadata }, + { + authorType: "system", + presentation, + metadata, + createdAt: "2026-05-04T12:00:00.000Z", + }, ); }); diff --git a/server/src/services/company-portability.ts b/server/src/services/company-portability.ts index 55390b35bde..d511a8861e4 100644 --- a/server/src/services/company-portability.ts +++ b/server/src/services/company-portability.ts @@ -712,7 +712,7 @@ function readPortableIssueComments( function appendCodexImportArg(adapterConfig: Record, arg: string) { const extraArgs = readStringArray(adapterConfig.extraArgs); - if (extraArgs && extraArgs.length > 0) { + if (extraArgs) { if (!extraArgs.includes(arg)) adapterConfig.extraArgs = [...extraArgs, arg]; return; } @@ -723,7 +723,7 @@ function appendCodexImportArg(adapterConfig: Record, arg: strin return; } - if (extraArgs?.includes(arg) || legacyArgs?.includes(arg)) return; + if (legacyArgs?.includes(arg)) return; adapterConfig.extraArgs = [arg]; } @@ -4645,6 +4645,7 @@ export function companyPortabilityService(db: Db, storage?: StorageService) { authorType, presentation: comment.presentation, metadata: comment.metadata, + createdAt: comment.createdAt, }); } } diff --git a/server/src/services/issues.ts b/server/src/services/issues.ts index 88048ba14ce..59cb3e8c78b 100644 --- a/server/src/services/issues.ts +++ b/server/src/services/issues.ts @@ -3790,6 +3790,7 @@ export function issueService(db: Db) { authorType?: IssueCommentAuthorType | null; presentation?: IssueCommentPresentation | null; metadata?: IssueCommentMetadata | null; + createdAt?: Date | string | null; }, ) => { const issue = await db @@ -3810,6 +3811,7 @@ export function issueService(db: Db) { assertIssueCommentAuthorTypeAllowed(actor, authorType); const presentation = issueCommentPresentationSchema.nullable().parse(options?.presentation ?? null); const metadata = issueCommentMetadataSchema.nullable().parse(options?.metadata ?? null); + const createdAt = options?.createdAt ? new Date(options.createdAt) : null; const [comment] = await db .insert(issueComments) .values({ @@ -3822,6 +3824,7 @@ export function issueService(db: Db) { body: redactedBody, presentation, metadata, + ...(createdAt && !Number.isNaN(createdAt.getTime()) ? { createdAt } : {}), }) .returning();