Skip to content

Commit a25dc3c

Browse files
committed
fix(backfill): add amp backfill source support
1 parent 6ff2185 commit a25dc3c

3 files changed

Lines changed: 5 additions & 34 deletions

File tree

packages/cli/src/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ async function backfillCommand(options: ParsedArgs, ctx: RunContext, registry?:
423423

424424
if (action === 'import' && !options['dry-run']) {
425425
const requested = normalizeBackfillSource(stringOption(options.source) || 'all')
426-
const supported = new Set<string>(['all', 'codex', 'claude-code', 'opencode', 'pi'])
426+
const supported = new Set<string>(['all', 'codex', 'claude-code', 'opencode', 'pi', 'amp'])
427427
if (!supported.has(requested)) {
428-
write(ctx.stderr, 'Only Codex, Claude Code, OpenCode, and Pi backfill import are implemented.\n')
428+
write(ctx.stderr, `Unsupported backfill source: ${requested}\n`)
429429
return 1
430430
}
431431
const plan = await createBackfillPlanFromOptions(options, ctx, 'discover', reg)
@@ -693,10 +693,10 @@ async function importBackfillPlan(
693693
registry: AdapterRegistry,
694694
): Promise<number> {
695695
const source = normalizeBackfillSource(stringOption(options.source) || 'all')
696-
const supportedSources = new Set<BackfillSourceId>(['codex', 'claude-code', 'opencode', 'pi'])
696+
const supportedSources = new Set<BackfillSourceId>(['codex', 'claude-code', 'opencode', 'pi', 'amp'])
697697
const home = resolveHome(options, ctx)
698698
if (source !== 'all' && !supportedSources.has(source as BackfillSourceId)) {
699-
write(ctx.stderr, 'Only Codex, Claude Code, OpenCode, and Pi backfill import are implemented.\n')
699+
write(ctx.stderr, `Unsupported backfill source: ${source}\n`)
700700
return 1
701701
}
702702

packages/cli/test/cli.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -663,18 +663,6 @@ test('backfill import sends parsed Claude Code events and counts API results', a
663663
assert.equal(modelRollup.totalTokens, 21)
664664
})
665665

666-
test('backfill import rejects sources without parsers', async () => {
667-
let stderr = ''
668-
const exitCode = await run(['backfill', 'import', '--source', 'cursor'], testContext({
669-
stderr: { write: (text) => {
670-
stderr += text
671-
} },
672-
}))
673-
674-
assert.equal(exitCode, 1)
675-
assert.match(stderr, /Only Codex, Claude Code, OpenCode, and Pi backfill import are implemented/)
676-
})
677-
678666
test('backfill verify reports placeholder status for import runs', async () => {
679667
let output = ''
680668
const exitCode = await run(['backfill', 'verify', '--import-run', 'import_123', '--json'], testContext({

packages/shared/src/index.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const AGENT_TIME_SCHEMA_VERSION = '2026-04-29'
66
export const KNOWN_AGENT_SOURCES = [
77
'codex',
88
'claude-code',
9-
'cursor',
109
'opencode',
1110
'pi',
1211
'amp',
@@ -69,22 +68,6 @@ export const SOURCE_CAPABILITIES: Record<KnownAgentSource, SourceCapabilities> =
6968
permissionEvents: 'exact',
7069
transcriptLocator: 'exact',
7170
},
72-
'cursor': {
73-
sessionLifecycle: 'derived',
74-
turnLifecycle: 'derived',
75-
agentHierarchy: 'none',
76-
promptEvents: 'derived',
77-
modelName: 'partial',
78-
tokenUsage: 'none',
79-
toolCalls: 'partial',
80-
toolTiming: 'estimated',
81-
commandTiming: 'partial',
82-
fileReads: 'derived',
83-
fileWrites: 'exact',
84-
fileDiffStats: 'derived',
85-
permissionEvents: 'none',
86-
transcriptLocator: 'none',
87-
},
8871
'opencode': {
8972
sessionLifecycle: 'partial',
9073
turnLifecycle: 'partial',
@@ -309,7 +292,7 @@ export interface StoredCanonicalEvent extends CanonicalEvent {
309292
receivedAt: string
310293
}
311294

312-
export type BackfillSourceId = 'codex' | 'claude-code' | 'cursor' | 'opencode' | 'pi' | 'amp'
295+
export type BackfillSourceId = 'codex' | 'claude-code' | 'opencode' | 'pi' | 'amp'
313296
export type ImportRunStatus = 'planned' | 'running' | 'completed' | 'failed' | 'cancelled'
314297

315298
export interface ImportRunRecord {

0 commit comments

Comments
 (0)