Nightly Build / build (push) Successful in 7m34s
An `execute_task mode="async"` was invisible from the chat that started it.
The only trace was the receipt in the transcript and a row on the Tasks page
— which does not say *which* of those rows the assistant just spawned — so
"is it still going?" had no answer where the question is asked.
Worse, a task that did not simply succeed never came back at all. `run_job`
branched on `Ok`/`Err` first and routed by `job.kind` only inside the `Ok`
arm, so a failure or a kill left through the `Err` arm's unconditional
`hub.notify` — the home source (`/sethome`), worded "Cron job … failed" —
while the parent conversation sat waiting for a `task_completed` that would
never arrive. The wrong chat, and a wedged one.
The fix is a shape, not a branch: one `JobOutcome` classification, then one
`match job.kind` delivery site for every ending. An async task now ends in
its parent conversation whatever happened to it. The sink has a single
channel deliberately — to the model reading it, "it broke" is a result like
any other and must not be overlookable — so a failure is delivered as prose,
carrying whatever partial output the run produced, which is usually the only
clue about why. A cron job keeps the home notification: it belongs to nobody's
conversation. Cancellation becomes a third outcome rather than a flavour of
failure (`job_runs.status` has always had `'cancelled'` in its CHECK and
nothing ever wrote it), classified off the new typed `TurnCancelled` error so
nothing keys on a message string.
The strip above the composer is the visible half. `ServerEvent::TaskUpdate`
announces state to the source of the parent conversation only; the list is
`renderTaskStrip` (shared by the desktop copilot and the mobile chat), fed by
state on `ChatSession`. Each row links to `#session/{id}` — the page that
already shows, live, what a background agent is doing, and without which
"a task is running" is a fact you can do nothing with. Stopping is the
existing kill endpoint. A finished row clears itself after 20 s (its result
is in the conversation by then); a failed one stays until dismissed, and the
dismissal is remembered across reloads.
`GET /api/{source}/tasks` is what makes the strip survive a browser refresh:
the event is a broadcast with no replay, so without a load-time read a reload
would empty a chat that still has work running under it. It answers with the
running tasks plus failures from the last 30 minutes — the two states a person
can still act on. Successes are absent on purpose. Its window compares through
`datetime()` on both sides: `completed_at` is RFC 3339 and the cutoff is
SQLite-shaped, and `'T' > ' '` would let every same-day row through a window
meant to exclude it.
Not addressed, and worth doing next: a cron job's result should go where its
creator says, not always to the home chat.
132 lines
5.5 KiB
HTML
132 lines
5.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Skald</title>
|
|
<link rel="icon" href="/assets/icons/favicon.ico" sizes="any" />
|
|
<link rel="icon" href="/assets/icons/icon-192.png" type="image/png" />
|
|
|
|
<!-- Redirect mobile browsers to the mobile UI -->
|
|
<script>
|
|
(function () {
|
|
var isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent) || window.innerWidth < 768;
|
|
if (isMobile) window.location.replace('/mobile.html');
|
|
})();
|
|
</script>
|
|
|
|
<!-- Apply theme before render to avoid flash. localStorage wins over OS preference. -->
|
|
<script>
|
|
(function () {
|
|
const saved = localStorage.getItem('theme');
|
|
const dark = saved ? saved === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
document.documentElement.setAttribute('data-bs-theme', dark ? 'dark' : 'light');
|
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
|
if (!localStorage.getItem('theme')) {
|
|
document.documentElement.setAttribute('data-bs-theme', e.matches ? 'dark' : 'light');
|
|
}
|
|
});
|
|
})();
|
|
</script>
|
|
|
|
<!-- Font -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" />
|
|
|
|
<!-- Bootstrap 5 -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" />
|
|
<!-- Bootstrap Icons -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
|
|
|
|
<link rel="stylesheet" href="css/variables.css" />
|
|
<link rel="stylesheet" href="css/topbar.css" />
|
|
<link rel="stylesheet" href="css/sidebar.css" />
|
|
<link rel="stylesheet" href="css/copilot.css" />
|
|
<link rel="stylesheet" href="css/copilot-messages.css" />
|
|
<link rel="stylesheet" href="css/copilot-input.css" />
|
|
<link rel="stylesheet" href="css/agent-tasks.css" />
|
|
<link rel="stylesheet" href="css/dialogs.css" />
|
|
<link rel="stylesheet" href="css/page-shell.css" />
|
|
<link rel="stylesheet" href="css/page-header.css" />
|
|
<link rel="stylesheet" href="css/connectors.css" />
|
|
<link rel="stylesheet" href="css/models-hub.css" />
|
|
<link rel="stylesheet" href="css/tasks/base.css" />
|
|
<link rel="stylesheet" href="css/tasks/history.css" />
|
|
<link rel="stylesheet" href="css/models-llm.css" />
|
|
<link rel="stylesheet" href="css/models-image.css" />
|
|
<link rel="stylesheet" href="css/llm-providers.css" />
|
|
<link rel="stylesheet" href="css/agents.css" />
|
|
<link rel="stylesheet" href="css/approval-groups.css" />
|
|
<link rel="stylesheet" href="css/approval-rules.css" />
|
|
<link rel="stylesheet" href="css/inbox-cards.css" />
|
|
<link rel="stylesheet" href="css/config.css" />
|
|
<link rel="stylesheet" href="css/system-agents.css" />
|
|
<link rel="stylesheet" href="css/agent-inbox.css" />
|
|
<link rel="stylesheet" href="css/home.css" />
|
|
<link rel="stylesheet" href="css/llm-requests.css" />
|
|
<link rel="stylesheet" href="css/setup-page.css" />
|
|
<link rel="stylesheet" href="css/users-roles.css" />
|
|
<link rel="stylesheet" href="css/projects/base.css" />
|
|
<link rel="stylesheet" href="css/projects/board.css" />
|
|
<link rel="stylesheet" href="css/file-viewer.css" />
|
|
|
|
<script src="/vendor/cronstrue.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js"></script>
|
|
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"lit": "/vendor/lit-all.min.js",
|
|
"lit/directives/unsafe-html.js": "/vendor/lit-all.min.js",
|
|
"lit/directives/keyed.js": "/vendor/lit-all.min.js",
|
|
"marked": "/vendor/marked.esm.js",
|
|
"dompurify": "/vendor/purify.es.mjs",
|
|
"cronstrue": "/vendor/cronstrue.mjs"
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="app">
|
|
<app-topbar></app-topbar>
|
|
<div class="app-body">
|
|
<app-sidebar></app-sidebar>
|
|
<div class="app-workspace" id="app-workspace"></div>
|
|
<agents-page></agents-page>
|
|
<users-page></users-page>
|
|
<roles-page></roles-page>
|
|
<shared-folders-page></shared-folders-page>
|
|
<connectors-page></connectors-page>
|
|
<connector-detail-page></connector-detail-page>
|
|
<plugin-page-host></plugin-page-host>
|
|
<plugin-catalog-page></plugin-catalog-page>
|
|
<plugin-detail-page></plugin-detail-page>
|
|
<marketplace-page></marketplace-page>
|
|
<profile-page style="display:none"></profile-page>
|
|
<llm-providers-page></llm-providers-page>
|
|
<models-hub-page></models-hub-page>
|
|
<tasks-page></tasks-page>
|
|
<approval-groups-page></approval-groups-page>
|
|
<approval-rules-page></approval-rules-page>
|
|
<config-page></config-page>
|
|
<dashboard-page></dashboard-page>
|
|
<agent-inbox-page></agent-inbox-page>
|
|
<llm-requests-page></llm-requests-page>
|
|
<session-detail-page style="display:none"></session-detail-page>
|
|
<system-agents-page style="display:none"></system-agents-page>
|
|
<projects-page style="display:none"></projects-page>
|
|
<file-viewer-page style="display:none"></file-viewer-page>
|
|
<tool-detail-page style="display:none"></tool-detail-page>
|
|
<app-copilot></app-copilot>
|
|
</div>
|
|
</div>
|
|
|
|
<setup-page style="display:none"></setup-page>
|
|
<login-page style="display:none"></login-page>
|
|
|
|
<script type="module" src="app.js"></script>
|
|
</body>
|
|
</html>
|