feat: let a background task ask the chat that started it, not just the Inbox
Nightly Build / build (push) Successful in 7m42s
Nightly Build / build (push) Successful in 7m42s
An async sub-agent runs in a session of its own, so the rich per-session events
that draw the inline approval card never reach the chat's socket — only the
id-only inbox lifecycle ones do. A task blocked on an approval was therefore
invisible in the conversation that started it, and the only way to unblock it
was to notice the sidebar badge and go to the Inbox.
The chat already shows what it handed off. This asks the same question of the
pending items: `GET /{source}/inbox` joins them against the sessions of this
conversation's running async jobs, so "whose is this" has one answer, in the
same place `/{source}/tasks` answers it for a task. The client is left with a
list to render, not a correlation to guess. The live path adds no event — the
existing `approval_requested` / `clarification_*` broadcasts already reach every
socket of the user, and re-reading the endpoint turns a nudge into something
renderable and survives a reload for free.
The card sits above the task strip rather than in the transcript: the task that
is asking may have been started twenty messages ago, and a card that scrolls
away is a card that gets missed. One at a time, with a count of what is behind
it — a blocked task stays blocked whether or not its card is on screen, so
stacking them would trade a readable chat for a queue nobody asked to see. And
it closes: the ✕ hides the card without resolving anything, leaving the item in
the Inbox, because a panel that cannot be moved takes the chat hostage.
`InboxCardsMixin` is the cards and their resolve calls, split out of
`InboxMixin` so the chat and the Inbox render the same approval rather than two
drifting copies of it; `_afterInboxResolve` is the only thing they disagree on.
Elicitations are left out: `PendingElicitationInfo` carries no `session_id`, so
there is nothing to attribute one to a task with.
Also: an async task's context label said "CronJob:", which sends whoever reads
the approval looking on the wrong page — and now says so next to the task's
real name.
This commit is contained in:
@@ -93,6 +93,10 @@ export default {
|
||||
'chat.tasks.failed': 'failed',
|
||||
'chat.tasks.cancelled': 'stopped',
|
||||
'chat.tasks.see_all': 'All tasks',
|
||||
'chat.tasks.needs_you': 'Waiting for you',
|
||||
'chat.tasks.pending_n': '1 of {n}',
|
||||
'chat.tasks.ask_hide': 'Hide — it stays in the Inbox',
|
||||
'chat.tasks.hidden_n': '{n} waiting in the Inbox',
|
||||
|
||||
// ── Copilot render ─────────────────────────────────────────────────────────
|
||||
'copilot.open_in_viewer': 'Open in viewer',
|
||||
|
||||
@@ -93,6 +93,10 @@ export default {
|
||||
'chat.tasks.failed': 'échouée',
|
||||
'chat.tasks.cancelled': 'arrêtée',
|
||||
'chat.tasks.see_all': 'Toutes les tâches',
|
||||
'chat.tasks.needs_you': 'En attente de vous',
|
||||
'chat.tasks.pending_n': '1 sur {n}',
|
||||
'chat.tasks.ask_hide': 'Masquer — reste dans la boîte de réception',
|
||||
'chat.tasks.hidden_n': '{n} en attente dans la boîte de réception',
|
||||
|
||||
// ── Copilot render ─────────────────────────────────────────────────────────
|
||||
'copilot.open_in_viewer': 'Ouvrir dans le visualiseur',
|
||||
|
||||
@@ -93,6 +93,10 @@ export default {
|
||||
'chat.tasks.failed': 'fallita',
|
||||
'chat.tasks.cancelled': 'fermata',
|
||||
'chat.tasks.see_all': 'Tutte le attività',
|
||||
'chat.tasks.needs_you': 'Aspetta te',
|
||||
'chat.tasks.pending_n': '1 di {n}',
|
||||
'chat.tasks.ask_hide': 'Nascondi — resta nella Inbox',
|
||||
'chat.tasks.hidden_n': '{n} in attesa nella Inbox',
|
||||
|
||||
// ── Copilot render ─────────────────────────────────────────────────────────
|
||||
'copilot.open_in_viewer': 'Apri nel visualizzatore',
|
||||
|
||||
Reference in New Issue
Block a user