mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
v3-orchestrator
This commit is contained in:
1 parent
7a4b7c6db8
commit
681c4a4b85
27 files changed
+1138
-36
No files matched your search
@@ -665,6 +665,21 @@ export function validate(state) {
|
||||
if (recs.length > 1) problems.push(`item "${item.id}" marks ${recs.length} options recommended; at most one`);
|
||||
}
|
||||
|
||||
// A note on a card is unanswered the moment no agent words follow it in its
|
||||
// thread. Once that is true, no patch may move past it except one that
|
||||
// finally replies: deleting the item drops it from state.items before this
|
||||
// check ever sees it, and the session's own ending is exempt because
|
||||
// nothing further is coming to answer into.
|
||||
if (state.finish == null) {
|
||||
for (const item of state.items) {
|
||||
const thread = Array.isArray(item.thread) ? item.thread : [];
|
||||
const last = thread[thread.length - 1];
|
||||
if (isPlainObject(last) && last.who === "user") {
|
||||
problems.push(`item "${item.id}" has an unanswered note from the person; reply in its thread before this patch`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The dashboard's page is the menu: a card posted there is drawn nowhere,
|
||||
// yet counts as open (and keeps Stop live for a question nobody can see).
|
||||
if (state.workflow === "dashboard" && state.items.some((i) => isOpen(i))) {
|
||||
|
||||
Reference in new issue
Block a user