Skip to content

Sonny: /background lists triggers and lookout subscriptions, with a ↻ count per agent - #267

Merged
lydakis merged 5 commits into
mainfrom
claude/project-thread-0a48mk
Oct 28, 2026
Merged

lydakis merged 5 commits into
mainfrom
claude/project-thread-0a48mk

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

George asked for a way to see the triggers that exist, kept separate from /status if it lets you edit them, and for a sign that a bot has something running in the background.

What changes

/background opens its own screen, built like /status. /triggers and /lookout open the same screen, so the old /lookout dump is folded in. It lists what runs for the project's agents with nobody typing, covering the same agents /status covers:

  • Triggers that message, start, or reply to one of those agents, limited to triggers made on this daemon's store. Each row shows when the trigger fires, which bot it goes to, the first line of its message, and what came of it: sent N (of R), the last outcome and how long ago, where its answers go, and its --if.
  • Lookout subscriptions whose subscriber is one of those agents. Each row shows what the subscription watches and how many checks it asked for in the last day. The lead's tasks subscription is marked as Sonny's own.

Keys: ↑/↓ picks a row, and f fires a trigger now (an ask to launchd, the same as trigger fire). d removes a trigger or subscription; it asks once ("d again removes NAME · any other key keeps it") and only a second d goes ahead. Sonny's own lead subscription can't be removed, because opening the project writes it back.

background screen

removing asks twice

Indicator:

  • The footer shows ↻ N in background before the bot's name while the window's agent has triggers or subscriptions of its own. Sonny counts them again every 10 s, from files only, with no daemon call.
  • /status rows add ↻ 2 triggers, 1 subscription to their details line.
  • Sonny's own lead subscription isn't counted, so not every lead shows the glyph.

footer

/status rows

Code changes:

  • trigger::on_store: lists the triggers on a store, with the bots each one is for.
  • lookout::checks: replaces lookout::subscriptions.
  • subs::remove: removes one subscription.

Not in this PR

Shell commands an agent started with background=true aren't listed. The daemon has no way to read them per bot today, so showing them needs a small daemon change.

Testing

  • cargo test -p sonny --bin sonny: 259 passed. New tests cover counting (Sonny's own subscription left out), trigger facts, the card's layout and the two-press d, on_store filtering by store and naming every bot a trigger is for, and per-subscription checks.
  • cargo clippy -p sonny --all-targets is clean.
  • Live run for the screenshots: a real daemon with the scripted demo model and a fake HOME, holding three triggers (launchd plists written by hand, since this is Linux), two subscriptions, and two tasks. Sonny ran in tmux. I removed prs with d, d, checked that it was gone from the file, and saw /status show the counts. I couldn't exercise f and launchd unloading on Linux. They call the same fire_now / remove that sonny trigger uses.

…ounts

/background (also /triggers and /lookout) opens its own screen, like
/status: the project's agents' triggers (when they fire, whom, the
message, what the last fire did) and lookout subscriptions (checks in
the last day). f fires a trigger now, d twice removes one; the lead's
own tasks subscription stays. The footer says "↻ N in background"
for the window's agent, and /status rows add "↻ 2 triggers".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGESsMgEpG3dVsCgRSU
@lydakis lydakis self-assigned this Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T02:59:09.665847Z 152be60 New commits
🔒 Security Review ✅ Completed 2026-10-28T03:00:58.972507Z 152be60 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7738d7d73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/background.rs Resolved

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8ec90ba4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/background.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e8ec90ba4e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@lydakis
lydakis merged commit 9a5e785 into main Oct 28, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 28, 2026
/status stays a card in the pane on the full screen; /background keeps
the screen of its own #267 gave it, now an optional one on Watch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGGUYN2TzGMxH4MDZ3K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants