feat(skills): Scheduler Bot Phase 2 — dedicated bot /queue + hourly digest (TDPLAN-0008)
- SchedulerBot(BaseBot): rejects free-text (NO tmux/Claude spawn), /queue shells 'drone @daemon queue --json', hourly digest thread, chunked output - base_bot __main__: _BOT_CLASSES maps bot_id->SchedulerBot for systemd launch; passes config chat_id for digest target - bot registered (telegram-bot@scheduler), systemd unit installed (NOT started) - 26 new tests (519 telegram / 252 skills green), seedgo 99% fix(daemon): queue --json emits valid JSON at module level — flatten prompt_preview (collapse newlines) + soft_wrap/markup off. Verified valid via 'python -m'. NOTE: the drone router still re-wraps sub-command stdout at width 80, corrupting machine --json for ALL consumers routed through drone (separate @drone core bug; skills mitigates with strict=False JSON parse).
This commit is contained in:
@@ -102,7 +102,8 @@ def _build_queue(jobs: list, runstate: dict) -> list:
|
||||
owner = f"@{owner.split('@')[0]}"
|
||||
|
||||
prompt = job.get("prompt", "")
|
||||
preview = prompt[:80] + "..." if len(prompt) > 80 else prompt
|
||||
flat = " ".join(prompt.split()) # collapse newlines/whitespace → single-line preview
|
||||
preview = flat[:80] + "..." if len(flat) > 80 else flat
|
||||
|
||||
entries.append(
|
||||
{
|
||||
@@ -183,7 +184,10 @@ def handle_command(command: str, args: List[str]) -> bool:
|
||||
|
||||
if "--json" in args:
|
||||
output = _build_json_output(entries)
|
||||
console.print(json.dumps(output, indent=2))
|
||||
# soft_wrap=True + markup=False — default console.print forces width-80
|
||||
# wrapping on non-TTY and parses [] markup, injecting newlines mid-string
|
||||
# that corrupt machine output. These flags emit clean, parseable JSON.
|
||||
console.print(json.dumps(output, indent=2), soft_wrap=True, markup=False)
|
||||
else:
|
||||
_print_rich_table(entries)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user