feat(dsh): add durable supervision, scheduling and operations dock

This commit is contained in:
阿白叔 committed 2026-10-30 18:13:56 +08:00
1 parent f861a3d386
commit 736b582bc1
46 files changed
+4122 -93

No files matched your search

+13 -1
View File
@@ -18,7 +18,7 @@ const report={};
try {
const schemas=ctx.tools.schemas();
report.tools=schemas.map(x=>x.name);
assert.deepEqual(report.tools,['dx_task_snapshot','dx_task_create','dx_task_catalog','dx_task_preflight','dx_task_manage','dx_task_execute']);
assert.deepEqual(report.tools,['dx_task_snapshot','dx_task_create','dx_task_catalog','dx_task_preflight','dx_task_manage','dx_task_execute','dx_task_operations']);
const presets=await ctx.agentPresets.list();
report.presets=presets.map(x=>x.id);
assert.deepEqual(report.presets,['dx-task']);
@@ -36,6 +36,7 @@ try {
['dx_task_catalog',{}],['dx_task_preflight',{task_ids:['fixture']}],
['dx_task_manage',{operation:'archive',task_id:'fixture'}],
['dx_task_execute',{operation:'start',task_ids:['fixture']}],
['dx_task_operations',{operation:'history'}],
]){
const result=await ctx.tools.execute({callId:'desktop-only-'+name,name,arguments:args,signal:AbortSignal.timeout(2000)});
assert.equal(result.isError,true,name+' requires parent desktop');
@@ -55,6 +56,11 @@ try {
const unauth=await fetch(base+'/dx/context');
assert.equal(unauth.status,401);
report.unauthenticatedContextDenied=true;
for(const endpoint of ['/dx/runtime','/dx/workspace']){
assert.equal((await fetch(base+endpoint)).status,401);
}
assert.equal((await fetch(base+'/dx/operations',{method:'POST',headers:{'Content-Type':'application/json'},body:'{}'})).status,401);
report.operationsAndUsageAuthenticationEnforced=true;
const login=await fetch(ctx.connection.authenticatedUrl(base+'/'),{redirect:'manual'});
const cookie=login.headers.getSetCookie().map(x=>x.split(';')[0]).join('; ');
assert.ok(cookie);
@@ -63,6 +69,12 @@ try {
assert.equal(visible.status,200);
assert.equal((await visible.json()).task_id,'cli-verification');
report.authenticatedContextRead=true;
assert.ok((await fetch(base+'/dx/workspace',{headers:auth}).then(r=>r.json())).workspace_id);
const usage=await fetch(base+'/dx/runtime',{headers:auth}).then(r=>r.json());
assert.equal(usage.settings.response_timeout_seconds,90);
assert.equal((await fetch(base+'/dx/operations',{method:'POST',headers:{...auth,'Content-Type':'application/json'},
body:JSON.stringify({revision:'stale',spec:{operation:'history'}})})).status,409);
report.operationsStaleAdmissionDenied=true;
for (const payload of [
{action:'shell',task_id:'cli-verification',revision:'cli-revision'},
{action:'retry_failed',task_id:'another-task',revision:'cli-revision'},