feat: integrate Orven workspace and engineering repairs for 1.25.9
This commit is contained in:
@@ -219,3 +219,27 @@ test('request projection keeps exact tool pairs and complete recent user instruc
|
||||
assert.deepEqual(messages, original);
|
||||
for (const message of projected.messages) for (const tool of message.tool_calls ?? []) assert.doesNotThrow(() => JSON.parse(tool.function.arguments));
|
||||
});
|
||||
|
||||
test('incoming mutations wait only for the ended run report and do not replay model work or wait on an active tool loop', async t => {
|
||||
const f = fixture(t), provider = new Provider(); let releaseModel, releaseReport, requests = 0;
|
||||
provider.complete = async () => {
|
||||
requests++; await new Promise(resolve => { releaseModel = resolve; });
|
||||
return { message: { role: 'assistant', content: 'Owned task finished.' }, usage: null };
|
||||
};
|
||||
const runtime = new Runtime(f.store, provider); f.onCleanup(() => runtime.stopAll());
|
||||
runtime.finalizeDeliveryReport = async () => { await new Promise(resolve => { releaseReport = resolve; }); };
|
||||
runtime.start(f.session.id, 'Inspect the owned fixture.');
|
||||
try {
|
||||
await until(() => releaseModel);
|
||||
await runtime.awaitFinalization(f.session.id);
|
||||
assert.equal(runtime.active.get(f.session.id).finalizing, undefined);
|
||||
releaseModel(); await until(() => releaseReport);
|
||||
let settled = false;
|
||||
const waiting = runtime.awaitFinalization(f.session.id).then(() => { settled = true; });
|
||||
await Promise.resolve(); assert.equal(settled, false);
|
||||
assert.equal(runtime.active.get(f.session.id).finalizing, true);
|
||||
releaseReport(); await waiting;
|
||||
assert.equal(runtime.active.has(f.session.id), false); assert.equal(requests, 1);
|
||||
assert.equal(f.session.status, 'completed');
|
||||
} finally { releaseModel?.(); releaseReport?.(); }
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Runtime } from '../src/server/runtime.mjs';
|
||||
import { Provider } from '../src/server/provider.mjs';
|
||||
import { DeliveryReporter } from '../src/core/delivery-report.mjs';
|
||||
import { CheckRunner } from '../src/core/check-runner.mjs';
|
||||
import { fixture, call, compatibleFixture, completion, launchWorkbench, until } from './helpers.mjs';
|
||||
import { fixture, call, compatibleFixture, completion, launchWorkbench, until, workspace } from './helpers.mjs';
|
||||
import { createDeliveryProject, applyDeliveryFix, deliveryGit as git, writeDeliveryFile as write } from './fixtures/delivery-project.mjs';
|
||||
|
||||
const paths = ['src/add.mjs', 'src/math.mjs'];
|
||||
@@ -186,8 +186,7 @@ test('isolated HTTP model tools register a real terminal commit and append a fin
|
||||
assert.equal(requests, 5); oldArtifact = JSON.parse(body.messages.findLast(row => row.role === 'tool').content).artifact_id;
|
||||
return completion([], 'The owned terminal repair is committed.');
|
||||
});
|
||||
const appRoot = process.env.AGENT_WORKBENCH_TEST_APP_ROOT;
|
||||
assert.ok(appRoot, 'Run this integration with the isolated engineering repair build.');
|
||||
const appRoot = process.env.AGENT_WORKBENCH_TEST_APP_ROOT ?? workspace;
|
||||
const host = await launchWorkbench(t, f.data, {}, { appRoot });
|
||||
await host.api('/config', { mode: 'compatible', baseUrl: model.baseUrl, model: 'owned-terminal-delivery', apiKey: 'owned-local-fixture-only' });
|
||||
const route = '/sessions/' + f.session.id; await host.api(route + '/messages', { content: 'Complete the addition repair and make a local commit; preserve owner files and index.' });
|
||||
@@ -208,7 +207,7 @@ test('a real HTTP upstream failure remains a failed run while its applied files
|
||||
if (requests === 1) return completion([call('http-failure-proposal', 'propose_file', { path: paths[0], content: 'export const add = (a, b) => a + b;\n', reason: 'Owned failure fixture repair.' })]);
|
||||
return { status: 400, body: { error: { message: 'owned upstream failure is preserved', code: 'owned_fixture_error' } } };
|
||||
});
|
||||
const appRoot = process.env.AGENT_WORKBENCH_TEST_APP_ROOT; assert.ok(appRoot);
|
||||
const appRoot = process.env.AGENT_WORKBENCH_TEST_APP_ROOT ?? workspace;
|
||||
const host = await launchWorkbench(t, f.data, {}, { appRoot });
|
||||
await host.api('/config', { mode: 'compatible', baseUrl: model.baseUrl, model: 'owned-failure-report', apiKey: 'owned-local-fixture-only' });
|
||||
const route = '/sessions/' + f.session.id; await host.api(route + '/messages', { content: 'Repair addition and report the real result.' });
|
||||
|
||||
Reference in New Issue
Block a user