fix(rectification): bind default session model
This commit is contained in:
@@ -101,6 +101,23 @@ test("v9 open is atomic, idempotent and resumes instead of duplicating", { skip:
|
||||
where id = '${userId}';
|
||||
`);
|
||||
|
||||
fixture.psql(`
|
||||
with provider as (
|
||||
insert into public.model_providers (code, name, provider_type, encrypted_api_key, enabled)
|
||||
values ('v9-test', 'V9 Test', 'openai', 'test-ciphertext', true)
|
||||
returning id
|
||||
), config as (
|
||||
insert into public.model_configs (model_id)
|
||||
values ('v9-default-model')
|
||||
returning id
|
||||
)
|
||||
insert into public.model_config_versions (
|
||||
config_id, version, provider_id, label, provider_model, enabled, is_default, status, published_at
|
||||
)
|
||||
select config.id, 1, provider.id, 'V9 Default', 'gpt-test', true, true, 'published', now()
|
||||
from config cross join provider;
|
||||
`);
|
||||
|
||||
const service = createLocalPostgresDataClient(
|
||||
fixture.connectionUrl("service_runtime", "service-runtime-test-password"),
|
||||
null,
|
||||
@@ -134,6 +151,10 @@ test("v9 open is atomic, idempotent and resumes instead of duplicating", { skip:
|
||||
fixture.psql(`select count(*) from public.chat_sessions where user_id = '${userId}'`),
|
||||
"1",
|
||||
);
|
||||
assert.equal(
|
||||
fixture.psql(`select model_id || ':' || model_config_version from public.chat_sessions where id = '${sessionId}'`),
|
||||
"v9-default-model:1",
|
||||
);
|
||||
assert.equal(
|
||||
fixture.psql(
|
||||
`select count(*) from public.agentic_rectification_open_ledger where user_id = '${userId}'`,
|
||||
|
||||
Reference in New Issue
Block a user