auth dialog: show a live countdown instead of a static "auto-denies in 2m"
Your AI's guard dog to stop it from going rogue.
Brought to you by:
doberman
Originally created by: fu351
The dialog's message ends with deadline_note(DEFAULT_DIALOG_TIMEOUT_S) ("auto-denies in 2m if unanswered"), appended once when the segments are built (src/doberman/auth/gui_prompter.py:240). The auto-deny itself is a single root.after(int(timeout_s * 1000), root.quit) (:526). A human who walks back with ten seconds left still reads "2m".
What to do
Text widget, or draw it as its own canvas text item), then add a _tick() that recomputes the remaining seconds from the dialog's start time and rewrites that segment every second via root.after(1000, _tick). Stop ticking when the root is destroyed.deadline_note helper if it accepts seconds, otherwise a plain auto-denies in 45s if unanswered. Keep it muted like today.tests/unit/test_gui_prompter.py with the faked root: two simulated ticks change the deadline text, and the after that arms the auto-deny is still scheduled exactly once with the same delay.The timeout value and the deny-on-timeout behaviour stay untouched; a test pinning that already exists and must stay green.