Preserve imported comment timeline

This commit is contained in:
Dotta committed 2026-05-05 15:10:44 -05:00
1 parent dcaddf42a3
commit a9dbe497da
3 files changed
+17 -4

No files matched your search

@@ -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",
},
);
});
+3 -2
View File
@@ -712,7 +712,7 @@ function readPortableIssueComments(
function appendCodexImportArg(adapterConfig: Record<string, unknown>, 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<string, unknown>, 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,
});
}
}
+3
View File
@@ -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();