feat: add v2 task control and asynchronous isolated workers

This commit is contained in:
WHC
2026-10-20 14:46:57 +08:00
parent 143dba203b
commit d971cb02b0
26 changed files with 1590 additions and 66 deletions
+18 -1
View File
@@ -461,6 +461,22 @@ int runUiTest(AgentCore &core, const QString &size) {
clickMouse(win, QStringLiteral("planSwitch"));
check(!core.planMode(), QStringLiteral("plan switch turns it off again"));
/* Task controls must reach the same runtime as the model and HTTP API. */
clickMouse(win, QStringLiteral("taskPanelButton"));
QTest::qWait(150);
QObject *taskPanel = win->findChild<QObject *>(QStringLiteral("taskControlDialog"));
check(taskPanel && taskPanel->property("visible").toBool(),
QStringLiteral("Tasks opens the runtime control panel"));
clickMouse(win, QStringLiteral("taskReadOnly"));
clickMouse(win, QStringLiteral("taskMainOnly"));
QJsonObject taskState = QJsonDocument::fromJson(core.taskState().toUtf8()).object();
check(taskState.value(QStringLiteral("read_only")).toBool() &&
!taskState.value(QStringLiteral("delegation")).toBool(),
QStringLiteral("task panel enforces read-only and main-agent-only controls"));
core.taskControl(false, true, false);
if (taskPanel) QMetaObject::invokeMethod(taskPanel, "close");
QTest::qWait(150);
/* --- keyboard: typing in the composer arms Send --- */
QQuickItem *send = item(win, QStringLiteral("sendButton"));
if (composer && send) {
@@ -570,13 +586,14 @@ int runUiTest(AgentCore &core, const QString &size) {
}
const QString rel =
f.toMap().value(QStringLiteral("rel")).toString();
if (rel.isEmpty() ||
if (f.toMap().value(QStringLiteral("kind")).toString() == QLatin1String("img") || rel.isEmpty() ||
!QFileInfo::exists(attachDir + QLatin1Char('/') + rel))
continue;
QList<QQuickItem *> hits;
collectNamed(s, QStringLiteral("fileOpen%1").arg(i), &hits);
if (!hits.isEmpty()) {
openButton = hits.first();
hits.clear();
collectNamed(s, QStringLiteral("fileShare%1").arg(i), &hits);
shareButton = hits.isEmpty() ? nullptr : hits.first();
}