Wire provider streaming request lifecycle

This commit is contained in:
ZacharyZhang-NY committed 2026-05-23 20:20:14 -04:00
1 parent 6805d8a624
commit 08364c2571
18 files changed
+863 -164

No files matched your search

@@ -0,0 +1,12 @@
export const providerRequestRuntimeSchema = `
alter table provider_requests add column external_response_id text;
alter table provider_requests add column stream_event_count integer not null default 0;
alter table provider_requests add column cancelled_at text;
create index if not exists idx_provider_requests_external_response
on provider_requests(provider_id, external_response_id)
where external_response_id is not null;
insert into schema_migrations(version, name, applied_at)
values (23, 'provider_request_runtime', datetime('now'));
`;
@@ -21,6 +21,7 @@ import { auditReplaySchema } from "./migrations/019-audit-replay";
import { rollbackSnapshotsSchema } from "./migrations/020-rollback-snapshots";
import { providerAuthBrokerSchema } from "./migrations/021-provider-auth-broker";
import { providerRateLimitObservationSchema } from "./migrations/022-provider-rate-limit-observations";
import { providerRequestRuntimeSchema } from "./migrations/023-provider-request-runtime";
interface Migration {
version: number;
@@ -51,6 +52,7 @@ const MIGRATIONS: Migration[] = [
{ version: 20, name: "rollback_snapshots", sql: rollbackSnapshotsSchema },
{ version: 21, name: "provider_auth_broker", sql: providerAuthBrokerSchema },
{ version: 22, name: "provider_rate_limit_observations", sql: providerRateLimitObservationSchema },
{ version: 23, name: "provider_request_runtime", sql: providerRequestRuntimeSchema },
];
const SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1].version;