dashboard: show a pending submit while its run spins up; retune codegen defaults

Submitting from the dashboard cleared the input and then showed nothing until
the next poll, so a slow submit looked like a no-op. POST /api/submit now
returns the new request_id alongside status/detail (Scheduler.submit_request),
and the front end keeps a `pendingSubmit` entry: it immediately renders a
synthetic "submitted" node plus an in-flight spinner, then swaps to the real
run once its trace row appears (matching by request_id) and clears the pending
state. A run that has landed but has no decisions yet also gets the spinner
instead of an empty flow. Adds a test asserting the returned request_id matches
a trace run.

Also flip config.example.json codegen defaults to stream:true and
temperature 1 / top_p 0.95 / presence_penalty 0 / frequency_penalty 1.
This commit is contained in:
gabby committed 2026-10-01 20:35:38 +00:00
1 parent da53e1eefc
commit 8751e7c08e
5 files changed
+113 -8

No files matched your search

+18
View File
@@ -156,6 +156,24 @@ def test_submit_without_engine_returns_fatal_json(tmp_path):
server.close()
def test_submit_returns_request_id_matching_trace(tmp_path):
"""Submit hands the front end the request id so it can open the new run's
flow container and follow it as decisions land."""
scheduler = build_scheduler(tmp_path)
server = Server(scheduler)
try:
status, payload = server.post("/api/submit", {"text": "hello"})
assert status == 200
request_id = payload["request_id"]
assert request_id
status, trace = server.get("/api/trace")
assert status == 200
assert any(run["run_id"] == request_id for run in trace["runs"])
finally:
server.close()
def test_relabel_roundtrip(tmp_path):
scheduler = build_scheduler(tmp_path)
seed_decision(scheduler.log)