v9: new-topic helper — spawn fresh lane synchronously, queue heartbeat
MA
7mo ago+181+181+012345678901234567890123456789-2-2-0123456789
Stacked on #216 (v8). One small new helper that fixes a doctrine awkwardness you called out.
Why
tg-schedule "+1 minute" --fresh "..." was being recommended as the way for the agent to spawn a fresh topic for a new project. But that's misusing the schedule API:
- The 1-minute delay is wrong UX (topic appears late).
- It's a one-shot — the spawned topic got an initial prompt and then nothing. No check-in 3 hours later. No heartbeat.
- "Schedule" reads wrong for a synchronous spawn.
What
agent/new-topic — a small Python helper (~140 LOC):
new-topic "<title>" "<initial prompt>" # default +1h heartbeat
new-topic "<title>" --heartbeat "+3 hours" "<prompt>" # custom cadence
new-topic "<title>" --heartbeat none "<prompt>" # one-shot, no follow-up
What it actually does:
createForumTopicsynchronously — topic appears in Telegram immediately, no at-job delay.bot.run_taskto dispatch the initial prompt as the topic's first turn.tg-schedule --repeatto queue the recurring heartbeat (skipped on--heartbeat none).- Prints
{ok, chat_id, thread_id, title, heartbeat}as JSON so the caller can include a link in whatever it's posting back to the user.
/goal stays the user-driven autopilot trigger (no approvals). new-topic is the agent-driven copilot equivalent (default mode, draft + ask).
Changes
agent/new-topic(new, +178 LOC)install.sh+agent/bootstrap.sh— install + symlinkagent/system-prompt.md— "Spawning new topics" rewritten aroundnew-topic
Tests
- 29 pass
- Syntax check
- On a box:
new-topic "Test topic" "draft hello"— verify topic appears, first turn dispatches,atqshows a queued heartbeat -
new-topic "X" --heartbeat none "Y"— verify no heartbeat queued
🤖 Generated with Claude Code
Summary by cubic
Add new-topic to start a fresh Telegram topic instantly, send the first agent turn, and schedule a recurring heartbeat. Replaces the misuse of tg-schedule --fresh so new lanes appear now and keep getting follow‑ups.
- New Features
agent/new-topicCLI:- Creates the forum topic immediately and dispatches the first turn via
bot.run_task. - Queues a recurring heartbeat with
tg-schedule --repeat(default +1h; supports--heartbeat "+3 hours"or--heartbeat none). - Prints JSON
{ok, chat_id, thread_id, title, heartbeat}for easy linking. - New lanes run in copilot mode;
/goalstays the user-driven autopilot.
- Creates the forum topic immediately and dispatches the first turn via
- Added install/symlink in
install.shandagent/bootstrap.sh. Updatedagent/system-prompt.mdto usenew-topic.