fix: 4 small surgical bugs

Salvages #23302 by @Bartok9. Four independent one-area fixes:

1. kanban boards delete alias now hard-deletes (not archives) — the
   alias didn't carry --delete, so getattr(args, 'delete', False)
   returned False. Detect boards_action=='delete' explicitly.
2. Gateway auto-title failures no longer leak as user-visible
   warnings — debug-log only since they're not actionable.
3. Background process completion notification snaps truncation to
   the next newline boundary, prepends a marker when content is
   dropped.
4. _cprint() schedules the run_in_terminal coroutine via
   asyncio.ensure_future so output isn't silently dropped from
   background threads (fixes #23185 Bug A). Skips the
   double-print fallback that would fire for mock paths.
This commit is contained in:
Bartok9 2026-05-18 20:54:46 -07:00 committed by Teknium
parent 3a7ed7be08
commit 365da2d2df
3 changed files with 47 additions and 14 deletions

23
cli.py
View file

@ -1835,13 +1835,26 @@ def _cprint(text: str):
# prompt, prints, and redraws. Fire-and-forget — if scheduling
# fails we fall back to a direct print so the line isn't lost.
def _schedule():
# run_in_terminal() may return either:
# • a coroutine / Future (prompt_toolkit ≥ 3.0) — must be scheduled
# via ensure_future so the coroutine is actually awaited; calling
# it bare would leave it unawaited and silently drop the output
# (fixes #23185 Bug A).
# • None (some mocks / older PT builds) — just call the inner
# function directly since PT already executed it synchronously.
# Do NOT fall back to a bare _pt_print when ensure_future raises,
# because run_in_terminal already invoked the lambda in that case
# (the mock path), which would double-print the line.
try:
run_in_terminal(lambda: _pt_print(_PT_ANSI(text)))
import asyncio as _aio
import inspect as _inspect
coro = run_in_terminal(lambda: _pt_print(_PT_ANSI(text)))
if coro is not None and (_inspect.isawaitable(coro) or _inspect.iscoroutine(coro)):
_aio.ensure_future(coro)
# else: run_in_terminal ran the lambda synchronously; nothing more
# to do (double-scheduling would print twice).
except Exception:
try:
_pt_print(_PT_ANSI(text))
except Exception:
pass
pass # best-effort; the line may already have been printed
try:
loop.call_soon_threadsafe(_schedule)