v6: steering semantics, new-topic spawn, 2-option cards, source-aware images
Stacked on #213 (v5). System-prompt-only PR. 127 lines (was 87).
Four new sections
Steering and interrupts
The audit (running this branch through Explore) confirmed: when a new message lands mid-turn ā user reply, scheduled heartbeat firing, button-tap dispatch ā the bot SIGKILLs the running agent process and starts a fresh turn. The old turn's session log persists via --resume so the next turn sees both contexts. It's steering, not queuing.
Doctrine added so the agent works durably:
- Persist intermediate state (
notebook.md,agency.db); don't rely on long-running in-memory work that gets killed. Agent-tool sub-agents die with the parent (same process group).- For work that must survive a preempt:
nohup bash -c 'claude -p "X" | tg-send' >/dev/null 2>&1 &(detaches, result lands in the topic when done).
Spawning new topics for new goals
When the user surfaces a distinct new goal mid-conversation, agent spawns a fresh topic:
tg-schedule "+1 minute" --fresh --name "š <new goal>" "[goal] <start prompt>"
Doctrine on when to spawn (a separate ongoing concern) vs not (small follow-ups, refinements).
Your own schedule is editable
Agent has full access. atq lists heartbeats, atrm <id> removes, tg-schedule '+INTERVAL' --repeat '+INTERVAL' "..." re-schedules. If the user says "every 30 min instead of every hour", agent makes it happen directly.
Cards default to TWO drafted options
New canonical card:
[image ā billboard: source avatar + WHAT, 1-second readable]
<emoji> <verb-led action>
<one sentence: why this moves the goal>
ā¾ š
°ļø Drafted option 1 ā warm
ā¾ š
±ļø Drafted option 2 ā terse
[š
°ļø Send option A] [š
±ļø Send option B]
[š More options] [ā Skip]
Single-option cards remain available for status confirms / one-shot merges, but drafts/replies/posts default to two.
Source-aware images
The card image should make platform + action obvious in 1 second ā Gmail avatar, GitHub octocat, X bird, Slack swatch. Codex can generate images directly; Claude has PIL / matplotlib / browser screenshots. Use whichever is faster.
Test plan
- 33 tests pass
- On a box:
/goalin a forum, observe topic title š prefix, see first heartbeat queued (atq) - Send a message mid-turn ā verify the in-flight process is killed and the new turn picks up both contexts
- Tap Yes on a 2-option card ā verify
--button "š °ļø Send option A"routes correctly
š¤ Generated with Claude Code
Summary by cubic
Defines v6 steering behavior, two-option cards, and source-aware images in the system prompt to make turns resilient to interrupts and decisions faster to approve. Adds new-topic spawning and editable schedules so goals stay organized and on cadence.
- New Features
- Steering and interrupts: a new message mid-turn SIGKILLs the current process and starts a fresh turn with
--resume; persist work (e.g.,notebook.md,agency.db), usenohupfor tasks that must survive, and only parallelize viaAgentsub-processes when safe. - New-topic spawning: when a distinct new goal appears, create a fresh lane with
tg-schedule "+1 minute" --fresh --name "š <title>" "[goal] <prompt>"; keep small follow-ups in the current topic. - Editable schedule: list with
atq, remove withatrm <id>, and re-schedule heartbeats viatg-schedule '+INTERVAL' --repeat '+INTERVAL'. - Two-option cards by default: draft A/B variants with buttons
[š °ļø Send option A]and[š ±ļø Send option B](plus More/Skip); render viaagency-report --block ... --button ...; single-option cards remain for simple confirms. - Source-aware images: card images must reveal platform + action in 1 second (e.g., Gmail avatar, GitHub, X, Slack); use PIL/screenshots or generator as fastest path.
- Steering and interrupts: a new message mid-turn SIGKILLs the current process and starts a fresh turn with