feat: 将 ofcx-go backend 收敛为 dsflash-go

This commit is contained in:
Codex
2026-06-08 01:38:50 +08:00
parent eef59c74ee
commit 41886aef80
14 changed files with 115 additions and 36 deletions
+38
View File
@@ -137,6 +137,39 @@ ON CONFLICT (profile) DO UPDATE SET
updated_at = EXCLUDED.updated_at;
`;
const dsflashGoBackendProfileMigrationSql = `
UPDATE agentrun_runs SET backend_profile = 'dsflash-go' WHERE backend_profile = 'ofcx-go';
UPDATE agentrun_sessions SET backend_profile = 'dsflash-go' WHERE backend_profile = 'ofcx-go';
UPDATE agentrun_runners SET backend_profile = 'dsflash-go' WHERE backend_profile = 'ofcx-go';
UPDATE agentrun_queue_tasks SET backend_profile = 'dsflash-go' WHERE backend_profile = 'ofcx-go';
UPDATE agentrun_runs
SET execution_policy = replace(replace(replace(execution_policy::text,
'"profile": "ofcx-go"',
'"profile": "dsflash-go"'),
'agentrun-v01-provider-ofcx-go',
'agentrun-v01-provider-dsflash-go'),
'/home/agentrun/.codex-ofcx-go',
'/home/agentrun/.codex-dsflash-go')::jsonb
WHERE execution_policy::text LIKE '%ofcx-go%';
UPDATE agentrun_queue_tasks
SET execution_policy = replace(replace(replace(execution_policy::text,
'"profile": "ofcx-go"',
'"profile": "dsflash-go"'),
'agentrun-v01-provider-ofcx-go',
'agentrun-v01-provider-dsflash-go'),
'/home/agentrun/.codex-ofcx-go',
'/home/agentrun/.codex-dsflash-go')::jsonb
WHERE execution_policy IS NOT NULL AND execution_policy::text LIKE '%ofcx-go%';
DELETE FROM agentrun_backends WHERE profile = 'ofcx-go';
INSERT INTO agentrun_backends (profile, capabilities, capacity, health, updated_at)
VALUES ${backendCapabilitiesSqlValues(["dsflash-go"])}
ON CONFLICT (profile) DO UPDATE SET
capabilities = EXCLUDED.capabilities,
capacity = EXCLUDED.capacity,
health = EXCLUDED.health,
updated_at = EXCLUDED.updated_at;
`;
const sessionControlMigrationSql = `
ALTER TABLE agentrun_sessions ADD COLUMN IF NOT EXISTS version bigint NOT NULL DEFAULT 1;
ALTER TABLE agentrun_sessions ADD COLUMN IF NOT EXISTS execution_state text NOT NULL DEFAULT 'idle';
@@ -322,6 +355,11 @@ const postgresMigrations: MigrationDefinition[] = [
checksum: checksumSql(sessionStateStorageMigrationSql),
sql: sessionStateStorageMigrationSql,
},
{
id: "008_v01_dsflash_go_backend_profile",
checksum: checksumSql(dsflashGoBackendProfileMigrationSql),
sql: dsflashGoBackendProfileMigrationSql,
},
];
export function postgresMigrationContract(): JsonRecord {