authoring UX: sequential elicitation questions + optional creation approval
Elicitation now asks one question at a time: only one PendingQuestion is live, and the next is posted only after the current is answered (an empty answer is accepted) or skipped. Each question gets a fresh codegen.elicitation.answer_timeout (default 30s) that resets on every answer submit; a timeout stops the sequence. questions_timeout is now traced only on a real timeout. Front ends need no change — they read pending_questions(). Add opt-in creation_approval: the single-slot llm draft worker blocks after authoring a proposal and before anything is registered; approve/deny via the REPL, dashboard (/api/approvals + UI), or a gateway chat reply (yes/no). One prompt per creation request (a category approval covers its chained skill); denial or timeout aborts creation. Off by default. Tests updated for both; full stdlib suite passes (337).
This commit is contained in:
1 parent
25ade160df
commit
215c22afb8
10 files changed
+684
-67
No files matched your search
@@ -118,6 +118,7 @@ def build_status(scheduler: Scheduler) -> dict:
|
||||
queue_max = scheduler.queue.max_size
|
||||
questions = scheduler.pending_questions()
|
||||
repairs = scheduler.pending_repairs()
|
||||
approvals = scheduler.pending_approvals()
|
||||
return {
|
||||
"current": current,
|
||||
"pending": pending,
|
||||
@@ -126,6 +127,7 @@ def build_status(scheduler: Scheduler) -> dict:
|
||||
"queue_max": queue_max,
|
||||
"questions": questions,
|
||||
"repairs": repairs,
|
||||
"approvals": approvals,
|
||||
}
|
||||
|
||||
|
||||
@@ -228,6 +230,9 @@ class DashboardHandler(BaseHTTPRequestHandler):
|
||||
if path == "/api/repairs":
|
||||
self._send(200, {"repairs": self.scheduler.pending_repairs()})
|
||||
return
|
||||
if path == "/api/approvals":
|
||||
self._send(200, {"approvals": self.scheduler.pending_approvals()})
|
||||
return
|
||||
self._send_error(404, "no such endpoint")
|
||||
|
||||
def do_POST(self):
|
||||
@@ -302,6 +307,18 @@ class DashboardHandler(BaseHTTPRequestHandler):
|
||||
return
|
||||
self._send(200, {"status": status, "detail": detail})
|
||||
return
|
||||
if path == "/api/approvals":
|
||||
with self.lock:
|
||||
try:
|
||||
body = self._read_json()
|
||||
status, detail = self.scheduler.answer_approval(
|
||||
str(body.get("id", "")), bool(body.get("approve"))
|
||||
)
|
||||
except Exception as exc:
|
||||
self._send_error(500, str(exc))
|
||||
return
|
||||
self._send(200, {"status": status, "detail": detail})
|
||||
return
|
||||
self._send_error(404, "no such endpoint")
|
||||
|
||||
def log_message(self, format, *args):
|
||||
|
||||
Reference in new issue
Block a user