feat(ql3): add fenced copilot diagnosis cancellation

This commit is contained in:
whyour
2026-08-16 01:34:55 +08:00
parent f77b19e615
commit e5a3d83a8d
17 changed files with 1685 additions and 8 deletions
@@ -169,9 +169,11 @@ test('Copilot composition is explicit, shares the Prompt gateway and injects one
const artifactStore = { put() {}, inspect() {}, readLogRange() {} };
const copilot = Object.freeze({ execute() {} });
const copilotRead = Object.freeze({ inspect() {}, readOutput() {} });
const copilotCancellation = Object.freeze({ cancel() {} });
let registeredSink;
let created;
let createdRead;
let createdCancellation;
let controlOptions;
try {
await Promise.all([
@@ -233,6 +235,10 @@ test('Copilot composition is explicit, shares the Prompt gateway and injects one
createdRead = options;
return copilotRead;
},
createCopilotCancellation(options) {
createdCancellation = options;
return copilotCancellation;
},
async startControl(options) {
controlOptions = options;
return {
@@ -257,11 +263,16 @@ test('Copilot composition is explicit, shares the Prompt gateway and injects one
assert.equal(created.artifactStore, artifactStore);
assert.equal(createdRead.pool, fakePool);
assert.equal(typeof createdRead.prepared.outputKeys.resolve, 'function');
assert.equal(createdCancellation.pool, fakePool);
assert.equal(controlOptions.copilotFailureDiagnosis.capability, copilot);
assert.equal(
controlOptions.copilotFailureDiagnosis.readCapability,
copilotRead,
);
assert.equal(
controlOptions.copilotFailureDiagnosis.cancellationCapability,
copilotCancellation,
);
assert.equal(await application.stop(), 'stopped');
} finally {
config.fill(0);